TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TTKToastLabel Class Reference

The class of the toast widget. More...

#include <ttktoastlabel.h>

+ Inheritance diagram for TTKToastLabel:

Public Slots

void setText (const QString &text)
 

Signals

void finished ()
 

Public Member Functions

 TTKToastLabel (QWidget *parent=nullptr)
 
 TTKToastLabel (const QString &text, QWidget *parent=nullptr)
 
 ~TTKToastLabel ()
 
void setFontMargin (int height, int width)
 
int timerInterval () const
 
void setFontSize (int size)
 
void popup (QWidget *parent=nullptr)
 

Private Slots

void closeAnimation ()
 

Private Member Functions

virtual void paintEvent (QPaintEvent *event) overridefinal
 

Private Attributes

QFont m_font
 
QPoint m_margin
 
QTimer m_timer
 

Detailed Description

The class of the toast widget.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 29 of file ttktoastlabel.h.

Constructor & Destructor Documentation

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

Object constructor.

Definition at line 7 of file ttktoastlabel.cpp.

References closeAnimation(), m_timer, setFontMargin(), setFontSize(), and TTK_DN_S2MS.

TTKToastLabel::TTKToastLabel ( const QString &  text,
QWidget *  parent = nullptr 
)
explicit

Definition at line 23 of file ttktoastlabel.cpp.

References setText().

TTKToastLabel::~TTKToastLabel ( )

Object destructor.

Definition at line 29 of file ttktoastlabel.cpp.

References m_timer.

Member Function Documentation

void TTKToastLabel::closeAnimation ( )
privateslot

Close animation when tiem out.

Definition at line 73 of file ttktoastlabel.cpp.

References finished(), m_timer, and TTK_DN_S2MS.

Referenced by TTKToastLabel().

void TTKToastLabel::finished ( )
signal

Animation close changed.

Referenced by closeAnimation().

void TTKToastLabel::paintEvent ( QPaintEvent *  event)
finaloverrideprivatevirtual

Override the widget event.

Definition at line 87 of file ttktoastlabel.cpp.

void TTKToastLabel::popup ( QWidget *  parent = nullptr)

Popup the toast widget in parent widget.

Definition at line 51 of file ttktoastlabel.cpp.

References TTKDesktopWrapper::screenGeometry().

Referenced by MusicToastLabel::popup().

void TTKToastLabel::setFontMargin ( int  height,
int  width 
)

Set text margin in the body.

Definition at line 34 of file ttktoastlabel.cpp.

References m_margin.

Referenced by TTKToastLabel().

void TTKToastLabel::setFontSize ( int  size)

Set context font size.

Definition at line 45 of file ttktoastlabel.cpp.

References m_font.

Referenced by TTKToastLabel().

void TTKToastLabel::setText ( const QString &  text)
slot

Set context text.

Definition at line 66 of file ttktoastlabel.cpp.

References m_font, m_margin, and QtFontWidth.

Referenced by MusicToastLabel::popup(), MusicItemRenameEidt::textChanged(), and TTKToastLabel().

int TTKToastLabel::timerInterval ( ) const

Get timer interval.

Definition at line 40 of file ttktoastlabel.cpp.

References m_timer.

Member Data Documentation

QFont TTKToastLabel::m_font
private

Definition at line 86 of file ttktoastlabel.h.

Referenced by setFontSize(), and setText().

QPoint TTKToastLabel::m_margin
private

Definition at line 87 of file ttktoastlabel.h.

Referenced by setFontMargin(), and setText().

QTimer TTKToastLabel::m_timer
private

Definition at line 88 of file ttktoastlabel.h.

Referenced by closeAnimation(), timerInterval(), TTKToastLabel(), and ~TTKToastLabel().


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