summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qcombobox.cpp
diff options
context:
space:
mode:
authorMorten Sørvig <msorvig@trolltech.com>2009-08-24 12:00:35 (GMT)
committerMorten Sørvig <msorvig@trolltech.com>2009-08-24 12:00:35 (GMT)
commit3a801a667c7c78076fc4aa84e47432ddd4a382a5 (patch)
tree648bc89e28bdbee9f6fc82f29c4609b97f988032 /src/gui/widgets/qcombobox.cpp
parent1fa620be2794b46a9b5d867ae6b2d7fa844b610c (diff)
downloadQt-3a801a667c7c78076fc4aa84e47432ddd4a382a5.zip
Qt-3a801a667c7c78076fc4aa84e47432ddd4a382a5.tar.gz
Qt-3a801a667c7c78076fc4aa84e47432ddd4a382a5.tar.bz2
Fix QCombobox popup flicker on OS
Don't disable updates when showing the popup. This was introduced by commit 5516c2165, the original bug in task 152840 is not reproducible on OS X. Task-number: Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/widgets/qcombobox.cpp')
-rw-r--r--src/gui/widgets/qcombobox.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index f04a415..2b6d5dd 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2418,7 +2418,16 @@ void QComboBox::showPopup()
&& !style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && !window()->testAttribute(Qt::WA_DontShowOnScreen))
qScrollEffect(container, scrollDown ? QEffects::DownScroll : QEffects::UpScroll, 150);
#endif
+
+// Don't disable updates on Mac OS X. Windows are displayed immediately on this platform,
+// which means that the window will be visible before the call to container->show() returns.
+// If updates are disabled at this point we'll miss our chance at painting the popup
+// menu before it's shown, causing flicker since the window then displays the standard gray
+// background.
+#ifndef Q_WS_MAC
container->setUpdatesEnabled(false);
+#endif
+
container->raise();
container->show();
container->updateScrollers();
@@ -2429,7 +2438,10 @@ void QComboBox::showPopup()
? QAbstractItemView::PositionAtCenter
: QAbstractItemView::EnsureVisible);
+#ifndef Q_WS_MAC
container->setUpdatesEnabled(updatesEnabled);
+#endif
+
container->update();
}