summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp22
-rw-r--r--src/widgets/itemviews/qitemdelegate.h2
2 files changed, 6 insertions, 18 deletions
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index 200d99b212..e130953c38 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -468,7 +468,7 @@ void QItemDelegate::paint(QPainter *painter,
value = index.data(Qt::CheckStateRole);
if (value.isValid()) {
checkState = static_cast<Qt::CheckState>(value.toInt());
- checkRect = check(opt, opt.rect, value);
+ checkRect = doCheck(opt, opt.rect, value);
}
// do the layout
@@ -625,7 +625,7 @@ void QItemDelegate::updateEditorGeometry(QWidget *editor,
QString text = QItemDelegatePrivate::replaceNewLine(index.data(Qt::DisplayRole).toString());
QRect pixmapRect = QRect(QPoint(0, 0), option.decorationSize).intersected(pixmap.rect());
QRect textRect = textRectangle(0, option.rect, option.font, text);
- QRect checkRect = check(option, textRect, index.data(Qt::CheckStateRole));
+ QRect checkRect = doCheck(option, textRect, index.data(Qt::CheckStateRole));
QStyleOptionViewItem opt = option;
opt.showDecorationSelected = true; // let the editor take up all available space
doLayout(opt, &checkRect, &pixmapRect, &textRect, false);
@@ -1079,7 +1079,7 @@ QRect QItemDelegate::rect(const QStyleOptionViewItem &option,
Q_D(const QItemDelegate);
QVariant value = index.data(role);
if (role == Qt::CheckStateRole)
- return check(option, option.rect, value);
+ return doCheck(option, option.rect, value);
if (value.isValid() && !value.isNull()) {
switch (value.type()) {
case QVariant::Invalid:
@@ -1109,20 +1109,8 @@ QRect QItemDelegate::rect(const QStyleOptionViewItem &option,
/*!
\internal
-
- Note that on Mac, if /usr/include/AssertMacros.h is included prior
- to QItemDelegate, and the application is building in debug mode, the
- check(assertion) will conflict with QItemDelegate::check.
-
- To avoid this problem, add
-
- #ifdef check
- #undef check
- #endif
-
- after including AssertMacros.h
*/
-QRect QItemDelegate::check(const QStyleOptionViewItem &option,
+QRect QItemDelegate::doCheck(const QStyleOptionViewItem &option,
const QRect &bounding, const QVariant &value) const
{
if (value.isValid()) {
@@ -1280,7 +1268,7 @@ bool QItemDelegate::editorEvent(QEvent *event,
if ((event->type() == QEvent::MouseButtonRelease)
|| (event->type() == QEvent::MouseButtonDblClick)
|| (event->type() == QEvent::MouseButtonPress)) {
- QRect checkRect = check(option, option.rect, Qt::Checked);
+ QRect checkRect = doCheck(option, option.rect, Qt::Checked);
QRect emptyRect;
doLayout(option, &checkRect, &emptyRect, &emptyRect, false);
QMouseEvent *me = static_cast<QMouseEvent*>(event);
diff --git a/src/widgets/itemviews/qitemdelegate.h b/src/widgets/itemviews/qitemdelegate.h
index 9e21686b8b..5ea6b33f2d 100644
--- a/src/widgets/itemviews/qitemdelegate.h
+++ b/src/widgets/itemviews/qitemdelegate.h
@@ -120,7 +120,7 @@ protected:
QPixmap decoration(const QStyleOptionViewItem &option, const QVariant &variant) const;
QPixmap *selected(const QPixmap &pixmap, const QPalette &palette, bool enabled) const;
- QRect check(const QStyleOptionViewItem &option, const QRect &bounding,
+ QRect doCheck(const QStyleOptionViewItem &option, const QRect &bounding,
const QVariant &variant) const;
QRect textRectangle(QPainter *painter, const QRect &rect,
const QFont &font, const QString &text) const;