Nominate our 2022 Qt Champions!

Portrait mode in Harmattan (Scratchbox)

  • 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.

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

  • I found the following code in "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)
    , topEdgeProperty("Screen.TopEdge")
    , remoteTopEdgeProperty("RemoteScreen.TopEdge")
    , isCoveredProperty("Screen.IsCovered")
    , keyboardOpenProperty("/maemo/InternalKeyboard/Open")
    , videoRouteProperty("")
    , remoteTopEdgeListener(>providerDBusType(),>providerDBusName())
    , 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

  • Scratchbox sounds like a bit off-topic here? Anyway, you can find an answer here:

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

  • 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.

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

  • Like this:

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

    @Page {
    orientationLock: PageOrientation.LockPortrait

Log in to reply