TriggersAction

Qualified name: mv::gui::TriggersAction

class TriggersAction : public mv::gui::WidgetAction

Triggers action class.

Action class for multiple triggers

Author

Thomas Kroes

Public Types

enum WidgetFlag

Describes the widget flags.

Values:

enumerator Horizontal
enumerator Vertical

Trigger buttons are distributed in a horizontal layout.

enumerator Default

Trigger buttons are distributed in a vertical layout.

Public Functions

TriggersAction(QObject *parent, const QString &title, const QVector<Trigger> &triggers = QVector<Trigger>())

Constructor.

Parameters:
  • parent – Pointer to parent object

  • title – Title of the action

  • triggers – Vector of triggers

const QVector<Trigger> &getTriggers() const

Get triggers.

Returns:

Vector of triggers

void setTriggers(const QVector<Trigger> &triggers)

Set triggers.

Parameters:

triggers – Vector of triggers

void setTriggerText(std::int32_t triggerIndex, const QString &text)

Set trigger text.

Parameters:
  • triggerIndex – Index of the trigger

  • textTrigger text

void setTriggerTooltip(std::int32_t triggerIndex, const QString &tooltip)

Set trigger tooltip.

Parameters:
  • triggerIndex – Index of the trigger

  • tooltipTrigger tooltip

void setTriggerEnabled(std::int32_t triggerIndex, const bool &enabled)

Set trigger enabled.

Parameters:
  • triggerIndex – Index of the trigger

  • enabledTrigger enabled

void triggersChanged(const QVector<Trigger> &triggers)

Signals that the triggers changed.

Parameters:

triggers – Triggers

void triggerChanged(std::int32_t triggerIndex, const Trigger &trigger)

Signals that a trigger changed.

Parameters:
  • triggerIndex – Index of the trigger

  • triggerTrigger that changed

void triggered(std::int32_t triggerIndex)

Signals that a trigger is executed.

Parameters:

triggerIndex – Index of the triggered

Protected Functions

inline virtual QWidget *getWidget(QWidget *parent, const std::int32_t &widgetFlags) override

Get widget representation of the triggers action.

Parameters:
  • parent – Pointer to parent widget

  • widgetFlagsWidget flags for the configuration of the widget

QPushButton *createTriggerPushButton(const Trigger &trigger)

Create trigger push button.

Parameters:

triggerTrigger for the push button

Returns:

Pointer to push button

struct Trigger

Trigger for push button.

Public Functions

inline Trigger(const QString &text, const QString &tooltip, bool enabled = true)

Constructor.

Parameters:
  • text – Push button text

  • tooltip – Push button tooltip

  • enabled – Push button enabled

inline bool operator==(const Trigger &rhs) const

Comparison operator for two triggers (compares the identifiers)

Parameters:

rhs – Right hand sign of the comparison

Public Members

bool _enabled

Unique trigger identifier.

QString _text

Push button read-only.

QString _tooltip

Push button text.

class Widget : public mv::gui::WidgetActionWidget

Widget class for triggers action.

Protected Functions

Widget(QWidget *parent, TriggersAction *triggersAction, const std::int32_t &widgetFlags)

Constructor.

Parameters:
  • parent – Pointer to parent widget

  • triggersAction – Pointer to triggers action

  • widgetFlagsWidget flags for the configuration of the widget

Friends

friend class TriggersAction