StatusAction

Qualified name: mv::gui::StatusAction

class StatusAction : public mv::gui::WidgetAction

Status action class.

Action class for reporting status

Note: This action is a WIP

Author

Thomas Kroes

Public Types

enum WidgetFlag

Describes the widget flags.

Values:

enumerator LineEdit
enumerator Default

Status is logged in a line edit.

enum Status

Status enumeration.

Values:

enumerator Undefined
enumerator Info

There is no status information.

enumerator Warning

Normal info.

enumerator Error

Warning.

An error occurred

Public Functions

Q_INVOKABLE StatusAction(QObject *parent, const QString &title, const Status &status = Status::Undefined, const QString &message = "")

Constructor.

Parameters:
  • parent – Pointer to parent object

  • title – Title of the action

  • status – Status type

  • message – Status message

void initialize(const Status &status = Status::Info, const QString &message = "")

Initialize the status action.

Parameters:
  • status – Status type

  • message – Status message

Status getStatus() const

Get status type.

Returns:

Status type

void setStatus(const Status &status)

Set status type.

Parameters:

status – Status type

QString getMessage() const

Get status message.

Returns:

Status message

void setMessage(const QString &message, bool vanish = false)

Set status message.

Parameters:
  • message – Status message

  • vanish – Whether to reset the message after the disappear message delay

void statusChanged(const Status &status)

Signals that the status changed.

Parameters:

status – Status

void messageChanged(const QString &message)

Signals that the message changed.

Parameters:

message – Message that changed

Protected Functions

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

Get widget representation of the status action.

Parameters:
  • parent – Pointer to parent widget

  • widgetFlags – Widget flags for the configuration of the widget

Protected Attributes

QString _message

Current status enum.

Protected Static Attributes

static constexpr std::int32_t MESSAGE_DISAPPEAR_INTERVAL = 1500

Status message.

class LineEditWidget : public QLineEdit

Line edit widget class for status action.

Protected Functions

LineEditWidget(QWidget *parent, StatusAction *statusAction, const std::int32_t &widgetFlags)

Constructor.

Parameters:
  • parent – Pointer to parent widget

  • statusAction – Pointer to status action

  • widgetFlags – Widget flags for the configuration of the widget

Protected Attributes

QAction _trailingAction

Pointer to status action.

Friends

friend class StatusAction