Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

QML Timer and Loader



  • Qt5.7.0, QtQuick2.0, simple QML page with a Loader:

    Item {
    
        Loader { 
            id: pageLoader 
            asynchronous: true
        }
    
        Component.onCompleted {
            pageLoader.source = "Page1.qml"
        }
    }
    

    Page1.qml contains a Timer:

    Timer {
            interval: 1000
            repeat: true
            running: true
            triggeredOnStart: true
            onTriggered: console.debug(".")
        }
    

    But when I load the page inside the Loader the Timer won't fire.
    What am I missing here?



  • Hi! I'm not 100% sure but I think the problem is that, using an asynchronous Loader, the Timer is created and started on a different thread but this thread has no event loop.


  • Moderators

    @Mark81 The example works. Is there anything else that is missing ?