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. Portrait mode in Harmattan (Scratchbox)
Forum Updated to NodeBB v4.3 + New Features

Portrait mode in Harmattan (Scratchbox)

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 4 Posters 3.3k 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.
  • D Offline
    D Offline
    Diph
    wrote on last edited by
    #1

    I'm running Xephyr in 480x854 and set /meegotouch/target/name to DefaultPortrait and it works. How do I set the QML application to appear in portrait mode? I tried all the Page orientationLock property alternatives, but none of them works. Seems graphicsview is still in 854x480 mode.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Diph
      wrote on last edited by
      #2

      Bump. It's weird that Scratchbox is in landscape, if Harmattan is mainly used in portrait mode.

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

        I found the following code in "mdeclarativescreen.cpp":http://qt.gitorious.org/qt-components/qt-components/blobs/master/src/meego/mdeclarativescreen.cpp

        @
        MDeclarativeScreenPrivate::MDeclarativeScreenPrivate(MDeclarativeScreen *qq)
        : q(qq)
        , orientation(MDeclarativeScreen::Landscape)
        , finalOrientation(MDeclarativeScreen::Landscape)
        , allowedOrientations(MDeclarativeScreen::Landscape | MDeclarativeScreen::Portrait)
        , isCovered(false)
        , keyboardOpen(false)
        , isTvConnected(false)
        , topLevelWidget(0)
        , oldEventFilter(0)
        #ifdef Q_WS_X11
        , windowId(0)
        #endif
        #ifdef HAVE_CONTEXTSUBSCRIBER
        , topEdgeProperty("Screen.TopEdge")
        , remoteTopEdgeProperty("RemoteScreen.TopEdge")
        , isCoveredProperty("Screen.IsCovered")
        , keyboardOpenProperty("/maemo/InternalKeyboard/Open")
        , videoRouteProperty("com.nokia.policy.video_route")
        , remoteTopEdgeListener(remoteTopEdgeProperty.info()->providerDBusType(),
        remoteTopEdgeProperty.info()->providerDBusName())
        #endif
        , minimized(false)
        {
        // TODO: Could use QDesktopWidget, but what about on host PC?
        displaySize = QSize(854, 480);
        screenSize = QSize(displaySize.width(), displaySize.height());

        oldEventFilter = QCoreApplication::instance()->setEventFilter(x11EventFilter);
        //Q_ASSERT(gScreenPrivate == 0);
        gScreenPrivate = this;
        

        }
        @
        Could it be that displaySize and screenSize forces the UI to landscape mode by default?

        I've had some issues with splash screens (which you can pass to the invoker) being rotated and scaled from portrait to landscape while I'm holding the device in portrait

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qgil
          wrote on last edited by
          #4

          Scratchbox sounds like a bit off-topic here? Anyway, you can find an answer here: http://forum.meego.com/showthread.php?p=24023#post24023

          I haven't followed the entire thread but that is surely a good place to ask Scratchbox&&Harmattan related questions.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Diph
            wrote on last edited by
            #5

            mario: Yeah that might be the problem.

            qgil: Thanks for the link. I actually tried that solution first, but the application is still using 854x480 scene. Only homescreen and default applications are in the portrait mode.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              shullw
              wrote on last edited by
              #6

              Just curious to know if you added a PageStackWindow when you tried the lockorientation option in the Page Element.

              A QML Purest Point of View!

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Diph
                wrote on last edited by
                #7

                Like this:

                main.qml
                @PageStackWindow {
                id: rootWindow
                platformStyle: PageStackWindowStyle { id: defaultStyle }
                initialPage: MainPage {}
                }@

                MainPage.qml
                @Page {
                orientationLock: PageOrientation.LockPortrait
                }
                @

                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