20 #ifndef COLORWHEELITEM_H 21 #define COLORWHEELITEM_H 23 #include <QQuickPaintedItem> 26 class ColorWheelItem :
public QQuickPaintedItem
29 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
30 Q_PROPERTY(
int red READ red WRITE setRed)
31 Q_PROPERTY(
int green READ green WRITE setGreen)
32 Q_PROPERTY(
int blue READ blue WRITE setBlue)
34 explicit ColorWheelItem(QQuickItem *parent = 0);
36 void setColor(
const QColor &color);
40 void setGreen(
int green);
42 void setBlue(
int blue);
45 void colorChanged(
const QColor &color);
48 void mousePressEvent(QMouseEvent *event);
49 void mouseMoveEvent(QMouseEvent *event);
50 void mouseReleaseEvent(QMouseEvent *event);
51 void hoverMoveEvent(QHoverEvent * event);
52 void paint(QPainter *painter);
60 QRegion m_wheelRegion;
61 QRegion m_sliderRegion;
66 int wheelSize()
const;
67 QColor colorForPoint(
const QPoint &point);
69 void drawWheelDot(QPainter &painter);
70 void drawSliderBar(QPainter &painter);
72 void updateCursor(
const QPoint &pos);
75 #endif // COLORWHEELITEM_H