CCIMXDesktop
 
Loading...
Searching...
No Matches
InformToastLabel Class Reference

A custom QWidget designed to display an informative toast notification. More...

#include <InformToastLabel.h>

Inheritance diagram for InformToastLabel:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ InformToastLabel()

InformToastLabel::InformToastLabel ( QWidget *  parent = nullptr)
explicit

Constructs an InformToastLabel object.

Parameters
parentA pointer to the parent widget, if any. Defaults to nullptr.

◆ ~InformToastLabel()

InformToastLabel::~InformToastLabel ( )

Destroys the InformToastLabel object.

  • This destructor is responsible for cleaning up resources, particularly the dynamically allocated UI object.

Member Function Documentation

◆ paintEvent()

void InformToastLabel::paintEvent ( QPaintEvent *  event)
overrideprotected

Overrides the default paint event for the widget.

  • This method is responsible for custom drawing operations for the InformToastLabel, such as background, borders, or any other visual elements not handled by the Qt Designer-generated UI.
    Parameters
    eventA pointer to the QPaintEvent object that contains information about the paint area.

◆ setIcon()

void InformToastLabel::setIcon ( const QString &  icons)

Sets the icon for the toast notification.

  • This method expects a QString typically representing a file path to an image or an icon theme identifier. The implementation will load and display this icon next to the title/text.
    Parameters
    iconsThe QString containing the path or identifier for the icon.

◆ setText()

void InformToastLabel::setText ( const QString &  text)

Sets the main text message for the toast notification.

Parameters
textThe QString containing the main message to be displayed.

◆ setTitle()

void InformToastLabel::setTitle ( const QString &  title)

Sets the title text for the toast notification.

Parameters
titleThe QString containing the title to be displayed.

The documentation for this class was generated from the following files: