Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Screen.orientation does not update on Android
Forum Updated to NodeBB v4.3 + New Features

Screen.orientation does not update on Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 153 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DonLakeFlyer
    wrote on last edited by DonLakeFlyer
    #1

    The follow code to output screen orientation changes works on iOs but does not work on Android. I'm using Qt 5.12.4. I've tested on a number of different android tablets with the same result. The Screen.orientation value never changes from the original value. All works fine on iOs. Not sure if I'm doing something wrong or it's a Qt bug or something else.

    mport QtQuick 2.12
    import QtQuick.Window 2.12
    
    Window {
        visible: true
        width: 640
        height: 480
        color: "green"
        title: qsTr("Hello World")
        Screen.orientationUpdateMask: Qt.LandscapeOrientation | Qt.PortraitOrientation | Qt.InvertedLandscapeOrientation | Qt.InvertedPortraitOrientation
    
        Timer {
            interval: 1000
            repeat: true
            running: true
            onTriggered:  console.log(Screen.orientationUpdateMask, Screen.orientation)
        }
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved