Results 1 to 3 of 3

Thread: How to use "Simple Tree Model" Example?

  1. #1
    Join Date
    Feb 2010
    Location
    Los Angeles
    Posts
    61
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question How to use "Simple Tree Model" Example?

    Hello All,

    I have not worked with an QAbstractItemModel before and I am using the Simple Tree Model http://qt-project.org/doc/qt-4.8/ite...treemodel.html.
    It runs fine but I am not sure how to make that TreeView show any changes I apply to the data of the tree.
    The example creates all tree items in the constructor of the model but when I add them outside the constructor the view does not get updated.
    Can someone fill in the gaps?

    Thanks
    Markus

  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: How to use "Simple Tree Model" Example?

    "The Simple Tree Model example shows how to create a basic, read-only hierarchical model to use with Qt's standard view classes."

    The example does not provide the necessary mechanisms to modify data in the tree (setData(), insertRows(), insertColumns(), flags()) or advise views of changes/insertions/deletions (numerous signals).

  3. #3
    Join Date
    Feb 2010
    Location
    Los Angeles
    Posts
    61
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to use "Simple Tree Model" Example?

    Ahh, makes sense. So the "Editable Tree Model Example" would be of more help then?

Similar Threads

  1. Replies: 3
    Last Post: 26th September 2012, 21:21
  2. Replies: 0
    Last Post: 15th April 2011, 20:04
  3. "Simple DOM Model Example"
    By rmagro in forum Qt Programming
    Replies: 3
    Last Post: 1st July 2009, 12:35
  4. Adapting the "Simple DOM Model Example" to be read/write
    By joshuajcarson in forum Qt Programming
    Replies: 7
    Last Post: 8th September 2008, 21:19
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

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.