WidgetActionViewWidget

Qualified name: mv::gui::WidgetActionViewWidget

class WidgetActionViewWidget : public QWidget

Widget action view widget class.

Base class for widgets that provide a view on an action.

Note: This action is developed for internal use only

Author

Thomas Kroes

Subclassed by mv::gui::WidgetActionCollapsedWidget, mv::gui::WidgetActionLabel, mv::gui::WidgetActionWidget

Public Types

enum WidgetFlag

Reserved widget view flags.

Values:

enumerator PopupLayout

Public Functions

WidgetActionViewWidget(QWidget *parent, WidgetAction *action, std::int32_t widgetFlags = 0)

Constructor.

Parameters:
  • parent – Parent widget

  • action – Pointer to the action that will be displayed

  • widgetFlags – Widget flags for the configuration of the widget

WidgetAction *getAction() const

Get the source action.

Returns:

Pointer to source action

virtual void setAction(WidgetAction *widgetAction)

Set the source action.

Parameters:

widgetAction – Pointer to source action

std::int32_t getWidgetFlags() const

Get widget flags.

Returns:

Widget flags

bool isPopup() const

Get whether the widget is in a popup state.

Returns:

Boolean determining whether the widget is in a popup state

void mousePressEvent(QMouseEvent *event) override

Override the mouse press event to avoid click-and-close behaviour for popups.

Parameters:

event – Pointer to mouse event

Protected Functions

void dragEnterEvent(QDragEnterEvent *dragEnterEvent) override

Invoked when a dragEnterEvent occurs.

Parameters:

dragEnterEvent – Pointer to drag enter event

void dragLeaveEvent(QDragLeaveEvent *dragLeaveEvent) override

Invoked when a dragLeaveEvent occurs.

Parameters:

dragLeaveEvent – Pointer to drag leave event

void dropEvent(QDropEvent *dropEvent) override

Invoked when a dropEvent occurs.

Parameters:

dropEvent – Pointer to drop event