Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    How to Handle Screen Orientation to Portrait in Meego

    Mobile and Embedded
    3
    4
    3072
    Loading More Posts
    • 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.
    • R
      rashid.inayat last edited by

      Hi Guys!

      I am working on an meego app thet will only run in portrait mode of screen orientation.
      But If I use lock screen to portrait while creating new app or either if I change orientation in main.cpp file like below
      @viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);@

      It works pretty fine on symbian phone nokia c700 but on meego it shows only landscape mode of screen. But my app only needs to be supported in portrait.

      So How can I lock screen orientation to Portrait in Meego n950?

      Thank You

      1 Reply Last reply Reply Quote 0
      • A
        andzero last edited by

        Have you tried

        @view.setAttribute(Qt::WA_Maemo5PortraitOrientation , true)@ or @view.setAttribute(Qt::WA_LockPortraitOrientation, true)@

        or, if by any chance you're using QML:
        @orientationLock: PageOrientation.LockPortrait@

        hope this helps!

        1 Reply Last reply Reply Quote 0
        • R
          rashid.inayat last edited by

          Thank You Andzero for giving quick response.
          But
          @orientationLock: PageOrientation.LockPortrait@
          is only part of Page element in qml but in my app I am using rectangles Items and a Loader to move from one screen to other So I can not use this API in qml.
          Also my app is typically in QmL so cannot do much in cpp but would you tell me about the view element in your answer in cpp, since I am using viewer which does not haveany any setattribute api to be used.

          Thank You

          1 Reply Last reply Reply Quote 0
          • M
            mlong last edited by

            If you use a PageStackWindow and a single Page element as the base element for all of your other QML code, then you can use the orientationLock property. You don't need to take advantage of the advanced page stacking and navigation features.

            Software Engineer
            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post