Results 1 to 2 of 2

Thread: QDeclarativeListProperty add item from qml application

  1. #1
    Join Date
    Apr 2011
    Posts
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question QDeclarativeListProperty add item from qml application

    is there any why to add item to QDeclarativeListProperty from qml file at run time?
    in a loop, for example.
    Qt Code:
    1. var i;
    2. for(i = 0 ; i < listOfItems.length ; ++i)
    3. {
    4. listOfItems.append(MyItem {
    5. text:"list"+i
    6. })
    7. }
    To copy to clipboard, switch view to plain text mode 

    and listOfItems is the QDeclarativeListProperty list...
    i dont want to do it like this:
    Qt Code:
    1. listOfItems:
    2. [
    3. MyItem
    4. {
    5. text:"list val1"
    6. },
    7. MyItem
    8. {
    9. text:"list val2"
    10. }
    11. ......
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QDeclarativeListProperty add item from qml application

    Have you by chance found an answer to this? I'm having the same problem and I couldn't find an answer anywhere.
    Thanks.

Similar Threads

  1. Replies: 0
    Last Post: 18th February 2011, 08:24
  2. QGraphicsScene with scaled item freezes application on click
    By FlashMuller in forum Qt Programming
    Replies: 2
    Last Post: 31st January 2011, 13:51
  3. Replies: 3
    Last Post: 21st July 2010, 07:40
  4. Replies: 4
    Last Post: 17th June 2007, 10:30
  5. Replies: 14
    Last Post: 9th November 2006, 08:35

Tags for this Thread

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.