8#include <QtWidgets/qtwidgetsglobal.h>
10#include <QtWidgets/qdialog.h>
16class QColorDialogPrivate;
21 Q_DECLARE_PRIVATE(QColorDialog)
22 Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor
23 NOTIFY currentColorChanged)
24 Q_PROPERTY(ColorDialogOptions options READ options WRITE setOptions)
27 enum ColorDialogOption {
28 ShowAlphaChannel = 0x00000001,
29 NoButtons = 0x00000002,
30 DontUseNativeDialog = 0x00000004,
31 NoEyeDropperButton = 0x00000008,
33 Q_ENUM(ColorDialogOption)
35 Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
37 explicit QColorDialog(QWidget *parent =
nullptr);
38 explicit QColorDialog(
const QColor &initial, QWidget *parent =
nullptr);
41 void setCurrentColor(
const QColor &color);
42 QColor currentColor()
const;
44 QColor selectedColor()
const;
46 void setOption(ColorDialogOption option,
bool on =
true);
47 bool testOption(ColorDialogOption option)
const;
48 void setOptions(ColorDialogOptions options);
49 ColorDialogOptions options()
const;
52 void open(QObject *receiver,
const char *member);
54 void setVisible(
bool visible) override;
56 static QColor getColor(
const QColor &initial = Qt::white,
57 QWidget *parent =
nullptr,
58 const QString &title = QString(),
59 ColorDialogOptions options = ColorDialogOptions());
61 static int customCount();
62 static QColor customColor(
int index);
63 static void setCustomColor(
int index, QColor color);
64 static QColor standardColor(
int index);
65 static void setStandardColor(
int index, QColor color);
68 void currentColorChanged(
const QColor &color);
69 void colorSelected(
const QColor &color);
72 void changeEvent(QEvent *event) override;
73 void done(
int result) override;
76 Q_DISABLE_COPY(QColorDialog)
79Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions)
void releaseColorPicking()
QColor grabScreenColor(const QPoint &p)
bool selectColor(const QColor &color)
void init(const QColor &initial)
void setCurrentAlpha(int a)
QColorPickingEventFilter * colorPickingEventFilter
bool handleColorPickingMouseButtonRelease(QMouseEvent *e)
QColor currentQColor() const
void updateColorPicking()
bool handleColorPickingMouseMove(QMouseEvent *e)
QLabel * lblScreenColorInfo
void _q_setCustom(int index, QRgb color)
QPushButton * eyeDropperButton
void updateColorLabelText(const QPoint &)
void setCurrentColor(const QColor &color, SetColorMode setColorMode=SetColorAll)
bool isAlphaVisible() const
void setCurrentQColor(const QColor &color)
bool canBeNativeDialog() const override
void setCurrentRgbColor(QRgb rgb)
void retranslateStrings()
QRgb currentColor() const
void newColorTypedIn(QRgb rgb)
bool handleColorPickingKeyPress(QKeyEvent *e)
void updateColorPicking(const QPoint &pos)
QSharedPointer< QColorDialogOptions > options
void newStandard(int, int)
void setVisible(bool visible) override
QDialogButtonBox * buttons
bool supportsColorPicking() const
QPointer< QObject > receiverToDisconnectOnClose
QRgb beforeScreenColorPicking
virtual void initHelper(QPlatformDialogHelper *h) override
QByteArray memberToDisconnectOnClose
void newHsv(int h, int s, int v)
virtual void helperPrepareShow(QPlatformDialogHelper *h) override
QColorLuminancePicker * lp
QPlatformColorDialogHelper * platformColorDialogHelper() const
void nextCustom(int, int)
The QColorDialog class provides a dialog widget for specifying colors.
\inmodule QtCore\reentrant
\variable QStyleOption::palette
\variable QStyleOptionFocusRect::backgroundColor
QColSpinBox(QWidget *parent)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void setCol(int h, int s)
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
QSize sizeHint() const override
void setCrossVisible(bool visible)
void resizeEvent(QResizeEvent *) override
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
bool eventFilter(QObject *, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void applicationStateChanged(Qt::ApplicationState state)
QColorPickingEventFilter(QColorDialogPrivate *dp, QObject *parent)
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
QColor currentQColor() const
void setCurrentAlpha(int a)
bool isAlphaVisible() const
void setHsv(int h, int s, int v)
void retranslateStrings()
QRgb currentColor() const
void currentColorChanged(const QColor &color)
QColorWell(QWidget *parent, int r, int c, const QRgb *vals)
void paintCellContents(QPainter *, int row, int col, const QRect &) override
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
friend class QT_PREPEND_NAMESPACE(QUntypedBindable)
void mouseReleaseEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void focusOutEvent(QFocusEvent *) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) f...
void currentChanged(int row, int col)
int columnAt(int x) const
void updateCell(int row, int column)
void colorChanged(int index, QRgb color)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void focusInEvent(QFocusEvent *) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
virtual void setCurrent(int row, int col)
virtual void setSelected(int row, int col)
QRect cellGeometry(int row, int column)
virtual void paintCell(QPainter *, int row, int col, const QRect &)
int columnX(int column) const
QSize sizeHint() const override
virtual void paintCellContents(QPainter *, int row, int col, const QRect &)
int selectedColumn() const
void keyPressEvent(QKeyEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
QString cellContent(int row, int col) const
QtPrivate::QColorShower QColorShower
static void rgb2hsv(QRgb rgb, int &h, int &s, int &v)
QtPrivate::QColorWell QColorWell
QtPrivate::QWellArray QWellArray
QtPrivate::QColorPickingEventFilter QColorPickingEventFilter
QtPrivate::QColorLuminancePicker QColorLuminancePicker
QtPrivate::QColorPicker QColorPicker
static const Qt::WindowFlags qcd_DefaultWindowFlags
QT_REQUIRE_CONFIG(colordialog)