22class QtGradientWidget :
public QWidget
25 Q_PROPERTY(
bool backgroundCheckered READ isBackgroundCheckered WRITE setBackgroundCheckered)
27 QtGradientWidget(QWidget *parent = 0);
30 QSize minimumSizeHint()
const override;
31 QSize sizeHint()
const override;
32 int heightForWidth(
int w)
const override;
34 bool isBackgroundCheckered()
const;
35 void setBackgroundCheckered(
bool checkered);
37 QGradientStops gradientStops()
const;
39 void setGradientType(QGradient::Type type);
40 QGradient::Type gradientType()
const;
42 void setGradientSpread(QGradient::Spread spread);
43 QGradient::Spread gradientSpread()
const;
45 void setStartLinear(QPointF point);
46 QPointF startLinear()
const;
48 void setEndLinear(QPointF point);
49 QPointF endLinear()
const;
51 void setCentralRadial(QPointF point);
52 QPointF centralRadial()
const;
54 void setFocalRadial(QPointF point);
55 QPointF focalRadial()
const;
57 void setRadiusRadial(qreal radius);
58 qreal radiusRadial()
const;
60 void setCentralConical(QPointF point);
61 QPointF centralConical()
const;
63 void setAngleConical(qreal angle);
64 qreal angleConical()
const;
67 void setGradientStops(
const QGradientStops &stops);
71 void startLinearChanged(
const QPointF &point);
72 void endLinearChanged(
const QPointF &point);
73 void centralRadialChanged(
const QPointF &point);
74 void focalRadialChanged(
const QPointF &point);
75 void radiusRadialChanged(qreal radius);
76 void centralConicalChanged(
const QPointF &point);
77 void angleConicalChanged(qreal angle);
80 void paintEvent(QPaintEvent *e) override;
81 void mousePressEvent(QMouseEvent *e) override;
82 void mouseReleaseEvent(QMouseEvent *e) override;
83 void mouseMoveEvent(QMouseEvent *e) override;
84 void mouseDoubleClickEvent(QMouseEvent *e) override;
87 QScopedPointer<
class QtGradientWidgetPrivate> d_ptr;
88 Q_DECLARE_PRIVATE(QtGradientWidget)
89 Q_DISABLE_COPY_MOVE(QtGradientWidget)