With MenuView it is possible to display a Model like QDirModel as a QMenu.
The MenuView has 2 signals: void triggered(const QModelIndex &); void hovered(const QModelIndex &); which works like the same signals of QAction, but here are the QModelIndex of the triggered/hovered items are transfered.
The constructor of the view: MenuView(const QString &title, QWidget *parent=0);
The model ist set with: model->setModel(yourModel, recursive)
The parameter recursive tells the view, to use Sub-Menus, if the Model has the childs.
Ratings & Comments
0 Comments