summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qlistview.cpp
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-06-18 09:52:54 (GMT)
committermae <qt-info@nokia.com>2009-06-18 09:57:09 (GMT)
commite9247f1da01f20ecd9e70b47286e7eb68bae892a (patch)
tree3eb50122f4df5f3c1296f353ca6ed97c029b0b91 /src/gui/itemviews/qlistview.cpp
parent3af96d2fc56dffc5891f162de5daa3a804d9a91d (diff)
downloadQt-e9247f1da01f20ecd9e70b47286e7eb68bae892a.zip
Qt-e9247f1da01f20ecd9e70b47286e7eb68bae892a.tar.gz
Qt-e9247f1da01f20ecd9e70b47286e7eb68bae892a.tar.bz2
Fix accidental selection of popup items under the mouse in QComboBox
If the widget under mouse is hidden, Qt can generate a synthetic mouse move event which gets delivered to the already hidden widget. This can then result in the wrong item being selected. Workaround: in QListView, ignore mouse move events when the widget is hidden. Reviewed-by: Denis
Diffstat (limited to 'src/gui/itemviews/qlistview.cpp')
-rw-r--r--src/gui/itemviews/qlistview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 9b25730..f1b0d19 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -827,6 +827,8 @@ void QListView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e
*/
void QListView::mouseMoveEvent(QMouseEvent *e)
{
+ if (!isVisible())
+ return;
Q_D(QListView);
QAbstractItemView::mouseMoveEvent(e);
if (state() == DragSelectingState