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. Dynamically create qml objects
Forum Updated to NodeBB v4.3 + New Features

Dynamically create qml objects

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

    Hi, is it possible, for example, to create dynamically some rectangles?

    Something like this:
    @function drawButtons (buttons) {
    for(var i=0; i<buttons; i++){
    //=====================
    Rectangle{
    id: eval('item' + i)
    y: y_pos * i
    width: width
    height: height
    color: "red"
    }
    //=====================
    }
    }@

    Write “Qt”, not “QT” (QuickTime).

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      "Dynamic Object Management in QML":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedynamicobjects.html.

      1 Reply Last reply
      0
      • U Offline
        U Offline
        ucomesdag
        wrote on last edited by
        #3

        Exactly what I was looking for. Missed while searching.
        [quote author="Lukas Geyer" date="1311076161"]"Dynamic Object Management in QML":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedynamicobjects.html.[/quote]

        Write “Qt”, not “QT” (QuickTime).

        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