summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-04-05 09:19:20 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-04-05 09:19:20 (GMT)
commit2e0b5644e17f22ef3fc24ce4c762449149b24af6 (patch)
tree119bf475818d61c7bb88f9d3ae2d1349ebc8f2e5 /src
parent3c2373d7ea9bc91bb537c0725984d19ad0fbab01 (diff)
downloadQt-2e0b5644e17f22ef3fc24ce4c762449149b24af6.zip
Qt-2e0b5644e17f22ef3fc24ce4c762449149b24af6.tar.gz
Qt-2e0b5644e17f22ef3fc24ce4c762449149b24af6.tar.bz2
Mac: p2 combobox regression fix
The combobox popup on mac fails to re-highlight the last item in the list when then mouse leaves the popup, and re-enter. We tried to fix this in 780b4d84, but is turned out to break the cleanlooks style. For this second try, we allow the code to set the index under mouse when the mouse hovers an item in the list, even if the index is current. It seems to cause low overhead, and should be safe. Task-number: QTBUG-17738 Reviewed-by: jbache
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qcombobox.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index dbbf49a..1c0a529 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -398,7 +398,7 @@ void QComboBoxPrivateContainer::leaveEvent(QEvent *)
#ifdef Q_WS_MAC
QStyleOptionComboBox opt = comboStyleOption();
if (combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo))
- view->setCurrentIndex(QModelIndex());
+ view->clearSelection();
#endif
}
@@ -671,8 +671,8 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
if (vector.manhattanLength() > 9 && blockMouseReleaseTimer.isActive())
blockMouseReleaseTimer.stop();
QModelIndex indexUnderMouse = view->indexAt(m->pos());
- if (indexUnderMouse.isValid() && indexUnderMouse != view->currentIndex()
- && !QComboBoxDelegate::isSeparator(indexUnderMouse)) {
+ if (indexUnderMouse.isValid()
+ && !QComboBoxDelegate::isSeparator(indexUnderMouse)) {
view->setCurrentIndex(indexUnderMouse);
}
}