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
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
-
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
-
LineEditWidget(QWidget *parent, StatusAction *statusAction, const std::int32_t &widgetFlags)