Changeset 6081 for trunk/qt4-gui/src/widgets
- Timestamp:
- 03/03/08 03:39:24 (9 months ago)
- Location:
- trunk/qt4-gui/src/widgets
- Files:
-
- 2 modified
-
colorbutton.cpp (modified) (2 diffs)
-
colorbutton.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/widgets/colorbutton.cpp
r5892 r6081 20 20 #include "colorbutton.h" 21 21 22 #ifndef USE_KDE 22 23 #include <QColorDialog> 24 #endif 23 25 24 26 using namespace LicqQtGui; 25 27 26 27 28 ColorButton::ColorButton(QWidget* parent) 28 : QPushButton(parent)29 : COLORBUTTON_BASE(parent) 29 30 { 31 #ifndef USE_KDE 30 32 setFixedSize(40, 20); 31 33 connect(this, SIGNAL(clicked()), SLOT(selectColor())); 32 } 33 34 QColor ColorButton::getColor() const 35 { 36 return palette().color(backgroundRole()); 34 #endif 37 35 } 38 36 39 37 QString ColorButton::colorName() const 40 38 { 41 return palette().color(backgroundRole()).name(); 39 return color().name(); 40 } 41 42 #ifndef USE_KDE 43 QColor ColorButton::color() const 44 { 45 return palette().color(backgroundRole()); 42 46 } 43 47 … … 54 58 pal.setColor(backgroundRole(), color); 55 59 setPalette(pal); 56 emit changed( );60 emit changed(color); 57 61 } 62 #endif -
trunk/qt4-gui/src/widgets/colorbutton.h
r5837 r6081 21 21 #define COLORBUTTON_H 22 22 23 #include "config.h" 24 25 #ifdef USE_KDE 26 #include <KDE/KColorButton> 27 #define COLORBUTTON_BASE KColorButton 28 #else 23 29 #include <QPushButton> 30 #define COLORBUTTON_BASE QPushButton 31 #endif 24 32 25 33 namespace LicqQtGui 26 34 { 27 class ColorButton : public QPushButton35 class ColorButton : public COLORBUTTON_BASE 28 36 { 29 37 Q_OBJECT … … 31 39 public: 32 40 ColorButton(QWidget* parent = NULL); 33 QColor getColor() const;34 41 QString colorName() const; 42 #ifndef USE_KDE 43 QColor color() const; 35 44 36 45 public slots: … … 39 48 40 49 signals: 41 void changed(); 50 void changed(const QColor& color); 51 #endif 42 52 }; 43 53
