41 Q_FLAGS(ColorDialogOption ColorDialogOptions)
45 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged USER true)
50 Q_PROPERTY(QString colorName READ colorName WRITE setColorName NOTIFY colorNameChanged)
55 Q_PROPERTY(
bool displayColorName READ displayColorName WRITE setDisplayColorName DESIGNABLE true)
58 Q_PROPERTY(ColorDialogOptions dialogOptions READ dialogOptions WRITE setDialogOptions)
60 enum ColorDialogOption {
61 ShowAlphaChannel = 0x00000001,
62 NoButtons = 0x00000002,
63 DontUseNativeDialog = 0x00000004,
64 UseColorDialog = 0x0000000C
66 Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
79 explicit ColorPickerButton(
const QColor& color,
const QString & text, QWidget* parent = 0 );
90 QString colorName()
const;
95 void setColorName(
const QString& name);
99 bool displayColorName()
const;
104 void setDialogOptions(
const ColorDialogOptions& options);
105 const ColorDialogOptions& dialogOptions()
const;
110 virtual QSize sizeHint()
const;
115 void setColor(
const QColor& color);
126 void setDisplayColorName(
bool displayColorName);
137 void onToggled(
bool change =
true);
140 virtual void paintEvent(QPaintEvent* event);
142 QScopedPointer<ColorPickerButtonPrivate> d_ptr;