22class QtColorLine :
public QWidget
25 Q_PROPERTY(QColor color READ color WRITE setColor)
26 Q_PROPERTY(
int indicatorSpace READ indicatorSpace WRITE setIndicatorSpace)
27 Q_PROPERTY(
int indicatorSize READ indicatorSize WRITE setIndicatorSize)
28 Q_PROPERTY(
bool flip READ flip WRITE setFlip)
29 Q_PROPERTY(
bool backgroundCheckered READ isBackgroundCheckered WRITE setBackgroundCheckered)
30 Q_PROPERTY(ColorComponent colorComponent READ colorComponent WRITE setColorComponent)
31 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
43 Q_ENUM(ColorComponent)
45 QSize minimumSizeHint()
const override;
46 QSize sizeHint()
const override;
48 QtColorLine(QWidget *parent = 0);
53 void setIndicatorSize(
int size);
54 int indicatorSize()
const;
56 void setIndicatorSpace(
int space);
57 int indicatorSpace()
const;
59 void setFlip(
bool flip);
62 bool isBackgroundCheckered()
const;
63 void setBackgroundCheckered(
bool checkered);
65 void setOrientation(Qt::Orientation orientation);
66 Qt::Orientation orientation()
const;
68 void setColorComponent(ColorComponent component);
69 ColorComponent colorComponent()
const;
72 void setColor(QColor color);
75 void colorChanged(QColor color);
78 void resizeEvent(QResizeEvent *event) override;
79 void paintEvent(QPaintEvent *event) override;
80 void mousePressEvent(QMouseEvent *event) override;
81 void mouseMoveEvent(QMouseEvent *event) override;
82 void mouseReleaseEvent(QMouseEvent *event) override;
83 void mouseDoubleClickEvent(QMouseEvent *event) override;
86 QScopedPointer<
class QtColorLinePrivate> d_ptr;
87 Q_DECLARE_PRIVATE(QtColorLine)
88 Q_DISABLE_COPY_MOVE(QtColorLine)