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. How to set orientation to Portrait for Android and iOS?
Forum Updated to NodeBB v4.3 + New Features

How to set orientation to Portrait for Android and iOS?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 1.5k 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.
  • N Offline
    N Offline
    NTMS
    wrote on last edited by
    #1

    I am using Qt 5.10 QML I need to set ApplicationWindow orientation to Portrait for Android and iOS? How should I do that?

    raven-worxR 1 Reply Last reply
    0
    • N NTMS

      I am using Qt 5.10 QML I need to set ApplicationWindow orientation to Portrait for Android and iOS? How should I do that?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @NTMS
      If you mean permanently from startup on, this is not a matter of Qt, but of the App definition. E.g. in Android you would specify the orientation in the AndroidManifest.xml
      To change the orientation dynamically you need to make some JNI calls (see this).

      I don't know about iOS, but i guess the procedure is similar.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • N Offline
        N Offline
        NTMS
        wrote on last edited by
        #3

        @raven-worx yes I need permanently from startup on. Both android and ios. How do I do that? Where do I get the information for ios. Thanks

        ekkescornerE 1 Reply Last reply
        0
        • N NTMS

          @raven-worx yes I need permanently from startup on. Both android and ios. How do I do that? Where do I get the information for ios. Thanks

          ekkescornerE Offline
          ekkescornerE Offline
          ekkescorner
          Qt Champions 2016
          wrote on last edited by
          #4

          @NTMS apple has a very good documentation
          https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW10

          <key>UISupportedInterfaceOrientations</key>
          <array>
          <string>UIInterfaceOrientationPortrait</string>
          </array>

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
          5.15 --> 6.9 https://t1p.de/ekkeChecklist
          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

          1 Reply Last reply
          1
          • N Offline
            N Offline
            NTMS
            wrote on last edited by
            #5

            @raven-worx and @ekkescorner
            I thank you both. It is working now.
            I created an "Other files" and I place android and ios folder in as shown below. I use AndroidManifest for android and Project-Infofor ios.

            0_1520507849930_AAA.jpg

            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