Search code examples
c++qtqcomboboxqlistview

C++, Qt - Hideable QListView


I would like to make a list of checkboxes for my programm, so that the users are be able to check/uncheck a number of different flags. However, I would like to make it behave like a QComboBox: to be folded most of the time, but to open itself when clicked.

What is the best way to add such functionality (e.g. derive a custom class from QComboBox, or do something with a QListView)? Thank you.


Solution

  • There is a solution for it on the Qt forum:

    http://qt-project.org/forums/viewthread/7740

    It recommends the usage of a custom model/view, based on the tutorial 2_formatting in the examples folder.