Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2012

    [Qt 4.8] Qt quick / Qml landscape issue on belle refresh


    I picked up the development for an abandoned Qt app about a month ago. It's almost complete, but I'm facing one bug that I can't manage to fix.
    When I simulate the app, everything works fine, both portrait as landscape. However, when I install the app on my Nokia E7-00 running on nokia belle refresh (Qt 4.8), landscape mode breaks.
    Is there any solution to this?
    I found 1 topic that described similar problems, but didn't find a real solution in that one.

    code concerning the QmlApplicationViewer in main.cpp:
    QScopedPointer<QmlApplicationViewer> tQmlApplicationViewer(QmlApplicationViewer::create());
    // Load the QML entrypoint

    The code in main.qml
    import QtQuick 1.1
    import com.nokia.symbian 1.1
    import com.nokia.extras 1.1
    import "pages"
    import "components"
    import "js/utils.js" as Utils
    import "js/storage.js" as Storage
    import QtQuick 1.0
        id: window
        property string __schemaIdentification: "2"
        Component.onCompleted: {
        // Window structure
        PageStackWindow {
            id: pagestackwindow1
            initialPage: mainPage
            showStatusBar: true
            showToolBar: true
            onRotationChanged: console.log("rotated!")
            Page {
                id: mainPage
               // orientationLock: PageOrientation.LockPortrait
                tools: toolBarLayout
                 TabGroup {
                    id: tabGroup
                    currentTab: liveboardStack
                    anchors.fill: parent
                    PageStack {
                        id: liveboardStack
                        Component.onCompleted: liveboardStack.push(liveboardPage)
                    PageStack {
                        id: travelStack
                        Component.onCompleted: travelStack.push(travelPage)
        // Toolbar
        ToolBarLayout {
            id: toolBarLayout
            // Back buton
            ToolButton {
                property bool closeButton: tabGroup.currentTab.depth <= 1
                flat: true
                iconSource: closeButton ? "icons/close.svg" : "toolbar-back"
                onClicked: closeButton ? Qt.quit() : tabGroup.currentTab.pop();
            // Tab bar
            ButtonRow {
                TabButton { id: tabBtnLiveboard; tab: liveboardStack; iconSource: "toolbar-list" }
                TabButton {id:tabBtnTravel;tab: travelStack; iconSource: "toolbar-search" }
            // Menu
            ToolButton {
                iconSource: "toolbar-menu"
                onClicked: {
                    if (!window.menu)
                        window.menu = Utils.loadObjectByComponent(menuComponent, window)
        // Objects
        // Statically loaded objects
        property variant liveboardPage: LiveboardPage {}
        property variant travelPage: TravelPage {}
        // Dynamically loaded objects
        property variant aboutDialog
        // In-line defined menu component
        property variant menu
        Component {
            id: menuComponent
            Menu {
                id: menu
                content: MenuLayout {
                    // About
                    MenuItem {
                        text: qsTr("About")
                        onClicked: {
                            if (!aboutDialog)
                                aboutDialog = Utils.loadObjectByPath("components/AboutDialog.qml", menu)
                    // Quit
                    MenuItem {
                        text: qsTr("Quit")
                        onClicked: Qt.quit()
        Text {
            id: statustext
            x: 2
            y: 2
            width: 230
            height: 22
            color: "#ffffff"
            text: qsTr("BeTrains")
            font.pixelSize: 20
    The last text object was for testing purposes, and it rotated as it should...
    Image that shows the problem:

    The simulator result is on the left side, screenshots from my E7 on the right. The problem is circled in red.

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Jan 2009
    Melbourne, Australia

    Re: [Qt 4.8] Qt quick / Qml landscape issue on belle refresh

  3. #3
    Registered User
    Join Date
    Sep 2012

    Re: [Qt 4.8] Qt quick / Qml landscape issue on belle refresh

    Quote Originally Posted by hamishwillee View Post
    I already found information on changed coordinates and anchoring etc, but changing the anchoring etc didn't change anything.
    However, I found the solution thanks to the people at StackExchange.
    the pagestackwindow was nestled inside a normal window, something the original author did. This was needed to use component.Oncompleted etc. Anyways, I changed the code to remove the top level window and now it's working

    Thanks for your help anyway

Similar Threads

  1. SSL Error / Belle Refresh
    By Benecore in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2012-09-17, 06:55
  2. Belle refresh with Qt 4.8 rolling out
    By vladestCh in forum Qt
    Replies: 5
    Last Post: 2012-09-04, 08:47
  3. Replies: 2
    Last Post: 2010-12-03, 12:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts