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. Ad Hoc Charting Help
Forum Update on Tuesday, May 27th 2025

Ad Hoc Charting Help

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 4.0k 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
    kyleplattner
    wrote on 29 Oct 2010, 14:59 last edited by
    #1

    I am trying to chart out some numbers on the fly by creating little rectangles in locations that correspond with a number over a period of time. I am using the Qt.createQMLObject command and it works great except for it kills the object every time it creates a new one. How can I get it to keep making new rectangles without trashing the one before it?

    @property int moveOver: 0
    function chartYield(){

        moveOver = moveOver + 5
    
        Qt.createQmlObject('import Qt 4.7; Rectangle {color: "white"; width: 3; height: 3; x: moveOver; y: yieldIndicator - 50 }',
             dash, "dynamicSnippet1");
    
    }@
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on 1 Nov 2010, 05:54 last edited by
      #2

      Hi,

      In the above code, it looks like each of the newly created objects might have its x-position bound to the same "global" variable, moveOver. If that is the case, when you increment moveOver all of the items would move to the new position (which might look like the previous items were being deleted). If that is the problem, "assigning the x in Component.onCompleted":http://doc.qt.nokia.com/4.7/qdeclarativejavascript.html#property-assignment-vs-property-binding should fix it.

      Regards,
      Michael

      1 Reply Last reply
      0

      1/2

      29 Oct 2010, 14:59

      • Login

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