summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-08-14 06:39:14 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-08-14 06:39:14 (GMT)
commit01ecc29ad3f737fb8e1cc3a33dfa4687cd74c1a5 (patch)
treedf8eaad887e0d57b57ed4232c136b65aef90c834 /src/gui/kernel/qapplication_s60.cpp
parent6bd267a6af1ab5c10f4d70d8812ab76ffa6caffd (diff)
downloadQt-01ecc29ad3f737fb8e1cc3a33dfa4687cd74c1a5.zip
Qt-01ecc29ad3f737fb8e1cc3a33dfa4687cd74c1a5.tar.gz
Qt-01ecc29ad3f737fb8e1cc3a33dfa4687cd74c1a5.tar.bz2
Implemented minimalistic modal handling for Symbian OS.
The implementation is likely not complete, but makes autotests using QApplication::activeModalWidget to pass. At least the following test now pass successfully: qcolordialog qmessagebox Might have positive impact to other autotests as well.
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp24
1 files changed, 17 insertions, 7 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)