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. onReady or onDisplayed?
Qt 6.11 is out! See what's new in the release blog

onReady or onDisplayed?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 827 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.
  • A Offline
    A Offline
    ABponant
    wrote on last edited by
    #1

    Hello,

    I have to populate a Scrollview programmatically by reading a file and dinamically create objects, something which is certainly really common.
    I've created the Scrollview in QML, but I'm wondering how to know when I can populate it from C++ side.

    I was looking for something like onReady or onDisplayed on QML side to be able to call a C++ slot to ask C++ side to do the job but I didn't find it.

    How such thing is commonly done?

    Regards,
    Alain

    J.HilkJ 1 Reply Last reply
    0
    • A Offline
      A Offline
      ABponant
      wrote on last edited by
      #3

      Thanks a lot @J-Hilk .
      I look at it.

      Alain

      1 Reply Last reply
      0
      • A ABponant

        Hello,

        I have to populate a Scrollview programmatically by reading a file and dinamically create objects, something which is certainly really common.
        I've created the Scrollview in QML, but I'm wondering how to know when I can populate it from C++ side.

        I was looking for something like onReady or onDisplayed on QML side to be able to call a C++ slot to ask C++ side to do the job but I didn't find it.

        How such thing is commonly done?

        Regards,
        Alain

        J.HilkJ Online
        J.HilkJ Online
        J.Hilk
        Moderators
        wrote on last edited by
        #2

        Hi @ABponant

        You can listen to the following:

        Component.onCompleted: console.log("component ready")
        

        instead of the console log, you invoke a function/signal in your c++ backend


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ABponant
          wrote on last edited by
          #3

          Thanks a lot @J-Hilk .
          I look at it.

          Alain

          1 Reply Last reply
          0

          • Login

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