digiKam
|
Signals | |
void | activated (const QModelIndex &index) |
void | hovered (const QString &text) |
Public Member Functions | |
int | firstSeparator () const |
int | hoverRole () const |
QAction * | makeAction (const QIcon &icon, const QString &text, QObject *const parent) |
int | maxRows () const |
QAbstractItemModel * | model () const |
ModelMenu (QWidget *const parent=nullptr) | |
QModelIndex | rootIndex () const |
int | separatorRole () const |
void | setFirstSeparator (int offset) |
void | setHoverRole (int role) |
void | setMaxRows (int max) |
void | setModel (QAbstractItemModel *model) |
void | setRootIndex (const QModelIndex &index) |
void | setSeparatorRole (int role) |
~ModelMenu () override | |
Protected Member Functions | |
void | createMenu (const QModelIndex &parent, int max, QMenu *parentMenu=nullptr, QMenu *menu=nullptr) |
put all of the children of parent into menu up to max More... | |
virtual void | postPopulated () |
add any actions after the tree More... | |
virtual bool | prePopulated () |
add any actions before the tree, return true if any actions are added. More... | |
A QMenu that is dynamically populated from a QAbstractItemModel
|
explicit |
|
override |
|
signal |
Referenced by Digikam::BookmarksMenu::BookmarksMenu().
|
protected |
put all of the children of parent into menu up to max
References hovered(), and makeAction().
Referenced by Digikam::BookmarksMenu::prePopulated().
int Digikam::ModelMenu::firstSeparator | ( | ) | const |
|
signal |
Referenced by createMenu().
int Digikam::ModelMenu::hoverRole | ( | ) | const |
QAction * Digikam::ModelMenu::makeAction | ( | const QIcon & | icon, |
const QString & | text, | ||
QObject *const | parent | ||
) |
Referenced by createMenu().
int Digikam::ModelMenu::maxRows | ( | ) | const |
QAbstractItemModel * Digikam::ModelMenu::model | ( | ) | const |
Referenced by setModel().
|
protectedvirtual |
add any actions after the tree
|
protectedvirtual |
add any actions before the tree, return true if any actions are added.
Reimplemented in Digikam::BookmarksMenu.
QModelIndex Digikam::ModelMenu::rootIndex | ( | ) | const |
Referenced by Digikam::BookmarksMenu::prePopulated().
int Digikam::ModelMenu::separatorRole | ( | ) | const |
void Digikam::ModelMenu::setFirstSeparator | ( | int | offset | ) |
void Digikam::ModelMenu::setHoverRole | ( | int | role | ) |
Referenced by Digikam::BookmarksMenu::BookmarksMenu().
void Digikam::ModelMenu::setMaxRows | ( | int | max | ) |
Referenced by Digikam::BookmarksMenu::BookmarksMenu().
void Digikam::ModelMenu::setModel | ( | QAbstractItemModel * | model | ) |
References model().
Referenced by Digikam::BookmarksMenu::prePopulated().
void Digikam::ModelMenu::setRootIndex | ( | const QModelIndex & | index | ) |
Referenced by Digikam::BookmarksMenu::prePopulated().
void Digikam::ModelMenu::setSeparatorRole | ( | int | role | ) |
Referenced by Digikam::BookmarksMenu::BookmarksMenu().