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 Handle Screen Orientation to Portrait in Meego
Forum Update on Monday, May 27th 2025

How to Handle Screen Orientation to Portrait in Meego

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 3.4k 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.
  • R Offline
    R Offline
    rashid.inayat
    wrote on last edited by
    #1

    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
    0
    • A Offline
      A Offline
      andzero
      wrote on last edited by
      #2

      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
      0
      • R Offline
        R Offline
        rashid.inayat
        wrote on last edited by
        #3

        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
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          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
          0

          • Login

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