Results 1 to 2 of 2

Thread: Checkable item in tree model

  1. #1
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Checkable item in tree model

    Hi all !
    I need to build treview with checkable items. I try use model/view approach to this. As template i use some class TreeModel(actually don't remember really caption ) from qt samples that derived from QAbstractItemModel. In virtual method Qt::ItemFlags flags(const QModelIndex &index) const i try returnt combination of needed item falgs, alike Qt::ItemIsEnabled | Qt::ItemIsUserCheckable but my item in tree still not checkable...
    Have i ask exhaustive question ?
    Pls help...

    [EDITED]
    Play with role Qt::CheckStateRole in data() ?
    Last edited by zlatko; 11th May 2007 at 11:23. Reason: extended searching :)
    a life without programming is like an empty bottle

  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: Checkable item in tree model

    Yes, you have to make sure data() returns an appropriate value of the check state role for the index.

Similar Threads

  1. using the example of simple tree model
    By krishna.bv in forum Qt Programming
    Replies: 1
    Last Post: 22nd December 2006, 12:28
  2. how to display full tree item name on mouse move ?
    By rajesh in forum Qt Programming
    Replies: 5
    Last Post: 15th November 2006, 08:41
  3. QTableWidget item checkable and combo?
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2006, 07:12
  4. Replies: 3
    Last Post: 7th May 2006, 17:07
  5. drag and drop with item views
    By castorvert in forum Qt Programming
    Replies: 14
    Last Post: 27th March 2006, 10:12

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.