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. Error on startup for QML app on MeeGo
Qt 6.11 is out! See what's new in the release blog

Error on startup for QML app on MeeGo

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 1.6k 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.
  • I Offline
    I Offline
    Ices_Eyes
    wrote on last edited by
    #1

    Hi all.
    I'm trying to port my QML app on Meego. When testing it on the simulator all works, but when I try to launch it on the meego emulator, it installed fine, but then I obtain the following error:
    @QObject: Cannot create children for a parent that is in a different thread.
    (Parent is QIcdEngine(0x1fb71100), parent's thread is QThread(0x1fb6f5e8), current thread is QThread(0x1f588318)@

    Is there someone that can point me on the right direction? The app start with a QML spalshscreen with a loader that load the main app as described in a nokia developer wiki page (http://www.developer.nokia.com/Community/Wiki/Implementing_a_Splash_Screen_with_Qt_Quick#Pure_QML_approach).
    After this the main app is showed.
    If I remove the spashscreen the app seems to start correctly.
    This is the splashscreen nad loader code:

    AppLoader.qml (the file called from the main.cpp)
    @import QtQuick 1.1

    Item {
    id: mainAppLoaderItem

    property bool splashScreenCanBeClosed: false
    
    // Loaders for the main application and the splash screen.
    Loader {
        id: mainAppLoader
        width: mainAppLoaderItem.width
        height: mainAppLoaderItem.height
    }
    
    Loader {
        id: splashScreenLoader
        source: Qt.resolvedUrl("SplashScreen.qml");
        width: mainAppLoaderItem.width
        height: mainAppLoaderItem.height
    }
    
    // Timers for starting to load the main application and eventually deleting
    // the splash screen.
    Timer {
        id: firstPhaseTimer
        property int phase: 0
        interval: 50
        running: true
        repeat: false
    
        onTriggered: {
            if(!mainAppLoader.Loading) {
                mainAppLoader.source = Qt.resolvedUrl("AppMainWin.qml");
                secondPhaseTimer.start();
            }
        }
    }
    
    Timer {
        id: secondPhaseTimer
        property int phase: 0
        interval: 800
        running: false
        repeat: true
    
        onTriggered: {
            if (phase == 0) {
                if(mainAppLoader.Loading) {
                    return;
                }
                // Set the phase for deletion.
                phase += 1;
            }
            else if(phase == 1) {
                if(!splashScreenCanBeClosed)
                    return;
    
                // Hide the splash screen.
                if(splashScreenLoader.item) {
                    splashScreenLoader.item.opacity = 0;
                }
    
                phase += 1;
            }
            else {
                // By setting the source property to an empty string destroys
                // the loaded item.
                splashScreenLoader.source = "";
    
                secondPhaseTimer.stop();
            }
        }
    }
    

    }@

    Splascreen.qml
    @import QtQuick 1.1

    Item {
    id: splashScreen

    z: 150
    
    Rectangle {
        color: "#1D3652"
        anchors.fill: parent
    }
    
    Item {
        anchors {
            top: parent.top
            right: parent.right
            rightMargin: 10
            topMargin: 10
        }
        width: 30
        height: 30
    
        visible: splashScreen.opacity == 1
    
        Image {
            anchors.centerIn: parent
            fillMode: Image.PreserveAspectFit
            source: "qrc:images/close.svg"
            sourceSize.height: parent.height - 10
            smooth: true
        }
    
        MouseArea {
            anchors.fill: parent
            onClicked: Qt.quit()
        }
    }
    
    Item {
        id: appLogo
        anchors.centerIn: parent
        height: childrenRect.height
    
        Image {
            id: appIcon
            anchors.horizontalCenter: parent.horizontalCenter
            sourceSize.width: 100
            fillMode: Image.PreserveAspectFit
            smooth: true
            source: "qrc:images/icon.svg"
        }
    
        Image {
            id: appName
            anchors.top: appIcon.bottom
            anchors.horizontalCenter: parent.horizontalCenter
            source: "qrc:images/app_banner.png"
        }
    }
    
    Image {
        anchors {
            top: appLogo.bottom
            topMargin: splashScreen.width > splashScreen.height ? 30 : 50
            horizontalCenter: parent.horizontalCenter
        }
    
        scale: 0.8
    
        source: "qrc:images/loadingapp.png"
        visible: splashScreen.opacity == 1
    
        NumberAnimation on rotation {
            running: splashScreen.opacity == 1
            from: 0
            to: 360
            loops: Animation.Infinite
            duration: 1200
        }
    }
    
    Text {
        anchors {
            bottom: parent.bottom
            right: parent.right
            bottomMargin: 5
            rightMargin: 5
        }
        ...
    }
    
    Behavior on opacity {
        NumberAnimation {
            duration: 800
        }
    }
    

    }
    @

    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