PixelSelectionAction
Qualified name: mv::gui::PixelSelectionAction
-
class PixelSelectionAction : public mv::gui::GroupAction
Pixel selection action class.
Action class for pixel selection
- Author
Thomas Kroes
Public Functions
-
Q_INVOKABLE PixelSelectionAction(QObject *parent, const QString &title)
Construct with
parentobject andtitle.- Parameters:
parent – Pointer to parent object
title – Title
-
void initialize(QWidget *targetWidget, util::PixelSelectionTool *pixelSelectionTool, const util::PixelSelectionTypes &pixelSelectionTypes = util::defaultPixelSelectionTypes)
Initialize the pixel selection action.
- Parameters:
targetWidget – Pointer to target widget (pixel selection tool will be drawn on top of it)
pixelSelectionTool – Pointer to pixel selection tool
pixelSelectionTypes – Allowed pixel selection types
-
QMenu *getContextMenu()
Get the context menu for the action.
- Parameters:
parent – Parent widget
- Returns:
Context menu
-
QWidget *getTargetWidget()
Get pointer to the target on which the pixel selection tool operates.
-
util::PixelSelectionTool *getPixelSelectionTool()
Get pointer to pixel selection tool.
-
void setShortcutsEnabled(const bool &shortcutsEnabled)
Enables/disables shortcuts.
- Parameters:
shortcutsEnabled – Whether shortcuts are enabled or not
-
bool eventFilter(QObject *object, QEvent *event) override
Listens to the events of target
object.- Parameters:
object – Target object to watch for events
event – Event that occurred
-
virtual void fromVariantMap(const QVariantMap &variantMap) override
Load selection action from variant.
- Parameters:
Variant – representation of the selection action
-
virtual QVariantMap toVariantMap() const override
Save selection action to variant.
- Returns:
Variant representation of the selection action
Protected Functions
-
virtual void connectToPublicAction(WidgetAction *publicAction, bool recursive) override
Connect this action to a public action.
- Parameters:
publicAction – Pointer to public action to connect to
recursive – Whether to also connect descendant child actions
-
virtual void disconnectFromPublicAction(bool recursive) override
Disconnect this action from its public action.
- Parameters:
recursive – Whether to also disconnect descendant child actions