Results 1 to 2 of 2

Thread: Combobox with checkable items

  1. #1

    Default Combobox with checkable items

    Hi,

    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:
    http://www.qtcentre.org/forum/f-qt-p...box-10015.html

    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.

    thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    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

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.