Warning, file /include/QtWidgets/qcolordialog.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QCOLORDIALOG_H
0005 #define QCOLORDIALOG_H
0006
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008
0009 #include <QtWidgets/qdialog.h>
0010
0011 QT_REQUIRE_CONFIG(colordialog);
0012
0013 QT_BEGIN_NAMESPACE
0014
0015 class QColorDialogPrivate;
0016
0017 class Q_WIDGETS_EXPORT QColorDialog : public QDialog
0018 {
0019 Q_OBJECT
0020 Q_DECLARE_PRIVATE(QColorDialog)
0021 Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor
0022 NOTIFY currentColorChanged)
0023 Q_PROPERTY(ColorDialogOptions options READ options WRITE setOptions)
0024
0025 public:
0026 enum ColorDialogOption {
0027 ShowAlphaChannel = 0x00000001,
0028 NoButtons = 0x00000002,
0029 DontUseNativeDialog = 0x00000004,
0030 NoEyeDropperButton = 0x00000008,
0031 };
0032 Q_ENUM(ColorDialogOption)
0033
0034 Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
0035
0036 explicit QColorDialog(QWidget *parent = nullptr);
0037 explicit QColorDialog(const QColor &initial, QWidget *parent = nullptr);
0038 ~QColorDialog();
0039
0040 void setCurrentColor(const QColor &color);
0041 QColor currentColor() const;
0042
0043 QColor selectedColor() const;
0044
0045 void setOption(ColorDialogOption option, bool on = true);
0046 bool testOption(ColorDialogOption option) const;
0047 void setOptions(ColorDialogOptions options);
0048 ColorDialogOptions options() const;
0049
0050 using QDialog::open;
0051 void open(QObject *receiver, const char *member);
0052
0053 void setVisible(bool visible) override;
0054
0055 static QColor getColor(const QColor &initial = Qt::white,
0056 QWidget *parent = nullptr,
0057 const QString &title = QString(),
0058 ColorDialogOptions options = ColorDialogOptions());
0059
0060 static int customCount();
0061 static QColor customColor(int index);
0062 static void setCustomColor(int index, QColor color);
0063 static QColor standardColor(int index);
0064 static void setStandardColor(int index, QColor color);
0065
0066 Q_SIGNALS:
0067 void currentColorChanged(const QColor &color);
0068 void colorSelected(const QColor &color);
0069
0070 protected:
0071 void changeEvent(QEvent *event) override;
0072 void done(int result) override;
0073
0074 private:
0075 Q_DISABLE_COPY(QColorDialog)
0076 };
0077
0078 Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions)
0079
0080 QT_END_NAMESPACE
0081
0082 #endif