Results 1 to 2 of 2

Thread: [QT4.1.1 XP] multi-columns list model/view

  1. #1
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default [QT4.1.1 XP] multi-columns list model/view

    I want to create a model/view based form to show a multi-columns list.
    In QT3 I used QListView with addColumn().

    In QT4 I understand from Assistant that :
    - for one column list, use QListView or QListWidget
    - for more columns, use QTreeView, or QTreeWidget


    Are both assumptions correct ?
    ie QListView is designed for one column, but I wonder about QListWidget

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: [QT4.1.1 XP] multi-columns list model/view

    Quote Originally Posted by incapacitant
    Are both assumptions correct ?
    Yes.
    ie QListView is designed for one column, but I wonder about QListWidget
    QListWidget is a QListView with internal model so that a user can operate on QListWiegetItem objects instead of indexes of the model.

    In your case you should use QTreeView or QTreeWidget.

  3. The following 2 users say thank you to wysota for this useful post:

    incapacitant (26th February 2006), Oleg (27th October 2007)

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.