summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2011-12-15 17:43:48 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-19 10:42:26 +0100
commit7e12d2d30f74b5fe1f80fac7192416cf6eb22d4d (patch)
treea8ccae63ce9f8ba29ca77929ee19dbdc210a97fc /src/widgets/itemviews/qabstractitemview.cpp
parentc023f5600a161e95a9077aba402a57aa2855cb07 (diff)
Change a slot into a virtual method.
Implements a BiC Qt5 TODO. Change-Id: Ie7dc32d954335019166dbd78d8b01ef79e2ad5c2 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/itemviews/qabstractitemview.cpp')
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 06544e3146..0776ca61f0 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -1658,15 +1658,11 @@ bool QAbstractItemView::viewportEvent(QEvent *event)
QStyleOptionViewItemV4 option = d->viewOptionsV4();
option.rect = visualRect(index);
option.state |= (index == currentIndex() ? QStyle::State_HasFocus : QStyle::State_None);
- bool retval = false;
- // ### Qt 5: make this a normal function call to a virtual function
- QMetaObject::invokeMethod(d->delegateForIndex(index), "helpEvent",
- Q_RETURN_ARG(bool, retval),
- Q_ARG(QHelpEvent *, he),
- Q_ARG(QAbstractItemView *, this),
- Q_ARG(QStyleOptionViewItem, option),
- Q_ARG(QModelIndex, index));
- return retval;
+
+ QAbstractItemDelegate *delegate = d->delegateForIndex(index);
+ if (!delegate)
+ return false;
+ return delegate->helpEvent(he, this, option, index);
}
case QEvent::FontChange:
d->doDelayedItemsLayout(); // the size of the items will change