color_dialog.hpp
Go to the documentation of this file.
1 
22 #ifndef COLOR_DIALOG_HPP
23 #define COLOR_DIALOG_HPP
24 
25 #include "colorwidgets_global.hpp"
26 #include "color_preview.hpp"
27 #include "color_wheel.hpp"
28 
29 #include <QDialog>
30 
31 class QAbstractButton;
32 
33 namespace color_widgets {
34 
35 class ColorDialog : public QDialog
36 {
37  Q_OBJECT
38  Q_ENUMS(ButtonMode)
39  Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged DESIGNABLE true)
40  Q_PROPERTY(ColorWheel::DisplayFlags wheelFlags READ wheelFlags WRITE setWheelFlags NOTIFY wheelFlagsChanged)
41 
42 
43 public:
44  enum ButtonMode {
48  };
49 
50  explicit ColorDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
51 
55  QColor color() const;
56 
61 
66 
67  bool alphaEnabled() const;
68 
77  void setButtonMode(ButtonMode mode);
78  ButtonMode buttonMode() const;
79 
80  QSize sizeHint() const;
81 
82  ColorWheel::DisplayFlags wheelFlags() const;
83 
84 public slots:
85 
89  void setColor(const QColor &c);
90 
94  void showColor(const QColor &oldcolor);
95 
96  void setWheelFlags(ColorWheel::DisplayFlags flags);
97 
98 
99 signals:
103  void colorChanged(QColor);
104 
108  void colorSelected(QColor);
109 
110  void wheelFlagsChanged(ColorWheel::DisplayFlags flags);
112 
113 private slots:
115  void update_widgets();
117  void set_hsv();
119  void set_rgb();
120 
121  void on_buttonBox_clicked(QAbstractButton*);
122 
123 private:
124  void setColorInternal(const QColor &color);
125 
126 protected:
127  void dragEnterEvent(QDragEnterEvent *event);
128  void dropEvent(QDropEvent * event);
129  void mouseReleaseEvent(QMouseEvent *event);
130  void mouseMoveEvent(QMouseEvent *event);
131 
132 private:
133  class Private;
134  Private * const p;
135 };
136 
137 } // namespace color_widgets
138 
139 #endif // COLOR_DIALOG_HPP
color_widgets::ColorDialog::set_hsv
void set_hsv()
Update from HSV sliders.
color_widgets::ColorDialog::alphaEnabled
bool alphaEnabled() const
color
color
Definition: color.h:16
color_widgets::ColorDialog::Close
@ Close
Definition: color_dialog.hpp:47
color_widgets::ColorDialog::showColor
void showColor(const QColor &oldcolor)
color_widgets::ColorDialog::buttonMode
ButtonMode buttonMode() const
color_widgets::ColorDialog::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *event)
color_widgets::ColorDialog::setColorInternal
void setColorInternal(const QColor &color)
color_widgets::ColorDialog::setButtonMode
void setButtonMode(ButtonMode mode)
color_widgets::ColorDialog
Definition: color_dialog.hpp:35
color_widgets::ColorDialog::wheelFlagsChanged
void wheelFlagsChanged(ColorWheel::DisplayFlags flags)
color_preview.hpp
color_widgets::ColorDialog::previewDisplayMode
ColorPreview::DisplayMode previewDisplayMode() const
color_widgets::ColorDialog::setColor
void setColor(const QColor &c)
color_widgets::ColorDialog::dropEvent
void dropEvent(QDropEvent *event)
color_widgets::ColorDialog::set_rgb
void set_rgb()
Update from RGB sliders.
color_widgets::ColorDialog::ColorDialog
ColorDialog(QWidget *parent=0, Qt::WindowFlags f=0)
color_widgets::ColorDialog::wheelFlags
ColorWheel::DisplayFlags wheelFlags
Definition: color_dialog.hpp:40
color_widgets
Definition: color_dialog.hpp:33
color_widgets::ColorWheel
Display an analog widget that allows the selection of a HSV color.
Definition: color_wheel.hpp:35
color_wheel.hpp
color_widgets::ColorDialog::sizeHint
QSize sizeHint() const
color_widgets::ColorDialog::colorSelected
void colorSelected(QColor)
color_widgets::ColorDialog::OkCancel
@ OkCancel
Definition: color_dialog.hpp:45
color_widgets::ColorDialog::setWheelFlags
void setWheelFlags(ColorWheel::DisplayFlags flags)
color_widgets::ColorDialog::colorChanged
void colorChanged(QColor)
color_widgets::ColorDialog::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event)
color_widgets::ColorDialog::OkApplyCancel
@ OkApplyCancel
Definition: color_dialog.hpp:46
color_widgets::ColorDialog::alphaEnabledChanged
void alphaEnabledChanged(bool alphaEnabled)
color_widgets::ColorPreview::DisplayMode
DisplayMode
Definition: color_preview.hpp:42
color_widgets::ColorDialog::update_widgets
void update_widgets()
Update all the Ui elements to match the selected color.
color_widgets::ColorDialog::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *event)
color_widgets::ColorDialog::color
QColor color
Definition: color_dialog.hpp:39
color_widgets::ColorDialog::ButtonMode
ButtonMode
Definition: color_dialog.hpp:44
color_widgets::ColorDialog::setPreviewDisplayMode
void setPreviewDisplayMode(ColorPreview::DisplayMode mode)
color_widgets::ColorDialog::p
Private *const p
Definition: color_dialog.hpp:133
color_widgets::ColorDialog::on_buttonBox_clicked
void on_buttonBox_clicked(QAbstractButton *)


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:43