A widget containing a hidable, optionally dismissable message label.
More...
#include <messagewidget.h>
Inherits QWidget.
A widget containing a hidable, optionally dismissable message label.
This is a QLabel to show a custom message in the GUI, with a "hide" and "don't show again" label on the right side to allow hiding it. The "don't show again" feature is implemented with librepcb::WorkspaceSettings::dismissedMessages and is therefore only available if the Workspace is set.
You have to call one of the init() methods to make this widget working. Do not call QWidget::show()
, QWidget::hide()
or QWidget::setVisible()
manually!
◆ MessageWidget() [1/2]
◆ MessageWidget() [2/2]
◆ ~MessageWidget()
◆ init() [1/2]
void init |
( |
const QString & |
message, |
|
|
bool |
active |
|
) |
| |
|
noexcept |
Initialize widget without the "don't show again" feature.
Allows only temporary dismissing, but not permanently.
- Parameters
-
message | The message to show. |
active | Whether the message should currently be shown or not. |
◆ init() [2/2]
void init |
( |
Workspace & |
workspace, |
|
|
const QString & |
dismissKey, |
|
|
const QString & |
message, |
|
|
bool |
active |
|
) |
| |
|
noexcept |
Initialize widget with the "don't show again" feature.
Allows both, temporary or permanently dismissing the message.
- Parameters
-
workspace | The workspace to use for the persistent settings. |
dismissKey | The unique identifier for this message, see details at librepcb::WorkspaceSettings::dismissedMessages. |
message | The message to show. |
active | Whether the message should currently be shown or not. |
◆ setActive()
void setActive |
( |
bool |
active | ) |
|
|
noexcept |
Set whether the message should be shown (if not dismissed) or not.
The widget will be visible only if true
is passed and the message was not dismissed.
- Parameters
-
active | Whether the message should currently be shown or not. |
◆ operator=()
◆ linkActivated
void linkActivated |
( |
const QString & |
link | ) |
|
|
signal |
A link in the message label has been clicked.
- Parameters
-
◆ setWorkspace()
◆ dismissedMessagesModified()
void dismissedMessagesModified |
( |
| ) |
|
|
privatenoexcept |
◆ updateVisibility()
void updateVisibility |
( |
| ) |
|
|
privatenoexcept |
◆ mLayout
QPointer<QHBoxLayout> mLayout |
|
private |
◆ mMessageLabel
QScopedPointer<QLabel> mMessageLabel |
|
private |
◆ mDismissLabel
QScopedPointer<QLabel> mDismissLabel |
|
private |
◆ mHideLabel
QScopedPointer<QLabel> mHideLabel |
|
private |
◆ mWorkspace
◆ mDismissKey
◆ mActive
◆ mTemporarilyHidden
The documentation for this class was generated from the following files: