QML Camera initialisation in background ?



  • Hi,

    in my application I have a QML Camera element on one page. The problem I have is, that it takes some time till the camera is initialised. Since the app is running on an embedded target (iMX6) this takes 1-2 seconds. During that time, the UI is just blocking. Once the camera has been initialised, everything seems to work pretty smooth. But I need to avoid the blocking of the UI during camera initialisation.

    Since there are a few more pages that will be presented to the user after the app has started, it would be great to present those pages to the user while having the camera initialisation running in the background (separate thread ?) so that the camera is ready by the time it is needed.
    So, I wonder if somebody could give me some hint how this might be possible. I guess, I will have to start an initialisation thread from C++ already or something like that ? As QML itself doesn't really offer threading

    Any hints welcome.



  • Hi @YenZi
    A little bit late, but could using a Loader and settings its asynchronous property to true work?
    http://doc.qt.io/qt-5/qml-qtquick-loader.html#asynchronous-prop