diff options
author | Tor Arne Vestbø <[email protected]> | 2025-06-02 13:25:44 +0200 |
---|---|---|
committer | Tor Arne Vestbø <[email protected]> | 2025-06-05 14:37:54 +0200 |
commit | c604f2031a2147f1257f7f19edfb5c2487a379d7 (patch) | |
tree | 8984f962231fe68e4a4af426678c61eb69447081 | |
parent | a8dab6eb652a634393a668ac7127f566ef35f2a2 (diff) |
If we move from landscape to inverse landscape orientation, the window
will not lay out, so we won't hit viewWillLayoutSubviews, but we still
need to reflect the new orientation of the screen.
Task-number: QTBUG-137249
Pick-to: 6.10 6.9 6.8
Change-Id: I9655052772990ca524c5b94e25b2c58cc058ff67
Reviewed-by: Timur Pocheptsov <[email protected]>
-rw-r--r-- | src/plugins/platforms/ios/qiosviewcontroller.mm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index 4e3766c38a3..36ce785e031 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -367,10 +367,12 @@ // If the statusbar changes orientation due to auto-rotation we don't care, // there will be re-layout anyways. Only if the statusbar changes due to // reportContentOrientation, we need to update the window layout. - if (self.changingOrientation) - return; + if (!self.changingOrientation) + [self.view setNeedsLayout]; - [self.view setNeedsLayout]; + // But we always need to update the screen's orientation + if (self.platformScreen) + self.platformScreen->updateProperties(); } #endif @@ -379,6 +381,9 @@ if (!QCoreApplication::instance()) return; + // Make sure the screen properties are up to date before layout. + // We need this here, even if we also react to status bar orientation + // changes, as only the main screen on iOS has a statusbar. if (self.platformScreen) self.platformScreen->updateProperties(); } |