diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-08-14 07:40:22 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-08-14 07:40:22 (GMT) |
commit | c2839917f7dabd704406e7e57e3a982b646106a0 (patch) | |
tree | 58ce9d7e575d902999b65e26ca8fa0781ca197ea | |
parent | 28a67ceafaf65b56c7795b41f9a645b1349cd346 (diff) | |
parent | 7d68b34a1f261b2b23400fddcf46d6521eae32d1 (diff) | |
download | Qt-c2839917f7dabd704406e7e57e3a982b646106a0.zip Qt-c2839917f7dabd704406e7e57e3a982b646106a0.tar.gz Qt-c2839917f7dabd704406e7e57e3a982b646106a0.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 24 | ||||
-rw-r--r-- | tests/auto/_Categories/QtGui.txt | 4 | ||||
-rw-r--r-- | tests/auto/languagechange/tst_languagechange.cpp | 5 |
3 files changed, 20 insertions, 13 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index db78349..44ac380 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -75,10 +75,11 @@ QT_BEGIN_NAMESPACE #if defined(QT_DEBUG) static bool appNoGrab = false; // Grabbing enabled #endif - +static bool app_do_modal = false; // modal mode Q_GLOBAL_STATIC(QS60Data, qt_s60Data); -extern bool qt_sendSpontaneousEvent(QObject*,QEvent*); +extern bool qt_sendSpontaneousEvent(QObject*,QEvent*); +extern QWidgetList *qt_modal_stack; // stack of modal widgets extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp QWidget *qt_button_down = 0; // widget got last button-down @@ -788,17 +789,26 @@ QString QApplicationPrivate::appName() const bool QApplicationPrivate::modalState() { - return false; + return app_do_modal; } -void QApplicationPrivate::enterModal_sys(QWidget * /* widget */) +void QApplicationPrivate::enterModal_sys(QWidget *widget) { - // TODO: Implement QApplicationPrivate::enterModal_sys(QWidget *widget) + if (!qt_modal_stack) + qt_modal_stack = new QWidgetList; + qt_modal_stack->insert(0, widget); + app_do_modal = true; } -void QApplicationPrivate::leaveModal_sys(QWidget * /* widget */) +void QApplicationPrivate::leaveModal_sys(QWidget *widget) { - // TODO: Implement QApplicationPrivate::leaveModal_sys(QWidget *widget) + if (qt_modal_stack && qt_modal_stack->removeAll(widget)) { + if (qt_modal_stack->isEmpty()) { + delete qt_modal_stack; + qt_modal_stack = 0; + } + } + app_do_modal = qt_modal_stack != 0; } void QApplicationPrivate::openPopup(QWidget *popup) diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt index 495a173..d8af499 100644 --- a/tests/auto/_Categories/QtGui.txt +++ b/tests/auto/_Categories/QtGui.txt @@ -1,6 +1,6 @@ exceptionsafety_objects #gestures This test is incomplete and also missing from auto.pro -> disabled for now -#languagechange Uses unexported method QThreadData::current() and also missing from auto.pro -> disabled for now +languagechange math3d modeltest qabstractbutton @@ -100,7 +100,7 @@ qmainwindow #qmdisubwindow not relevant for S60, skip for now qmenu qmenubar -#qmessagebox that's a hanger +qmessagebox qmouseevent qmouseevent_modal qmovie diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp index 7cca3bf..7c98809 100644 --- a/tests/auto/languagechange/tst_languagechange.cpp +++ b/tests/auto/languagechange/tst_languagechange.cpp @@ -122,10 +122,7 @@ public slots: void install() { QCoreApplication::installTranslator(this); QTest::qWait(2500); - //### is there any better way to close a Qt dialog? - QThreadData *data = QThreadData::current(); - if (!data->eventLoops.isEmpty()) - data->eventLoops.top()->quit(); + QApplication::closeAllWindows(); } public: mutable QSet<QByteArray> m_translations; |