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":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



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



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

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

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.