Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt ComboBox in Menu View Question
I was wondering if it is possible to create a qcombobox with a menu view?
Please see image of what I mean:
I want a combobox with sublevels like the Edit menu.
Please let me know if this is unclear. Thanks in advanced!!
Do you mean a real QComboBox as widget inside a QAction or just a submenu?
The submenu can be created easily with QMenu::addMenu(), see docs
I wanted to have a hierarchical QComboBox with sub levels
combobox has items:
I tried to setView to a tree view, but it wasn't exactly what I wanted...I want more of a menu style.
Ahh okay, now I understand... But I'm afraid I can't help much. Of course there's always the possibility to just hack (subclass) QComboBox (or a QLineEdit) to just show a popup menu aligned with the widget so the impression to a regular combobox is similar.
By popup menu,
do you mean something like this:
That sounds good if there are no other solutions.
Thanks for your help, DerManu!
Mammamia last edited by
Does any one implemented this feature for the QComboBox... Currently i am looking for the same solution.