Results 1 to 2 of 2

Thread: difference between TreeWidget and TreeView

  1. #1
    Join Date
    Mar 2011
    Location
    delhi
    Posts
    45
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation difference between TreeWidget and TreeView

    please explain what is the difference between TreeWidget and TreeView


    thanks with regards;
    gauravg

  2. #2
    Join Date
    Nov 2011
    Posts
    11
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: difference between TreeWidget and TreeView

    "Widget" classes are convinience classes with fixed models good only for something very common and easy (text tables and such). If you want to subclass and have a flexible model, go for the "View" classes.

    From http://qt-project.org/doc/qt-4.8/mod...ogramming.html :

    Convenience classes
    A number of convenience classes are derived from the standard view classes for the benefit of applications that rely on Qt's item-based item view and table classes. They are not intended to be subclassed, but simply exist to provide a familiar interface to the equivalent classes in Qt 3. Examples of such classes include QListWidget, QTreeWidget, and QTableWidget; these provide similar behavior to the QListBox, QListView, and QTable classes in Qt 3.
    These classes are less flexible than the view classes, and cannot be used with arbitrary models. We recommend that you use a model/view approach to handling data in item views unless you strongly need an item-based set of classes.
    If you wish to take advantage of the features provided by the model/view approach while still using an item-based interface, consider using view classes, such as QListView, QTableView, and QTreeView with QStandardItemModel.

Similar Threads

  1. add items to treewidget
    By Shien in forum Qt Programming
    Replies: 15
    Last Post: 1st January 2011, 19:40
  2. Replies: 2
    Last Post: 18th May 2010, 22:44
  3. How to add subitem in treewidget
    By phillip_Qt in forum Qt Programming
    Replies: 11
    Last Post: 16th November 2009, 11:22
  4. Problem with Treewidget
    By addu in forum Qt Programming
    Replies: 1
    Last Post: 30th June 2009, 09:24
  5. Painting TreeWidget
    By VireX in forum Qt Programming
    Replies: 9
    Last Post: 9th May 2007, 08:36

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.