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>
This commit is contained in:
parent
95cb745e00
commit
56a82e87e6
@ -41,6 +41,8 @@
|
|||||||
|
|
||||||
#import "qiosviewcontroller.h"
|
#import "qiosviewcontroller.h"
|
||||||
|
|
||||||
|
#include <QtCore/qscopedvaluerollback.h>
|
||||||
|
|
||||||
#include <QtGui/QGuiApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
#include <QtGui/QWindow>
|
#include <QtGui/QWindow>
|
||||||
#include <QtGui/QScreen>
|
#include <QtGui/QScreen>
|
||||||
@ -121,6 +123,7 @@
|
|||||||
|
|
||||||
@interface QIOSViewController () {
|
@interface QIOSViewController () {
|
||||||
QIOSScreen *m_screen;
|
QIOSScreen *m_screen;
|
||||||
|
BOOL m_updatingProperties;
|
||||||
}
|
}
|
||||||
@property (nonatomic, assign) BOOL changingOrientation;
|
@property (nonatomic, assign) BOOL changingOrientation;
|
||||||
@end
|
@end
|
||||||
@ -289,6 +292,15 @@
|
|||||||
if (!isQtApplication())
|
if (!isQtApplication())
|
||||||
return;
|
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();
|
QWindow *focusWindow = QGuiApplication::focusWindow();
|
||||||
|
|
||||||
// If we don't have a focus window we leave the statusbar
|
// If we don't have a focus window we leave the statusbar
|
||||||
|
Loading…
x
Reference in New Issue
Block a user