summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-14 09:13:42 +0200
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-14 09:13:42 +0200
commita5898f33f215ff2ac333be61306a47ca162b2104 (patch)
tree6d0e60b465378e0bf61d990e621c406f7408888e /src/gui/kernel/qapplication.cpp
parentd176e39de8fcde92a92866e7b0db5904c90a1e82 (diff)
Trigger fullscreen transition effects properly on app exit.
Avkon calls BeginFullScreen() and EndFullScreen() to trigger the fullscreen system transition effects for application exit, however the calls are made too late for Qt apps because the widgets are already destroyed. Instead, the effects are triggered explicitly from Qt, before closing the widgets, or from aboutToQuit, whichever comes first. Task-number: QT-4718 Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r--src/gui/kernel/qapplication.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 59aec91af4..f906bbfa9c 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -128,6 +128,10 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp
//#define ALIEN_DEBUG
+#if defined(Q_OS_SYMBIAN)
+#include "qt_s60_p.h"
+#endif
+
static void initResources()
{
#if defined(Q_WS_WINCE)
@@ -2432,6 +2436,11 @@ bool QApplication::event(QEvent *e)
{
Q_D(QApplication);
if(e->type() == QEvent::Close) {
+#if defined(Q_OS_SYMBIAN)
+ // In order to have proper application-exit effects on Symbian, certain
+ // native APIs have to be called _before_ closing/destroying the widgets.
+ bool effectStarted = qt_beginFullScreenEffect();
+#endif
QCloseEvent *ce = static_cast<QCloseEvent*>(e);
ce->accept();
closeAllWindows();
@@ -2445,8 +2454,14 @@ bool QApplication::event(QEvent *e)
break;
}
}
- if(ce->isAccepted())
+ if (ce->isAccepted()) {
return true;
+ } else {
+#if defined(Q_OS_SYMBIAN)
+ if (effectStarted)
+ qt_abortFullScreenEffect();
+#endif
+ }
} else if(e->type() == QEvent::LanguageChange) {
#ifndef QT_NO_TRANSLATION
setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);