Skip to content

Instantly share code, notes, and snippets.

@j2doll
Last active October 5, 2019 06:59
Show Gist options
  • Save j2doll/64e26b4b24424027c8d4c430dfae6a85 to your computer and use it in GitHub Desktop.
Save j2doll/64e26b4b24424027c8d4c430dfae6a85 to your computer and use it in GitHub Desktop.
Screen.orientation : Qt::ScreenOrientation

Screen.orientation : Qt::ScreenOrientation

  • This contains the current orientation of the screen, from the accelerometer (if any). On a desktop computer, this value typically does not change.

  • If primaryOrientation == orientation, it means that the screen automatically rotates all content which is displayed, depending on how you hold it. But if orientation changes while primaryOrientation does NOT change, then probably you are using a device which does not rotate its own display. In that case you may need to use Item.rotation or Item.transform to rotate your content.

  • Note: This property does not update unless a Screen::orientationUpdateMask is set to a value other than 0.

  • https://doc.qt.io/qt-5/qml-qtquick-window-screen.html#orientation-attached-prop

  • https://doc.qt.io/qt-5/qml-qtquick-window-screen.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment