summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2020-02-27 15:33:37 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2020-02-27 14:36:25 +0000
commit5058c4b7cbbeace3136dac6ead31d4aacfb0a877 (patch)
treedf8bdccd5a03e30d9775505e1a1725368f7afd45
parentdc4c9d051737598e3880b7a8d5c4226020fa020b (diff)
Use contentOrientation to better handle screen rotations
Use the contentOrientation hint to tell Window when we have rotated the screen. This will solve issues with popups and combo boxes. Change-Id: I19fab5f7425525acde35d93dc1b7156eb04ba812 Fixes: QTBUG-78257 Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
-rw-r--r--qml/Main.qml3
1 files changed, 3 insertions, 0 deletions
diff --git a/qml/Main.qml b/qml/Main.qml
index 99c6e4d..7764363 100644
--- a/qml/Main.qml
+++ b/qml/Main.qml
@@ -39,6 +39,9 @@ Window {
color: viewSettings.backgroundColor
property alias appFont: viewSettings.appFont
+ contentOrientation: Screen.desktopAvailableHeight > Screen.desktopAvailableWidth ?
+ (globalSettings.rotationSelected ? Qt.InvertedLandscapeOrientation : Qt.LandscapeOrientation) :
+ (globalSettings.rotationSelected ? Qt.InvertedPortraitOrientation : Qt.PortraitOrientation)
ViewSettings {
id: viewSettings