00001 #ifndef COLORPUSHBUTTON_H 00002 #define COLORPUSHBUTTON_H 00003 00004 #include <QPushButton> 00005 00009 class ColorPushButton : public QPushButton 00010 { 00011 Q_OBJECT 00012 00013 public: 00014 ColorPushButton(QWidget* parent); 00015 ~ColorPushButton(); 00016 00017 const QColor& getColor() {return this->palette().color(this->backgroundRole());} 00018 00019 signals: 00020 void colorChanged(const QColor& color); 00021 00022 public slots: 00023 void setColor(const QColor& color); 00024 void setColorText(const QString& text, const QColor& color); 00025 }; 00026 00027 #endif