Documentation


qPlayButton.cpp

Go to the documentation of this file.
00001 #include <qtimer.h>
00002 #include "qPlayButton.h"
00003 
00004 static const char * pause_xpm[] = {
00005 "21 21 2 1",
00006 "   c None",
00007 ".  c #0000F0",
00008 "                     ",
00009 "                     ",
00010 "                     ",
00011 "     ....   ....     ",
00012 "     ....   ....     ",
00013 "     ....   ....     ",
00014 "     ....   ....     ",
00015 "     ....   ....     ",
00016 "     ....   ....     ",
00017 "     ....   ....     ",
00018 "     ....   ....     ",
00019 "     ....   ....     ",
00020 "     ....   ....     ",
00021 "     ....   ....     ",
00022 "     ....   ....     ",
00023 "     ....   ....     ",
00024 "     ....   ....     ",
00025 "     ....   ....     ",
00026 "                     ",
00027 "                     ",
00028 "                     "};
00029 
00030 static const char * play_xpm[] = {
00031 "21 21 2 1",
00032 "   c None",
00033 ".  c #0000F0",
00034 "                     ",
00035 "       .             ",
00036 "       ..            ",
00037 "       ...           ",
00038 "       ....          ",
00039 "       .....         ",
00040 "       ......        ",
00041 "       .......       ",
00042 "       ........      ",
00043 "       .........     ",
00044 "       ..........    ",
00045 "       .........     ",
00046 "       ........      ",
00047 "       .......       ",
00048 "       ......        ",
00049 "       .....         ",
00050 "       ....          ",
00051 "       ...           ",
00052 "       ..            ",
00053 "       .             ",
00054 "                     "};
00055 
00056 
00057 QPlayButton::QPlayButton( QWidget *parent, const char *name )
00058   : QToolButton(parent,name) 
00059   , _go(false)
00060 {
00061   // button
00062   connect(this, SIGNAL(clicked()), this, SLOT(startStop())); // redirection for overloading
00063   if( _go ) setPixmap( QPixmap(pause_xpm) );
00064   else setPixmap( QPixmap(play_xpm) );
00065 }
00066 
00067 void QPlayButton::startStop()
00068 {
00069   //cerr<<"QPlayButton::startStop"<<endl;
00070   _go = ! _go;
00071 
00072   if( _go ) setPixmap( QPixmap(pause_xpm) );
00073   else setPixmap( QPixmap(play_xpm) );
00074   
00075   emit play(_go);
00076 }
00077 

Generated on Thu Dec 23 13:52:27 2004 by doxygen 1.3.6