Results 1 to 2 of 2

Thread: Is there a 'pureindex' for treeWidgetItems added to a simple treewidget ?

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Is there a 'pureindex' for treeWidgetItems added to a simple treewidget ?

    If I add items to a tree, no matter where parent I was using, I have 1,2,3, n items added.
    Can I have access to an item of a tree using simply this 'pure' index ?
    Thanks.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Is there a 'pureindex' for treeWidgetItems added to a simple treewidget ?

    No. Nothing stops you maintaining a parallel QList of QPersistentModelIndexes which might provide something like this for small numbers of items (maintaining persistent indexes has peformance impacts). You could also maintain your own list of pointers to the QTreeWidgetItems if using the tree widget. There is no obvious natural order for this list: insertion order, top-to-bottom depth first, top-to-bottom breadth first...

Similar Threads

  1. Replies: 1
    Last Post: 28th October 2010, 22:36
  2. Replies: 2
    Last Post: 18th May 2010, 22:44
  3. Monitor a new added File
    By designer.software in forum Qt Programming
    Replies: 1
    Last Post: 27th February 2010, 09:50
  4. Replies: 3
    Last Post: 21st August 2009, 11:39
  5. Data not being added to my QTableView?
    By steg90 in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2007, 14:20

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
  •  
Qt is a trademark of The Qt Company.