QML Timer and Loader
Unsolved
QML and Qt Quick
-
wrote on 5 Oct 2016, 14:19 last edited by
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? -
wrote on 5 Oct 2016, 16:30 last edited by
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.
-
@Mark81 The example works. Is there anything else that is missing ?
1/3