diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-24 13:18:41 +0100 |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-24 13:32:38 +0100 |
commit | fc835ea41dffaa7ac6247c2d0d602aadf0e0f09b (patch) | |
tree | 52067b0cc68c2bf5fcbc1fa28ab6080dad230261 /src/gui/itemviews/qabstractitemview.cpp | |
parent | 829d9e10ad3d26fb2fddef01c8e36352018c3fec (diff) |
Itemview: Fixes statustip not cleared
Task-number: QTBUG-1717
Reviewed-by: Thierry
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index c691fe282d..ad15655b9c 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -96,6 +96,7 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate() autoScrollMargin(16), autoScrollCount(0), shouldScrollToCurrentOnShow(false), + shouldClearStatusTip(false), alternatingColors(false), textElideMode(Qt::ElideRight), verticalScrollMode(QAbstractItemView::ScrollPerItem), @@ -161,14 +162,15 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index emit q->entered(index); #ifndef QT_NO_STATUSTIP QString statustip = model->data(index, Qt::StatusTipRole).toString(); - if (parent && !statustip.isEmpty()) { + if (parent && (shouldClearStatusTip || !statustip.isEmpty())) { QStatusTipEvent tip(statustip); QApplication::sendEvent(parent, &tip); + shouldClearStatusTip = !statustip.isEmpty(); } #endif } else { #ifndef QT_NO_STATUSTIP - if (parent) { + if (parent && shouldClearStatusTip) { QString emptyString; QStatusTipEvent tip( emptyString ); QApplication::sendEvent(parent, &tip); @@ -1559,6 +1561,14 @@ bool QAbstractItemView::viewportEvent(QEvent *event) d->viewportEnteredNeeded = true; break; case QEvent::Leave: + #ifndef QT_NO_STATUSTIP + if (d->shouldClearStatusTip && d->parent) { + QString empty; + QStatusTipEvent tip(empty); + QApplication::sendEvent(d->parent, &tip); + d->shouldClearStatusTip = false; + } + #endif d->enteredIndex = QModelIndex(); break; case QEvent::ToolTip: |