Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

clickableLabel.h

Go to the documentation of this file.
00001 //============================================== 00002 // copyright : (C) 2003-2005 by Will Stokes 00003 //============================================== 00004 // This program is free software; you can redistribute it 00005 // and/or modify it under the terms of the GNU General 00006 // Public License as published by the Free Software 00007 // Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 //============================================== 00010 00011 #ifndef GUI_CLICKABLELABEL_H 00012 #define GUI_CLICKABLELABEL_H 00013 00014 #include <qlabel.h> 00015 #include <qpixmap.h> 00016 00017 //===================================== 00020 //===================================== 00021 00022 //====================== 00023 class ClickableLabel : public QLabel 00024 { 00025 Q_OBJECT 00026 //---------------------- 00027 public: 00028 ClickableLabel( QWidget *parent=0, const char* name=0); 00029 void setInvisible( bool val ); 00030 //---------------------- 00031 protected: 00033 void paintEvent( QPaintEvent *e ); 00034 00035 void enterEvent ( QEvent * ); 00036 void leaveEvent ( QEvent * ); 00037 00038 void mouseMoveEvent( QMouseEvent* e ); 00039 void mousePressEvent ( QMouseEvent * ); 00040 void mouseReleaseEvent ( QMouseEvent * e ); 00041 //---------------------- 00042 public slots: 00043 void setEnabled( bool val ); 00044 void setPixmap( const QPixmap &p ); 00045 //---------------------- 00046 signals: 00047 void clicked(); 00048 //---------------------- 00049 private: 00050 //redraws label using an "active" pixmap 00051 void setActive(); 00052 00053 //redraws label using a "hightlighted" pixmap 00054 void setHighlighted(); 00055 00056 QPixmap defaultPixmap; 00057 bool enabled; 00058 bool invisible; 00059 bool pressed; 00060 //---------------------- 00061 }; 00062 //====================== 00063 00064 #endif //GUI_CLICKABLELABEL_H

Generated on Sun Mar 4 19:42:55 2007 for AlbumShaper by doxygen 1.3.7