Results 1 to 3 of 3

Thread: dynamic object id

  1. #1
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default dynamic object id

    Hello,

    Qt Code:
    1. Repeater {
    2. model: 10
    3.  
    4. MyWindow {
    5. id: "mywindownumber" + index
    6. x: 20 + index * 30
    7. y: 200
    8. }
    9. }
    To copy to clipboard, switch view to plain text mode 

    It's obviously not working, but is there a way to achieve something similar?

  2. #2
    Join Date
    Apr 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Symbian S60

    Default Re: dynamic object id

    Maybe it's possible to use dynamically created components, which you can refer to by the Javascript variable but only within a function (http://qt-project.org/doc/qt-4.8/qde...icobjects.html). I use this method for creating and destroying dynamic components.

    You can also create a component from a QML file (http://doc.qt.nokia.com/4.7-snapshot...documents.html) but I don't know if you can assign the id after it's created.

  3. #3
    Join Date
    Nov 2010
    Posts
    82
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dynamic object id

    there s an itemAt(index) method

Similar Threads

  1. Replies: 0
    Last Post: 29th March 2012, 19:56
  2. Replies: 1
    Last Post: 8th November 2011, 22:27
  3. How to generate dynamic object
    By tuxit in forum Qt Quick
    Replies: 0
    Last Post: 17th August 2011, 13:49
  4. How to drag dynamic object in Qml?
    By Franziss in forum Newbie
    Replies: 0
    Last Post: 28th May 2011, 17:07
  5. Replies: 1
    Last Post: 20th January 2011, 17:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.