A Menu-View, tested with Qt4.4
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:
The parameter recursive tells the view, to use Sub-Menus, if the Model has the childs.