Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Load QML window asynchronous
Forum Update on Monday, May 27th 2025

Load QML window asynchronous

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 2.9k Views
  • 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.
  • D Offline
    D Offline
    deleted57
    wrote on 20 Jan 2017, 13:26 last edited by
    #1

    Hi all

    Since loading of my QML app take some time I would to show a splashscreen with an animation just for show the app is alive. The problem is loading of QML from C++ side lock the main message cycle and doesn't allow to update the animation into splashscreen. I tried to set QML object loading using QQmlComponent::Asynchronous param but the next call to create object is still blocking:

    QQmlEngine QmlEngine;
    QQmlComponent MainComponent(&QmlEngine);
    MainComponent.loadUrl(QUrl("qrc:/Main.qml"), QQmlComponent::Asynchronous);
    MainComponent.create(); // <-- this call doesn't return until QML window created
    

    Using QQmlIncubator and QQmlIncubationController doesn't help and the QML loading return errors (I suspect the problem came from the large quantity of QML compinent and resource to load).

    I still didn't find a way to make asynchronous all the steps of QML loading and creation. Also making the splahscreen using QML and loading the main app window using Loader with asynchronous flag set to true show the same problem, all locks for some seconds before show the main app window (animation too).

    Someone can suggest an alterative way for this issue?
    Thank you

    1 Reply Last reply
    1
    • D Offline
      D Offline
      deleted57
      wrote on 22 Jan 2017, 09:30 last edited by
      #2

      Nobody have suggestion? I have to suppose is currently impossible with current implementation of QML to get such result...

      1 Reply Last reply
      0
      • P Offline
        P Offline
        p3c0
        Moderators
        wrote on 22 Jan 2017, 12:08 last edited by
        #3

        @Suppaman First why does QML takes so much time to load ?
        Can you lazy load some of the non essential items ?

        157

        1 Reply Last reply
        0
        • D Offline
          D Offline
          deleted57
          wrote on 22 Jan 2017, 22:20 last edited by
          #4

          Yes, I could but this is not what I asked for. I'm looking for a way to make anitmated splahscreen since it would be an useful feature for my app. I'm very close to the solution, QML code optimization will come later. My app load a lot of svg images and this take time, all the images have to be ready to show when user start to use the app.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            deleted57
            wrote on 23 Jan 2017, 12:47 last edited by
            #5

            If someother is interested in same topic here there is a working solution:

            http://falsinsoft.blogspot.com/2017/01/qml-show-animated-splash-screen-at.html

            1 Reply Last reply
            1

            1/5

            20 Jan 2017, 13:26

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved