QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
This class is a menu that is populated automatically with the actions defined for a given layer. More...
#include <qgsactionmenu.h>
Classes | |
struct | ActionData |
Signals | |
void | reinit () |
Emitted after actions have been reloaded. | |
Public Member Functions | |
QgsActionMenu (QgsVectorLayer *layer, const QgsFeature &feature, const QString &actionScope, QWidget *parent=nullptr) | |
Constructs a new QgsActionMenu. | |
QgsActionMenu (QgsVectorLayer *layer, QgsFeatureId fid, const QString &actionScope, QWidget *parent=nullptr) | |
Constructs a new QgsActionMenu. | |
QgsExpressionContextScope | expressionContextScope () const |
Returns an expression context scope used to resolve underlying actions. | |
bool | isEmpty () const |
Returns true if the menu has no valid actions. | |
QList< QgsAction > | menuActions () |
Returns menu actions. | |
void | setActionContextGenerator (QgsMapLayerActionContextGenerator *generator) |
Sets a QgsMapLayerActionContextGenerator to create action contexts for the menu. | |
void | setExpressionContextScope (const QgsExpressionContextScope &scope) |
Sets an expression context scope used to resolve underlying actions. | |
void | setFeature (const QgsFeature &feature) |
Change the feature on which actions are performed. | |
void | setMode (QgsAttributeEditorContext::Mode mode) |
Change the mode of the actions. | |
This class is a menu that is populated automatically with the actions defined for a given layer.
Definition at line 38 of file qgsactionmenu.h.
|
explicit |
Constructs a new QgsActionMenu.
layer | The layer that this action will be run upon. |
feature | The feature that this action will be run upon. Make sure that this feature is available for the lifetime of this object. |
parent | The usual QWidget parent. |
actionScope | The action scope this menu will run in |
Definition at line 26 of file qgsactionmenu.cpp.
|
explicit |
Constructs a new QgsActionMenu.
layer | The layer that this action will be run upon. |
fid | The feature id of the feature for which this action will be run. |
parent | The usual QWidget parent. |
actionScope | The action scope this menu will run in |
Definition at line 36 of file qgsactionmenu.cpp.
QgsExpressionContextScope QgsActionMenu::expressionContextScope | ( | ) | const |
Returns an expression context scope used to resolve underlying actions.
Definition at line 228 of file qgsactionmenu.cpp.
bool QgsActionMenu::isEmpty | ( | ) | const |
Returns true
if the menu has no valid actions.
Definition at line 238 of file qgsactionmenu.cpp.
QList< QgsAction > QgsActionMenu::menuActions | ( | ) |
|
signal |
Emitted after actions have been reloaded.
void QgsActionMenu::setActionContextGenerator | ( | QgsMapLayerActionContextGenerator * | generator | ) |
Sets a QgsMapLayerActionContextGenerator to create action contexts for the menu.
The generator object must exist for the lifetime of the menu.
Definition at line 45 of file qgsactionmenu.cpp.
void QgsActionMenu::setExpressionContextScope | ( | const QgsExpressionContextScope & | scope | ) |
Sets an expression context scope used to resolve underlying actions.
Definition at line 222 of file qgsactionmenu.cpp.
void QgsActionMenu::setFeature | ( | const QgsFeature & | feature | ) |
Change the feature on which actions are performed.
feature | A feature. Will not take ownership. It's the callers responsibility to keep the feature as long as the menu is displayed and the action is running. |
Definition at line 74 of file qgsactionmenu.cpp.
void QgsActionMenu::setMode | ( | QgsAttributeEditorContext::Mode | mode | ) |
Change the mode of the actions.
mode | The mode of the attribute form |
Definition at line 79 of file qgsactionmenu.cpp.