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"
|
||||
|
||||
#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
|
||||
|
Loading…
x
Reference in New Issue
Block a user