Results 1 to 7 of 7

Thread: ListModel with CheckStateRole but don't show checkboxes in QComboBox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2010
    Posts
    99
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default ListModel with CheckStateRole but don't show checkboxes in QComboBox

    I have a subclass of QAbstractListModel containing items consisting of a name (QString) and a boolean. The model returns the name as Qt::DisplayRole, and the boolean as Qt::CheckStateRole. I then use this model in a list view.

    But i would also like to use the same model for combo boxes. This is in the same UI, using the same data but in two different views.

    The problem is that although the list view displays the check boxes for each item, the combo box does as well. Is there any way i can set it to not show these? Or will i have to use a separate model for the combo boxes?
    Last edited by xtal256; 9th March 2012 at 11:03.
    [Window Detective] - Windows UI spy utility
    [War Thunder]

Similar Threads

  1. ListModel.remove() crashes program
    By truefusion in forum Qt Quick
    Replies: 5
    Last Post: 5th February 2012, 15:27
  2. Show QComboBox list while editing
    By radix07 in forum Qt Programming
    Replies: 0
    Last Post: 14th October 2011, 16:52
  3. to show Checkboxes in listview
    By Ketan Shah in forum Newbie
    Replies: 3
    Last Post: 23rd May 2011, 09:01
  4. checkboxes
    By abrou in forum Newbie
    Replies: 2
    Last Post: 1st February 2008, 18:52
  5. A simplest ListModel... no example :(
    By tomek in forum Newbie
    Replies: 5
    Last Post: 7th January 2006, 00:32

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.