Version: 9.12.0
QtxNotify::NotifyWidget Class Reference

QtxNotify::NotifyWidget Class represented notification widget. More...

Inheritance diagram for QtxNotify::NotifyWidget:
Inheritance graph

Public Member Functions

 NotifyWidget (QtxNotify *, const QString &title, const QString &text, const int timeout, QWidget *parent=0)
 Constructor [private]. More...
 
virtual ~NotifyWidget ()
 Destructor. More...
 
QtxNotifynotifyMgr () const
 Gets the notification manager. More...
 
int id () const
 Gets the notification identifier. More...
 
QString text () const
 Gets the notification text. More...
 
QString title () const
 Gets the notification title. More...
 
int timeout () const
 Gets the notification timeout. More...
 
void setId (const int)
 Sets the notification timeout. More...
 
void setText (const QString &)
 Sets the notification text. More...
 
void setTitle (const QString &)
 Sets the notification title. More...
 
void setTimeout (const int)
 Sets the notification timeout. More...
 
virtual QSize sizeHint () const
 Gets the notification widget size hint. More...
 
virtual QSize minimumSizeHint () const
 Gets the notification widget minimum size hint. More...
 

Protected Member Functions

virtual void showEvent (QShowEvent *)
 
virtual void paintEvent (QPaintEvent *)
 Reimplemented for notification drawing. More...
 
virtual void mouseMoveEvent (QMouseEvent *)
 Reimplemented for handling close button. More...
 
virtual void mousePressEvent (QMouseEvent *)
 Reimplemented for handling close button. More...
 
virtual void mouseReleaseEvent (QMouseEvent *)
 Reimplemented for handling close button. More...
 

Private Types

typedef QSharedPointer< QTextDocument > TextDocument
 

Private Member Functions

int frameWidth () const
 Gets the notification frame with. More...
 
int notificationWidth () const
 Gets the notification window with. More...
 
QRect textRect () const
 Gets the notification message text rectangle. More...
 
QRect titleRect () const
 Gets the notification title rectangle. More...
 
QRect closeRect () const
 Gets the notification close button rectangle. More...
 
TextDocument textDocument () const
 Gets the text document with actual text and size. More...
 
void onTimeout ()
 Invoked when notification close timeout and hide the notification. More...
 

Private Attributes

int myId
 
QString myTitle
 
QString myText
 
QTimer * myTimer
 
QtxNotifymyNotifyMgr
 
bool myIsClosePressed
 

Detailed Description

QtxNotify::NotifyWidget Class represented notification widget.

Member Typedef Documentation

◆ TextDocument

typedef QSharedPointer<QTextDocument> QtxNotify::NotifyWidget::TextDocument
private

Constructor & Destructor Documentation

◆ NotifyWidget()

QtxNotify::NotifyWidget::NotifyWidget ( QtxNotify mgr,
const QString &  title,
const QString &  text,
const int  timeout,
QWidget parent = 0 
)

Constructor [private].

References myTimer, onTimeout(), setTimeout(), and timeout().

◆ ~NotifyWidget()

QtxNotify::NotifyWidget::~NotifyWidget ( )
virtual

Destructor.

Member Function Documentation

◆ closeRect()

QRect QtxNotify::NotifyWidget::closeRect ( ) const
private

Gets the notification close button rectangle.

Returns
close rectangle

◆ frameWidth()

int QtxNotify::NotifyWidget::frameWidth ( ) const
private

Gets the notification frame with.

Returns
Frame width in pixels

◆ id()

int QtxNotify::NotifyWidget::id ( ) const

Gets the notification identifier.

Returns
notification identifier

◆ minimumSizeHint()

QSize QtxNotify::NotifyWidget::minimumSizeHint ( ) const
virtual

Gets the notification widget minimum size hint.

Returns
minimum size hint

References QtxNotify::notificationWidth().

◆ mouseMoveEvent()

void QtxNotify::NotifyWidget::mouseMoveEvent ( QMouseEvent *  )
protectedvirtual

Reimplemented for handling close button.

◆ mousePressEvent()

void QtxNotify::NotifyWidget::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Reimplemented for handling close button.

◆ mouseReleaseEvent()

void QtxNotify::NotifyWidget::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

Reimplemented for handling close button.

◆ notificationWidth()

int QtxNotify::NotifyWidget::notificationWidth ( ) const
private

Gets the notification window with.

Returns
width in pixels

◆ notifyMgr()

QtxNotify * QtxNotify::NotifyWidget::notifyMgr ( ) const

Gets the notification manager.

Returns
notification manager instance

◆ onTimeout()

void QtxNotify::NotifyWidget::onTimeout ( )
private

Invoked when notification close timeout and hide the notification.

◆ paintEvent()

void QtxNotify::NotifyWidget::paintEvent ( QPaintEvent *  )
protectedvirtual

Reimplemented for notification drawing.

◆ setId()

void QtxNotify::NotifyWidget::setId ( const int  id)

Sets the notification timeout.

Parameters
id- notification identifier

◆ setText()

void QtxNotify::NotifyWidget::setText ( const QString &  text)

Sets the notification text.

Parameters
text- notification text string

◆ setTimeout()

void QtxNotify::NotifyWidget::setTimeout ( const int  timeout)

Sets the notification timeout.

Parameters
timeout- notification timeout

◆ setTitle()

void QtxNotify::NotifyWidget::setTitle ( const QString &  title)

Sets the notification title.

Parameters
title- notification title string

◆ showEvent()

void QtxNotify::NotifyWidget::showEvent ( QShowEvent *  e)
protectedvirtual

◆ sizeHint()

QSize QtxNotify::NotifyWidget::sizeHint ( ) const
virtual

Gets the notification widget size hint.

Returns
size hint

◆ text()

QString QtxNotify::NotifyWidget::text ( ) const

Gets the notification text.

Returns
notification text string

◆ textDocument()

QtxNotify::NotifyWidget::TextDocument QtxNotify::NotifyWidget::textDocument ( ) const
private

Gets the text document with actual text and size.

Returns
text document instance

References QtxNotify::notificationWidth().

◆ textRect()

QRect QtxNotify::NotifyWidget::textRect ( ) const
private

Gets the notification message text rectangle.

Returns
text rectangle

◆ timeout()

int QtxNotify::NotifyWidget::timeout ( ) const

Gets the notification timeout.

Returns
notification timeout

◆ title()

QString QtxNotify::NotifyWidget::title ( ) const

Gets the notification title.

Returns
notification title string

◆ titleRect()

QRect QtxNotify::NotifyWidget::titleRect ( ) const
private

Gets the notification title rectangle.

Returns
title rectangle

Member Data Documentation

◆ myId

int QtxNotify::NotifyWidget::myId
private

◆ myIsClosePressed

bool QtxNotify::NotifyWidget::myIsClosePressed
private

◆ myNotifyMgr

QtxNotify* QtxNotify::NotifyWidget::myNotifyMgr
private

◆ myText

QString QtxNotify::NotifyWidget::myText
private

◆ myTimer

QTimer* QtxNotify::NotifyWidget::myTimer
private

◆ myTitle

QString QtxNotify::NotifyWidget::myTitle
private

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