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>
This commit is contained in:
parent
c023f5600a
commit
7e12d2d30f
@ -347,7 +347,6 @@ QString QAbstractItemDelegate::elidedText(const QFontMetrics &fontMetrics, int w
|
|||||||
|
|
||||||
\sa QHelpEvent
|
\sa QHelpEvent
|
||||||
*/
|
*/
|
||||||
// ### Qt 5: Make this a virtual non-slot function
|
|
||||||
bool QAbstractItemDelegate::helpEvent(QHelpEvent *event,
|
bool QAbstractItemDelegate::helpEvent(QHelpEvent *event,
|
||||||
QAbstractItemView *view,
|
QAbstractItemView *view,
|
||||||
const QStyleOptionViewItem &option,
|
const QStyleOptionViewItem &option,
|
||||||
|
@ -108,8 +108,7 @@ public:
|
|||||||
static QString elidedText(const QFontMetrics &fontMetrics, int width,
|
static QString elidedText(const QFontMetrics &fontMetrics, int width,
|
||||||
Qt::TextElideMode mode, const QString &text);
|
Qt::TextElideMode mode, const QString &text);
|
||||||
|
|
||||||
public Q_SLOTS:
|
virtual bool helpEvent(QHelpEvent *event,
|
||||||
bool helpEvent(QHelpEvent *event,
|
|
||||||
QAbstractItemView *view,
|
QAbstractItemView *view,
|
||||||
const QStyleOptionViewItem &option,
|
const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index);
|
const QModelIndex &index);
|
||||||
|
@ -1658,15 +1658,11 @@ bool QAbstractItemView::viewportEvent(QEvent *event)
|
|||||||
QStyleOptionViewItemV4 option = d->viewOptionsV4();
|
QStyleOptionViewItemV4 option = d->viewOptionsV4();
|
||||||
option.rect = visualRect(index);
|
option.rect = visualRect(index);
|
||||||
option.state |= (index == currentIndex() ? QStyle::State_HasFocus : QStyle::State_None);
|
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
|
QAbstractItemDelegate *delegate = d->delegateForIndex(index);
|
||||||
QMetaObject::invokeMethod(d->delegateForIndex(index), "helpEvent",
|
if (!delegate)
|
||||||
Q_RETURN_ARG(bool, retval),
|
return false;
|
||||||
Q_ARG(QHelpEvent *, he),
|
return delegate->helpEvent(he, this, option, index);
|
||||||
Q_ARG(QAbstractItemView *, this),
|
|
||||||
Q_ARG(QStyleOptionViewItem, option),
|
|
||||||
Q_ARG(QModelIndex, index));
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
case QEvent::FontChange:
|
case QEvent::FontChange:
|
||||||
d->doDelayedItemsLayout(); // the size of the items will change
|
d->doDelayedItemsLayout(); // the size of the items will change
|
||||||
|
Loading…
x
Reference in New Issue
Block a user