Qt ComboBox in Menu View Question
-
wrote on 9 May 2012, 14:46 last edited by
Hi,
I was wondering if it is possible to create a qcombobox with a menu view?
Please see image of what I mean:
!http://doc.qt.nokia.com/4.7-snapshot/images/menus-example.png(menu)!
I want a combobox with sublevels like the Edit menu.
Please let me know if this is unclear. Thanks in advanced!!
-
wrote on 9 May 2012, 14:48 last edited by
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 -
wrote on 9 May 2012, 14:53 last edited by
I wanted to have a hierarchical QComboBox with sub levels
ex:
combobox has items:
test1
test1.1
test1.2
test1.3
test2
test3I tried to setView to a tree view, but it wasn't exactly what I wanted...I want more of a menu style.
-
wrote on 9 May 2012, 15:12 last edited by
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.
-
wrote on 9 May 2012, 15:28 last edited by
By popup menu,
do you mean something like this:
-
wrote on 9 May 2012, 15:37 last edited by
yes, exactly.
-
wrote on 9 May 2012, 15:39 last edited by
That sounds good if there are no other solutions.
Thanks for your help, DerManu!
-
wrote on 19 Apr 2014, 12:11 last edited by
Does any one implemented this feature for the QComboBox... Currently i am looking for the same solution.
"My Post":http://qt-project.org/forums/viewthread/41627/#172610