Version: 9.12.0
QtxLogoMgr Class Reference

Provides a way to install logo pictures to the application main window. More...

#include <QtxLogoMgr.h>

Inheritance diagram for QtxLogoMgr:
Inheritance graph

Classes

class  LogoBox
 Logo images container. More...
 
struct  LogoInfo
 

Public Member Functions

 QtxLogoMgr (QMenuBar *)
 Constructor. More...
 
virtual ~QtxLogoMgr ()
 Destructor. More...
 
int count () const
 Get number of logo images. More...
 
void insert (const QString &, QMovie *, const int=-1)
 Insert new animated logo to the menu bar area. More...
 
void insert (const QString &, const QPixmap &, const int=-1)
 Insert new logo pixmap to the menu bar area. More...
 
void remove (const QString &)
 Remove a logo. More...
 
void clear ()
 Removes all logos. More...
 
void startAnimation (const QString &=QString())
 Start the animation of movie logo. More...
 
void stopAnimation (const QString &=QString())
 Stop the animation of movie logo. More...
 
void pauseAnimation (const bool, const QString &=QString())
 Pause/resume the animation of movie logo. More...
 
QMenuBar * menuBar () const
 Get menu bar. More...
 

Private Types

typedef QList< LogoInfoLogoList
 

Private Member Functions

void generate ()
 Regenerate logo manager widget contents. More...
 
int find (const QString &) const
 Search the logo by the specified id. More...
 
LogoInfoinsert (const QString &, const int)
 Insert new logo information structure into the logos list. More...
 
void movies (const QString &, QList< QMovie * > &) const
 Get movie logos by specified id. More...
 

Private Attributes

LogoBoxmyBox
 widget containing logox More...
 
LogoList myLogos
 list of logo data More...
 

Detailed Description

Provides a way to install logo pictures to the application main window.

The class includes the following functionality:

  • add the logo image
  • remove logo image
  • support static images and animated images (QMovie)
  • start/stop and pause/resume the animated logos

Member Typedef Documentation

◆ LogoList

Constructor & Destructor Documentation

◆ QtxLogoMgr()

QtxLogoMgr::QtxLogoMgr ( QMenuBar *  mb)

Constructor.

Parameters
mbparent menu bar

References myBox.

◆ ~QtxLogoMgr()

QtxLogoMgr::~QtxLogoMgr ( )
virtual

Destructor.

Member Function Documentation

◆ clear()

void QtxLogoMgr::clear ( )

Removes all logos.

References generate(), and myLogos.

◆ count()

int QtxLogoMgr::count ( ) const

Get number of logo images.

Returns
current number of logo images

References myLogos.

◆ find()

int QtxLogoMgr::find ( const QString &  id) const
private

Search the logo by the specified id.

Parameters
idlogo identifier
Returns
index of logo or -1 if not found

References myLogos.

◆ generate()

void QtxLogoMgr::generate ( )
private

Regenerate logo manager widget contents.

Insert logo to menu bar if it not yet done, layout the widget.

References menuBar(), myBox, myLogos, and QtxLogoMgr::LogoBox::setLabels().

◆ insert() [1/3]

QtxLogoMgr::LogoInfo & QtxLogoMgr::insert ( const QString &  id,
const int  index 
)
private

Insert new logo information structure into the logos list.

Parameters
idunique string identifier of the logo
indexlogo position (if < 0, logo is added to the end)
Returns
logo information object

References find(), QtxLogoMgr::LogoInfo::id, QtxLogoMgr::LogoInfo::mov, and myLogos.

◆ insert() [2/3]

void QtxLogoMgr::insert ( const QString &  id,
const QPixmap &  pix,
const int  index = -1 
)

Insert new logo pixmap to the menu bar area.

Parameters
idunique string identifier of the logo
pixlogo pixmap
indexlogo position (if < 0, logo is added to the end)

References generate(), insert(), and QtxLogoMgr::LogoInfo::pix.

◆ insert() [3/3]

void QtxLogoMgr::insert ( const QString &  id,
QMovie *  movie,
const int  index = -1 
)

Insert new animated logo to the menu bar area.

Parameters
idunique string identifier of the logo
pixlogo movie
indexlogo position (if < 0, logo is added to the end)

References generate(), and QtxLogoMgr::LogoInfo::mov.

◆ menuBar()

QMenuBar * QtxLogoMgr::menuBar ( ) const

Get menu bar.

Returns
parent menu bar

References QtxLogoMgr::LogoBox::menuBar(), and myBox.

◆ movies()

void QtxLogoMgr::movies ( const QString &  id,
QList< QMovie * > &  lst 
) const
private

Get movie logos by specified id.

If id is empty, all movie logos are returned.

Parameters
idlogo identifier
lstlist of movies, which satisfy the id

References myLogos.

◆ pauseAnimation()

void QtxLogoMgr::pauseAnimation ( const bool  pause,
const QString &  id = QString() 
)

Pause/resume the animation of movie logo.

If pause is true, the animation is paused; otherwise it is resumed.

If id is empty, the operation is performed for all movis logos.

Parameters
pauseif true, pause animation, otherwise resume it
idlogo identifier

References movies().

◆ remove()

void QtxLogoMgr::remove ( const QString &  id)

Remove a logo.

Parameters
idlogo identifier

References find(), generate(), and myLogos.

◆ startAnimation()

void QtxLogoMgr::startAnimation ( const QString &  id = QString())

Start the animation of movie logo.

If id is empty, all movie logos animation are started.

Parameters
idlogo identifier

References movies().

◆ stopAnimation()

void QtxLogoMgr::stopAnimation ( const QString &  id = QString())

Stop the animation of movie logo.

If id is empty, all movie logos animation are stopped.

Parameters
idlogo identifier

References movies().

Member Data Documentation

◆ myBox

LogoBox* QtxLogoMgr::myBox
private

widget containing logox

◆ myLogos

LogoList QtxLogoMgr::myLogos
private

list of logo data


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