Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Dynamically create qml objects

    QML and Qt Quick
    2
    3
    1330
    Loading More Posts
    • 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
      ucomesdag last edited by

      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 Reply Quote 0
      • L
        lgeyer last edited by

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

        1 Reply Last reply Reply Quote 0
        • U
          ucomesdag last edited by

          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 Reply Quote 0
          • First post
            Last post