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 QTGRADIENTDIALOG_H
5#define QTGRADIENTDIALOG_H
6
7#include <QtWidgets/QDialog>
8
9QT_BEGIN_NAMESPACE
10
11class QtGradientDialog : public QDialog
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 QtGradientDialog(QWidget *parent = 0);
20 ~QtGradientDialog();
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
37 static QGradient getGradient(bool *ok, const QGradient &initial, QWidget *parent = 0, const QString &caption = QString());
38 static QGradient getGradient(bool *ok, QWidget *parent = 0, const QString &caption = QString());
39
40private:
41 QScopedPointer<class QtGradientDialogPrivate> d_ptr;
42 Q_DECLARE_PRIVATE(QtGradientDialog)
43 Q_DISABLE_COPY_MOVE(QtGradientDialog)
44};
45
46QT_END_NAMESPACE
47
48#endif
49

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