How create a double-layer qcombobox for qtableview cell
-

one of the way is to set a qmenu delegate for the tableview column but it seems that menu do not show in the right position
Anyone has any suggestion?
@konata '
Create your own
QItemDelegatesubclass and implement your comboBox there. I guess you have to specify the behavior, where and how the 2nd dropdown appears, on your own since there is no such standard widget in Qt.https://stackoverflow.com/questions/16660292/qt-using-custom-qitemdelegate-for-qtableview
Is that screenshot shwoing how it looks like at the moment or how you want it to look like?
-
@konata '
Create your own
QItemDelegatesubclass and implement your comboBox there. I guess you have to specify the behavior, where and how the 2nd dropdown appears, on your own since there is no such standard widget in Qt.https://stackoverflow.com/questions/16660292/qt-using-custom-qitemdelegate-for-qtableview
Is that screenshot shwoing how it looks like at the moment or how you want it to look like?
@Pl45m4 thanks for reply
Yes I found it a bit hard for me to draw a second combobox by QItemDelegate
The screen shot is how it should look like.
This is more like a menu with submenu and when I choose the submenu item or action it will return its text to the editor -
@Pl45m4 thanks for reply
Yes I found it a bit hard for me to draw a second combobox by QItemDelegate
The screen shot is how it should look like.
This is more like a menu with submenu and when I choose the submenu item or action it will return its text to the editorWhere does the 2nd window appear? Are you using cascading
QMenus? Is everything else fine except the position?
https://doc.qt.io/qt-5/qmenu.html#addMenu
https://stackoverflow.com/questions/13799033/how-to-add-submenu-in-qt -
Where does the 2nd window appear? Are you using cascading
QMenus? Is everything else fine except the position?
https://doc.qt.io/qt-5/qmenu.html#addMenu
https://stackoverflow.com/questions/13799033/how-to-add-submenu-in-qt@Pl45m4
I guess the 2nd window(combobox)should be just close to the first one
I have tried using Qmenus in delegate but the menu appeared in position (0,0) and it only show first row and cannot choose or select
I searched the forum and it seems that no one used qmenus in delegates before