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
Display an analog widget that allows the selection of a HSV color.
Definition: color_wheel.hpp:35
void on_buttonBox_clicked(QAbstractButton *)
void setColor(const QColor &c)
ButtonMode buttonMode() const
ColorDialog(QWidget *parent=0, Qt::WindowFlags f=0)
void setWheelFlags(ColorWheel::DisplayFlags flags)
void setPreviewDisplayMode(ColorPreview::DisplayMode mode)
void alphaEnabledChanged(bool alphaEnabled)
void setColorInternal(const QColor &color)
void mouseReleaseEvent(QMouseEvent *event)
void setButtonMode(ButtonMode mode)
void dropEvent(QDropEvent *event)
void update_widgets()
Update all the Ui elements to match the selected color.
void set_hsv()
Update from HSV sliders.
void set_rgb()
Update from RGB sliders.
void wheelFlagsChanged(ColorWheel::DisplayFlags flags)
void showColor(const QColor &oldcolor)
ColorWheel::DisplayFlags wheelFlags() const
void dragEnterEvent(QDragEnterEvent *event)
void mouseMoveEvent(QMouseEvent *event)
ColorPreview::DisplayMode previewDisplayMode() const


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17