Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Can Anyone pls explain me the control flow in QT quick controls application.

    QML and Qt Quick
    2
    3
    618
    Loading More Posts
    • 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.
    • Akshay Singh
      Akshay Singh last edited by Akshay Singh

      Just Started learning this topic.
      Wants to get a clear view on what loads first??
      Qml page or main() function of c++ file.

      If c++ load first with control to main() function then, which class and function is used to tell the compiler or application to load qml pages?

      (As in QWidget application.for example-> window.show() is used to start the Widget procedure.)

      1 Reply Last reply Reply Quote 0
      • E
        Eeli K last edited by

        Qt program is always a C++ program and always starts with main(). QML works in a runtime engine written in C++. See a main() function of some example project:

        QQmlApplicationEngine engine;
        engine.load(QUrl("qrc:/main.qml"));
        return app.exec();
        

        The UI (the object structrure declared in main.qml etc.) is built in the loading phase and each component's Component.onCompleted is run. But not before app.exec() is called the signals/slot connections, state machines etc. start actually working and the user can interact with the QML Quick interface. I don't know when the UI painted.

        1 Reply Last reply Reply Quote 0
        • Akshay Singh
          Akshay Singh last edited by

          Okay,,,,thanks ,that helped me a lot for learning the start.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post