A custom QWidget designed to display an informative toast notification. More...
#include <InformToastLabel.h>
Public Member Functions | |
InformToastLabel (QWidget *parent=nullptr) | |
Constructs an InformToastLabel object. | |
~InformToastLabel () | |
Destroys the InformToastLabel object. | |
void | setTitle (const QString &title) |
Sets the title text for the toast notification. | |
void | setText (const QString &text) |
Sets the main text message for the toast notification. | |
void | setIcon (const QString &icons) |
Sets the icon for the toast notification. | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *event) override |
Overrides the default paint event for the widget. | |
A custom QWidget designed to display an informative toast notification.
This widget provides a visual component for displaying transient, non-intrusive notifications to the user. It typically includes a title, a main text message, and an optional icon. The appearance can be customized through its paintEvent
. It is designed to work with a UI file generated by Qt Designer for its layout.
|
explicit |
Constructs an InformToastLabel object.
parent | A pointer to the parent widget, if any. Defaults to nullptr . |
InformToastLabel::~InformToastLabel | ( | ) |
Destroys the InformToastLabel object.
|
overrideprotected |
Overrides the default paint event for the widget.
InformToastLabel
, such as background, borders, or any other visual elements not handled by the Qt Designer-generated UI. event | A pointer to the QPaintEvent object that contains information about the paint area. |
void InformToastLabel::setIcon | ( | const QString & | icons | ) |
Sets the icon for the toast notification.
icons | The QString containing the path or identifier for the icon. |
void InformToastLabel::setText | ( | const QString & | text | ) |
Sets the main text message for the toast notification.
text | The QString containing the main message to be displayed. |
void InformToastLabel::setTitle | ( | const QString & | title | ) |
Sets the title text for the toast notification.
title | The QString containing the title to be displayed. |