00001 #ifndef QCOLORSELECTOR_H 00002 #define QCOLORSELECTOR_H 00003 00004 /**************************************************************************\ 00005 * REQUIRED HEADERS * 00006 \**************************************************************************/ 00007 00008 //QT 00009 #include <QObject> 00010 #include <QGraphicsRectItem> 00011 //OWN 00012 00013 /**************************************************************************\ 00014 * DEFINITIONS * 00015 \**************************************************************************/ 00016 00017 class QColorSelect; 00018 class QGraphicsView; 00019 00020 /**************************************************************************\ 00021 * CLASS * 00022 \**************************************************************************/ 00023 class QColorSelector : public QGraphicsRectItem 00024 { 00025 00026 /**************************************************************************\ 00027 * PUBLIC CLASS FUNCTIONS * 00028 \**************************************************************************/ 00029 public: 00030 00031 QColorSelector(QColorSelect * view); 00032 ~QColorSelector(); 00033 00034 enum { Type = QGraphicsItem::UserType + 1}; 00035 int type() const {return Type;} 00036 00037 void ScaleX(float scale); 00038 00039 /**************************************************************************\ 00040 * PROTECTED CLASS FUNCTIONS * 00041 \**************************************************************************/ 00042 protected: 00043 00044 virtual QRectF boundingRect(); 00045 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 00046 00047 /**************************************************************************\ 00048 * PRIVATE CLASS FUNCTIONS * 00049 \**************************************************************************/ 00050 private: 00051 00052 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); 00053 00054 /**************************************************************************\ 00055 * PRIVATE CLASS MEMBERS * 00056 \**************************************************************************/ 00057 private: 00058 00059 QPointF points[3]; 00060 }; 00061 00062 #endif // QCOLORSELECTOR_H