![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Libs/Widgets/ctkActionsWidget.h>
Public Member Functions | |
void | addAction (QAction *action, const QString &group=QString()) |
void | addActions (QList< QAction * > actions, const QString &group=QString()) |
Convenient function to add a list of action at once. More... | |
bool | areActionsWithNoShortcutVisible () const |
bool | areMenuActionsVisible () const |
void | clear () |
Remove all the actions and groups. More... | |
ctkActionsWidget (QWidget *parent=0) | |
QStandardItem * | groupItem (const QString &category) |
Return a pointer on a group item (you probably have no use for it) More... | |
QStandardItemModel * | model () const |
Return the unsorted/unfiltered model of all the actions. More... | |
void | setActionsWithNoShortcutVisible (bool show) |
void | setMenuActionsVisible (bool show) |
void | setSortColumn (int column) |
int | sortColumn () const |
QTreeView * | view () const |
return the view used to display the action model More... | |
virtual | ~ctkActionsWidget () |
Protected Types | |
enum | ActionColumn { NameColumn = 0 , ShortcutColumn , ContextColumn , DetailsColumn } |
Protected Slots | |
void | updateAction () |
Protected Attributes | |
QScopedPointer< ctkActionsWidgetPrivate > | d_ptr |
Properties | |
bool | actionsWithNoShortcutVisible |
bool | menuActionsVisible |
int | sortColumn |
Friends | |
class | ctkSortFilterActionsProxyModel |
ctkActionsWidget presents a list of QAction to the user. The QAction's are displayed in a multi column tree view. The columns contain the QAction's text, shortcut, context and tooltip in that order. The typical use is to show what shortcuts are associated to what commands in an application. ctkActionsWidget internally uses a QStandardItemModel where each item data (QStandardItem::data) contain a pointer to the QAction. QActions can optionally be ordered by group TODO: Add "hide empty group" property to hide empty groups
Definition at line 50 of file ctkActionsWidget.h.
|
protected |
Enumerator | |
---|---|
NameColumn | |
ShortcutColumn | |
ContextColumn | |
DetailsColumn |
Definition at line 105 of file ctkActionsWidget.h.
|
explicit |
|
virtual |
void ctkActionsWidget::addAction | ( | QAction * | action, |
const QString & | group = QString() |
||
) |
Add an action into a specified group (or at top level if group is empty) An action can be added multiple times (in a different group). Once added, ctkActionsWidget listens to the QAction and updates the action properties TODO: check that the action hasn't been already added into a group
void ctkActionsWidget::addActions | ( | QList< QAction * > | actions, |
const QString & | group = QString() |
||
) |
Convenient function to add a list of action at once.
bool ctkActionsWidget::areActionsWithNoShortcutVisible | ( | ) | const |
bool ctkActionsWidget::areMenuActionsVisible | ( | ) | const |
void ctkActionsWidget::clear | ( | ) |
Remove all the actions and groups.
QStandardItem* ctkActionsWidget::groupItem | ( | const QString & | category | ) |
Return a pointer on a group item (you probably have no use for it)
QStandardItemModel* ctkActionsWidget::model | ( | ) | const |
Return the unsorted/unfiltered model of all the actions.
void ctkActionsWidget::setActionsWithNoShortcutVisible | ( | bool | show | ) |
If true, shows QActions that have an empty shortcut, otherwise hide them. True by default
void ctkActionsWidget::setMenuActionsVisible | ( | bool | show | ) |
If true, shows QMenus, otherwise hide them. True by default
void ctkActionsWidget::setSortColumn | ( | int | column | ) |
Set the sortColumn property value.
int ctkActionsWidget::sortColumn | ( | ) | const |
Return the sortColumn property value.
|
protectedslot |
QTreeView* ctkActionsWidget::view | ( | ) | const |
return the view used to display the action model
|
friend |
Definition at line 117 of file ctkActionsWidget.h.
|
protected |
Definition at line 112 of file ctkActionsWidget.h.
|
readwrite |
Definition at line 1 of file ctkActionsWidget.h.
|
readwrite |
Definition at line 1 of file ctkActionsWidget.h.
|
readwrite |
This property controls whether the actions are sorted by column (>=0) or not (-1). Not sorted by default.
Definition at line 1 of file ctkActionsWidget.h.