diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2015-01-07 15:14:17 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-01-09 11:22:59 +0100 |
commit | 56a82e87e654fa9e77bee8956e94e08a77941e4c (patch) | |
tree | 0d5ebab4e38aa124ff7c41b82c3b7cf8aa47a846 /src/plugins | |
parent | 95cb745e002c38e821b385e90d954adf73363e3c (diff) |
iOS: Prevent recursion when updating/syncing QIOSViewController properties
Change-Id: I22f1eaa892cba23c498ae210a9a483e468268581
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/ios/qiosviewcontroller.mm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index 0afd2bf8ba..01bc84ae68 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -41,6 +41,8 @@ #import "qiosviewcontroller.h" +#include <QtCore/qscopedvaluerollback.h> + #include <QtGui/QGuiApplication> #include <QtGui/QWindow> #include <QtGui/QScreen> @@ -121,6 +123,7 @@ @interface QIOSViewController () { QIOSScreen *m_screen; + BOOL m_updatingProperties; } @property (nonatomic, assign) BOOL changingOrientation; @end @@ -289,6 +292,15 @@ if (!isQtApplication()) return; + // Prevent recursion caused by updating the status bar appearance (position + // or visibility), which in turn may cause a layout of our subviews, and + // a reset of window-states, which themselves affect the view controller + // properties such as the statusbar visibilty. + if (m_updatingProperties) + return; + + QScopedValueRollback<BOOL> updateRollback(m_updatingProperties, YES); + QWindow *focusWindow = QGuiApplication::focusWindow(); // If we don't have a focus window we leave the statusbar |