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

Dynamically create qml objects

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.5k 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.
  • U Offline
    U Offline
    ucomesdag
    wrote on 19 Jul 2011, 11:41 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 19 Jul 2011, 11:49 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 19 Jul 2011, 11:52 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

        1/3

        19 Jul 2011, 11:41

        • Login

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