summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorMorten Johan Sorvig <morten.sorvig@nokia.com>2011-12-16 13:12:39 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-14 23:02:12 +0100
commitd6311a06515221e41edb69722b571080c08d11ce (patch)
tree68d67e7f76fe0a826a2b6237890dfe9e3117e228 /src/widgets
parent439a78974576894b23bce0621e49ce4a593428a9 (diff)
Cocoa: Improve basic window handling.
Refactor NSWindow creation into createNSWindow and setNSWindow. This is necessary to support QMacNativeWidget where we re-use an already created window. Implement popup window handling. Make sure the window is displayed correctly and closes when it should. Take control over window activation in order to prevent infinite loops involving the QtCreator "cmd-k" window. Activation events are for now not sent to popup-type windows. There is now a different set of test failures: add and remove some QEXPECT_FAILs. Change-Id: I229761b59f90c9815b968eacc2cbc9c20cc5047e Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qcombobox.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index c5f5d6e6e1..8d40d17fb1 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -58,6 +58,7 @@
#include <qtreeview.h>
#include <qheaderview.h>
#include <qmath.h>
+#include <qmetaobject.h>
#include <private/qguiapplication_p.h>
#include <private/qapplication_p.h>
#include <private/qcombobox_p.h>
@@ -2545,17 +2546,25 @@ void QComboBox::hidePopup()
// Fade out.
bool needFade = style()->styleHint(QStyle::SH_Menu_FadeOutOnHide);
+ bool didFade = false;
if (needFade) {
-#if defined(Q_WS_MAC)
- macWindowFade(qt_mac_window_for(d->container));
-#endif // Q_WS_MAC
+#if defined(Q_OS_MAC)
+ QPlatformNativeInterface *platformNativeInterface = qApp->platformNativeInterface();
+ int at = platformNativeInterface->metaObject()->indexOfMethod("fadeWindow()");
+ if (at != -1) {
+ QMetaMethod windowFade = platformNativeInterface->metaObject()->method(at);
+ windowFade.invoke(platformNativeInterface, Q_ARG(QWindow *, d->container->windowHandle()));
+ didFade = true;
+ }
+
+#endif // Q_OS_MAC
// Other platform implementations welcome :-)
}
d->model->blockSignals(false);
d->container->itemView()->blockSignals(false);
d->container->blockSignals(false);
- if (!needFade)
+ if (!didFade)
#endif // QT_NO_EFFECTS
// Fade should implicitly hide as well ;-)
d->container->hide();