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. Displaying the same QML Item multiple times
Forum Updated to NodeBB v4.3 + New Features

Displaying the same QML Item multiple times

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 3 Posters 2.6k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    Korchkidu
    wrote on last edited by
    #1

    Hi,

    is it possible to multiple instances of the same object in QML? I would like to display it multiple times and when I interact with one instance, it updates all the other instances.

    Thanks for any help.
    Best regards.

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Have a look at Repeater

      Can you elaborate on what you want to achieve?

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Korchkidu
        wrote on last edited by
        #3

        The idea is to have small unique "process blocks" available to the user. Then, he can arrange instances of them as he wants in several graphs. When he launched one processing block instance, it should visually update all instances of the same processing block.

        Best regards.

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          What do you have already?

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          0
          • X Offline
            X Offline
            Xander84
            wrote on last edited by
            #5

            Hi, I don't think you can display the "same" item multiple times, that doesn't work in any GUI app as far as I know (i mean really the same item not a copy or identical looking).
            You can of course display multiply objects of the same type and either save a list of the ID's or if you need to change all items of the same type iterate through your item list or tree and find the same items dynamically.
            In your case you should have a list of your "process blocks" somewhere and have access to the type?

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Korchkidu
              wrote on last edited by
              #6

              Hi,

              thanks all for your answers.

              @eddy: I have the C++ objects made available to QML + my QML file with multiple "independent" objects (those I would be the same instance).

              @Xander84: I see. So I would need somehow to ensure that when I modify one of them, they are all resynchronized together?

              1 Reply Last reply
              0
              • X Offline
                X Offline
                Xander84
                wrote on last edited by
                #7

                yeah I think you have to "sync them together", but that should be fairly easy with QML I think? You could use property bindings but without any specifics how your app works it's hard to say.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Korchkidu
                  wrote on last edited by
                  #8

                  Yes, indeed. With property binding it should quite straightforward I believe. I will try this and see how it works. Thanks a lot!

                  Best regards.

                  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