1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QTGRADIENTEDITOR_H
5#define QTGRADIENTEDITOR_H
6
7#include <QtWidgets/QWidget>
8
9QT_BEGIN_NAMESPACE
10
11class QtGradientEditor : public QWidget
12{
13 Q_OBJECT
14 Q_PROPERTY(QGradient gradient READ gradient WRITE setGradient)
15 Q_PROPERTY(bool backgroundCheckered READ isBackgroundCheckered WRITE setBackgroundCheckered)
16 Q_PROPERTY(bool detailsVisible READ detailsVisible WRITE setDetailsVisible)
17 Q_PROPERTY(bool detailsButtonVisible READ isDetailsButtonVisible WRITE setDetailsButtonVisible)
18public:
19 QtGradientEditor(QWidget *parent = 0);
20 ~QtGradientEditor();
21
22 void setGradient(const QGradient &gradient);
23 QGradient gradient() const;
24
25 bool isBackgroundCheckered() const;
26 void setBackgroundCheckered(bool checkered);
27
28 bool detailsVisible() const;
29 void setDetailsVisible(bool visible);
30
31 bool isDetailsButtonVisible() const;
32 void setDetailsButtonVisible(bool visible);
33
34 QColor::Spec spec() const;
35 void setSpec(QColor::Spec spec);
36
37signals:
38 void gradientChanged(const QGradient &gradient);
39 void aboutToShowDetails(bool details, int extenstionWidthHint);
40
41private:
42 QScopedPointer<class QtGradientEditorPrivate> d_ptr;
43 Q_DECLARE_PRIVATE(QtGradientEditor)
44 Q_DISABLE_COPY_MOVE(QtGradientEditor)
45};
46
47QT_END_NAMESPACE
48
49#endif
50

source code of qttools/src/shared/qtgradienteditor/qtgradienteditor.h