on xenial help sign in
Change Orientations object to QtObject so binding doesn't segv
12ab1f6Josh Arenson
qml/OrientedShell.qml+4−3
@@ -37,8 +37,9 @@ Rectangle {
37 name: applicationArguments.deviceName
37 name: applicationArguments.deviceName
38 }
38 }
39
39
40− property var orientations: Orientations {
40+ property alias orientations: orientations_
41− id: orientations
41+ Orientations {
42+ id: orientations_
42 // NB: native and primary orientations here don't map exactly to their QScreen counterparts
43 // NB: native and primary orientations here don't map exactly to their QScreen counterparts
43 native_: root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
44 native_: root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
44
45
@@ -158,7 +159,7 @@ Rectangle {
158 width: root.width
159 width: root.width
159 height: root.height
160 height: root.height
160 orientation: root.angleToOrientation(orientationAngle)
161 orientation: root.angleToOrientation(orientationAngle)
161− orientations: root.orientations
162+ orientations: root.orientations ? root.orientations : ""
162 nativeWidth: root.width
163 nativeWidth: root.width
163 nativeHeight: root.height
164 nativeHeight: root.height
164 mode: applicationArguments.mode
165 mode: applicationArguments.mode
qml/Stages/DesktopStage.qml+1−1
@@ -37,7 +37,7 @@ Rectangle {
37 property real inverseProgress: 0 // just to comply with the interface shared between stages
37 property real inverseProgress: 0 // just to comply with the interface shared between stages
38 property int shellOrientationAngle: 0
38 property int shellOrientationAngle: 0
39 property int shellOrientation
39 property int shellOrientation
40− property Orientations orientations
40+ property QtObject orientations
41 property bool beingResized: false
41 property bool beingResized: false
42 property bool keepDashRunning: true
42 property bool keepDashRunning: true
43 property bool suspended: false
43 property bool suspended: false
qml/Stages/PhoneStage.qml+1−1
@@ -41,7 +41,7 @@ Rectangle {
41 property int shellOrientationAngle: 0
41 property int shellOrientationAngle: 0
42
42
43 property int shellOrientation
43 property int shellOrientation
44− property Orientations orientations
44+ property QtObject orientations
45 property real nativeWidth
45 property real nativeWidth
46 property real nativeHeight
46 property real nativeHeight
47 property bool beingResized: false
47 property bool beingResized: false
qml/Stages/SpreadDelegate.qml+1−1
@@ -42,7 +42,7 @@ FocusScope {
42 property alias application: appWindow.application
42 property alias application: appWindow.application
43 property int shellOrientationAngle
43 property int shellOrientationAngle
44 property int shellOrientation
44 property int shellOrientation
45− property Orientations orientations
45+ property QtObject orientations
46
46
47 function matchShellOrientation() {
47 function matchShellOrientation() {
48 if (!root.application)
48 if (!root.application)
qml/Stages/TabletStage.qml+1−3
@@ -40,10 +40,8 @@ Rectangle {
40 property bool suspended: false
40 property bool suspended: false
41 property int shellOrientationAngle: 0
41 property int shellOrientationAngle: 0
42
42
43− // For some reason qml doesn't seem to like to bind to a QtObject, so this is a var
44− property var deviceSpecificOrientationOverrides
45 property int shellOrientation
43 property int shellOrientation
46− property Orientations orientations
44+ property QtObject orientations
47 property real nativeWidth
45 property real nativeWidth
48 property real nativeHeight
46 property real nativeHeight
49
47