Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED] How to disable screen rotation on condition

[SOLVED] How to disable screen rotation on condition

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 2.2k Views
  • 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.
  • M Offline
    M Offline
    morte
    wrote on last edited by
    #1

    For example there is few QML pages, how to enable/disable screen rotation on specific page?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      How do you do screen rotation ?

      157

      1 Reply Last reply
      0
      • M Offline
        M Offline
        morte
        wrote on last edited by
        #3

        Hi, i mean changing screen orientation on rotation of Android device, its changes automatically.

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          I think it will require using QAndroidJniObject and calling the native api as the screen rotation is handled by OS.

          157

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcm_qt
            wrote on last edited by
            #5

            In AndroidManifest.xml you have option, on which all orientation does the app have to work on.

            When you check You can see similar like,

            <activity
            android:name="com.android"
            android:label="text"
            android:screenOrientation="portrait".
            ...
            </activity>

            1 Reply Last reply
            0
            • M Offline
              M Offline
              morte
              wrote on last edited by
              #6

              [quote author="p3c0" date="1416553159"]I think it will require using QAndroidJniObject and calling the native api as the screen rotation is handled by OS. [/quote]
              Yeah, thanks, i set it with JNI call of setRequestedOrientation.

              [quote author="mcm_qt" date="1416582887"] In AndroidManifest.xml you have option, on which all orientation does the app have to work on.

              When you check You can see similar like,

              <activity
              android:name="com.android"
              android:label="text"
              android:screenOrientation="portrait".
              ...
              </activity>[/quote]

              I know that orientation can be set in manifest, but that about how to change it at runtime.

              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