00001 // 00002 // C++ Interface: qwwhuesatradialpicker 00003 // 00004 // Description: 00005 // 00006 // 00007 // Author: Witold Wysota <wysota@wysota.eu.org>, (C) 2007 00008 // 00009 // Copyright: See COPYING file that comes with this distribution 00010 // 00011 // 00012 #ifndef QWWHUESATRADIALPICKER_H 00013 #define QWWHUESATRADIALPICKER_H 00014 00015 #ifndef WW_NO_HUESATRADIALPICKER 00016 00017 #include <QWidget> 00018 #include <QConicalGradient> 00019 #include <wwglobal.h> 00020 00021 class QwwHueSatRadialPickerPrivate; 00022 class Q_WW_EXPORT QwwHueSatRadialPicker : public QWidget, public QwwPrivatable { 00023 Q_OBJECT 00024 Q_PROPERTY(int value READ value WRITE setValue); 00025 Q_PROPERTY(QColor color READ color WRITE setColor); 00026 public: 00027 QwwHueSatRadialPicker(QWidget *parent = 0); 00028 ~QwwHueSatRadialPicker(); 00029 int value() const; 00030 QSize sizeHint() const; 00031 QSize minimumSizeHint() const; 00032 int heightForWidth(int w) const; 00033 const QColor color() const; 00034 public slots: 00035 void setValue(int v); 00036 void setColor(const QColor &c); 00037 signals: 00038 void valueChanged(int); 00039 void colorPicked(QColor); 00040 protected: 00041 void paintEvent(QPaintEvent*); 00042 void resizeEvent(QResizeEvent *); 00043 void mousePressEvent(QMouseEvent *me); 00044 void mouseMoveEvent(QMouseEvent *me); 00045 virtual void drawCrosshair(QPainter *p, const QPoint &pt); 00046 private: 00047 00048 WW_DECLARE_PRIVATE(QwwHueSatRadialPicker); 00049 Q_DISABLE_COPY(QwwHueSatRadialPicker); 00050 }; 00051 00052 #endif 00053 #endif