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. How do I create multiple Dynamic Objects that have some kind of indexed id?
Forum Updated to NodeBB v4.3 + New Features

How do I create multiple Dynamic Objects that have some kind of indexed id?

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

    So what I want to do is create enemy space ships in an index based way so that I can destroy one of them and when I try to access properties I am not dealing with things that no longer exist.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Simply use a QList<QObject*> or QVariantList, depending on your space ship backend implementation.

      If you want a QML-only solution, for some reason - you can parent all your space ships under a single Item and then access them using item.children.

      (Z(:^

      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