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. How to lock the Orientation in Portrait mode?
Forum Updated to NodeBB v4.3 + New Features

How to lock the Orientation in Portrait mode?

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

    Hi all,
    I am developing an application where i have to lock the screen in portrait mode. there is a problem when the application is opened in landscape mode even though we have locked the application for portrait as bellow,

    @QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);@

    the application works fine when the app is opened in portrait mode, after opening if we turned to landscape its view is as portrait as expected.

    But when we open the application in landscape mode the ui design is completely collapsed.

      The current status is that everything works fine,when the application is opened in portrait mode. When ever i switch to landscape mode and open the application,there the problem occurs.(ie.,the application displays the orientation in the Landscape mode but i need to lock it to portrait mode)
          
         What i need is even when i change the orientation, the screen should be in Portrait mode itself.Thanks for any replies..
    

    Regards,
    Harish.M

    Harish.M

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Which OS are you running on?

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

        Hi Tobias,
        I am using Qt 4.7.4 for Symbian Belle.

        Harish.M

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alexleutgoeb
          wrote on last edited by
          #4

          Have you also tried setting this attribute? http://qt-project.org/wiki/How_to_Port_From_Desktop_to_Mobile#588b961f3bf87b54277c2257aaa2e6dc

          Alex

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

            Hi Alex,
            Thank you for your reply i had already tried that too but no solution.

            (The problem might be)I had designed all the .qml pages using a rectangle and not in a Pagestack.I thought that might be the problem for this issue.

            But looking for this orientation solution in various forums, i came to know that using Pagestack or Rectangle does not cause orientation problem.

            Is there any other way to fix my problem????

            Anyone help me with this......

            :(

            Harish.M

            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