Results 1 to 2 of 2

Thread: Combobox with checkable items

  1. #1

    Default Combobox with checkable items


    i want to have a Combobox with checkable items just like Qt Designer has to set flags for some elements.

    What i have done so far: I created a model and connected it to my combobox, this model returns that the items are checkable as a flag. Everything works fine, except that the popup of the Combobox is closed when an item is clicked. How can i prevent that and set the item checked instead (I can let my model return that it is checked but i need to know which item was clicked, and the popup also needs to be redrawn after that) ?
    In this thread:

    someone mentioned to install an eventfilter, what exactly have i got to do?
    If you got other suggestions how to make this work (without external libs) i would also be glad to hear.


  2. #2
    Join Date
    Feb 2006
    Oslo, Norway
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Combobox with checkable items

    You can simply override QComboBox::hidePopup() with an empty implementation.
    J-P Nurmi

Similar Threads

  1. Making QTreeView Items Checkable
    By JimDaniel in forum Qt Programming
    Replies: 4
    Last Post: 30th January 2020, 17:43
  2. Sorting Combobox Items
    By raphaelf in forum Newbie
    Replies: 5
    Last Post: 23rd June 2008, 09:00
  3. checkable items in QTableView
    By cgorac in forum Qt Programming
    Replies: 6
    Last Post: 11th March 2008, 23:45
  4. QDirModel+QTreeView and checkable items
    By L.Marvell in forum Qt Programming
    Replies: 7
    Last Post: 11th May 2007, 19:54
  5. Creating events for combobox items
    By confused in forum Newbie
    Replies: 4
    Last Post: 26th March 2006, 17:40


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.