This widget can be used to provide inline positive or negative feedback, or to implement opportunistic interactions.
|
enum | MessageType {
Positive
, Notification
, Information
, Warning
,
Error
} |
| Available message types. More...
|
|
|
void | animatedHide () |
| Hide the widget using an animation.
|
|
void | animatedShow () |
| Show the widget using an animation.
|
|
void | setCloseButtonVisible (bool visible) |
| Set the visibility of the close button.
|
|
void | setIcon (const QIcon &icon) |
| Define an icon to be shown on the left of the text.
|
|
void | setMessageType (DNotificationWidget::MessageType type) |
| Set the message type to type .
|
|
void | setText (const QString &text) |
| Set the text of the message widget to text .
|
|
void | setWordWrap (bool wordWrap) |
| Set word wrap to wordWrap .
|
|
|
void | hideAnimationFinished () |
| This signal is emitted when the hide animation is finished, started by calling animatedHide().
|
|
void | linkActivated (const QString &contents) |
| This signal is emitted when the user clicks a link in the text label.
|
|
void | linkHovered (const QString &contents) |
| This signal is emitted when the user hovers over a link in the text label.
|
|
void | showAnimationFinished () |
| This signal is emitted when the show animation is finished, started by calling animatedShow().
|
|
|
| DNotificationWidget (const QString &text, QWidget *const parent=nullptr) |
| Constructs a DNotificationWidget with the specified parent and contents text .
|
|
| DNotificationWidget (QWidget *const parent=nullptr) |
| Constructs a DNotificationWidget with the specified parent .
|
|
| ~DNotificationWidget () override |
| Destructor.
|
|
void | addAction (QAction *action) |
| Add action to the message widget.
|
|
void | animatedShowTemporized (int delay) |
| Show the widget using an animation.
|
|
void | clearAllActions () |
| clear all actions from the message widget.
|
|
int | heightForWidth (int width) const override |
| Returns the required height for width .
|
|
QIcon | icon () const |
| The icon shown on the left of the text.
|
|
bool | isCloseButtonVisible () const |
| Check whether the close button is visible.
|
|
bool | isHideAnimationRunning () const |
| Check whether the hide animation started by calling animatedHide() is still running.
|
|
bool | isShowAnimationRunning () const |
| Check whether the show animation started by calling animatedShow() is still running.
|
|
MessageType | messageType () const |
| Get the type of this message.
|
|
QSize | minimumSizeHint () const override |
| Returns the minimum size of the message widget.
|
|
void | removeAction (QAction *action) |
| Remove action from the message widget.
|
|
QSize | sizeHint () const override |
| Returns the preferred size of the message widget.
|
|
QString | text () const |
| Get the text of this message widget.
|
|
bool | wordWrap () const |
| Check whether word wrap is enabled.
|
|
|
bool | event (QEvent *event) override |
|
void | paintEvent (QPaintEvent *event) override |
|
void | resizeEvent (QResizeEvent *event) override |
|
|
bool | closeButtonVisible |
|
QIcon | icon |
|
MessageType | messageType |
|
QString | text |
|
bool | wordWrap |
|
◆ MessageType
The background colors are chosen depending on the message type.
◆ addAction()
void Digikam::DNotificationWidget::addAction |
( |
QAction * |
action | ) |
|
For each action a button is added to the message widget in the order the actions were added.
- Parameters
-
- See also
- removeAction(), QWidget::actions()
◆ animatedShowTemporized()
void Digikam::DNotificationWidget::animatedShowTemporized |
( |
int |
delay | ) |
|
The widget is automatically hidden after the delay (in ms).
◆ clearAllActions()
void Digikam::DNotificationWidget::clearAllActions |
( |
| ) |
|
◆ heightForWidth()
int Digikam::DNotificationWidget::heightForWidth |
( |
int |
width | ) |
const |
|
override |
◆ hideAnimationFinished
void Digikam::DNotificationWidget::hideAnimationFinished |
( |
| ) |
|
|
signal |
If animations are disabled, this signal is emitted immediately after the message widget got hidden.
- Note
- This signal is not emitted if the widget was hidden by calling hide(), so this signal is only useful in conjunction with animatedHide().
- See also
- animatedHide()
◆ icon()
QIcon Digikam::DNotificationWidget::icon |
( |
| ) |
const |
By default, no icon is shown.
◆ isCloseButtonVisible()
bool Digikam::DNotificationWidget::isCloseButtonVisible |
( |
| ) |
const |
◆ isHideAnimationRunning()
bool Digikam::DNotificationWidget::isHideAnimationRunning |
( |
| ) |
const |
◆ isShowAnimationRunning()
bool Digikam::DNotificationWidget::isShowAnimationRunning |
( |
| ) |
const |
◆ linkActivated
void Digikam::DNotificationWidget::linkActivated |
( |
const QString & |
contents | ) |
|
|
signal |
The URL referred to by the href anchor is passed in contents.
- Parameters
-
contents | text of the href anchor |
- See also
- QLabel::linkActivated()
◆ linkHovered
void Digikam::DNotificationWidget::linkHovered |
( |
const QString & |
contents | ) |
|
|
signal |
The URL referred to by the href anchor is passed in contents.
- Parameters
-
contents | text of the href anchor |
- See also
- QLabel::linkHovered()
◆ messageType()
◆ removeAction()
void Digikam::DNotificationWidget::removeAction |
( |
QAction * |
action | ) |
|
◆ setCloseButtonVisible
void Digikam::DNotificationWidget::setCloseButtonVisible |
( |
bool |
visible | ) |
|
|
slot |
◆ setMessageType
◆ setText
void Digikam::DNotificationWidget::setText |
( |
const QString & |
text | ) |
|
|
slot |
If the message widget is already visible, the text changes on the fly.
- Parameters
-
text | the text to display, rich text is allowed |
- See also
- text()
◆ setWordWrap
void Digikam::DNotificationWidget::setWordWrap |
( |
bool |
wordWrap | ) |
|
|
slot |
If word wrap is enabled, the text() of the message widget is wrapped to fit the available width. If word wrap is disabled, the message widget's minimum size is such that the entire text fits.
- Parameters
-
wordWrap | disable/enable word wrap |
- See also
- wordWrap()
◆ showAnimationFinished
void Digikam::DNotificationWidget::showAnimationFinished |
( |
| ) |
|
|
signal |
If animations are disabled, this signal is emitted immediately after the message widget got shown.
- Note
- This signal is not emitted if the widget was shown by calling show(), so this signal is only useful in conjunction with animatedShow().
- See also
- animatedShow()
◆ text()
QString Digikam::DNotificationWidget::text |
( |
| ) |
const |
◆ wordWrap()
bool Digikam::DNotificationWidget::wordWrap |
( |
| ) |
const |
If word wrap is enabled, the message widget wraps the displayed text as required to the available width of the widget. This is useful to avoid breaking widget layouts.
- See also
- setWordWrap()