I created a model which list the existing configurations (let's say it lists "files", as this doesn't really matter here). So far, it works well when attached to a QListView
.
Example:
--- ListView ---
- file #1 -
- file #2 -
- file #3 -
- file #4 -
----------------
Is it possible to use the same model for a dynamically updated QMenu
?
Something like:
Menu
-> Submenu #1
-> Submenu #2
-> File-submenu
-> file #1
-> file #2
-> file #3
-> file #4
-> Submenu #3
In short: is there any way to create a list of dynamicaly updated QAction
s (grouped into the same QMenu
) depending on a model (derived from QAbstractListModel
) ?
Unfortunately there is no QMenuView
class but I found this promising implementation on the net: QMenuView
(qmenuview.h, qmenuview.cpp).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With