Walls And Holes  1
colorpickerbutton.h
Go to the documentation of this file.
1 #ifndef COLORPICKERBUTTON_H
2 #define COLORPICKERBUTTON_H
3 
4 #include <QPushButton>
5 
6 class ColorPickerButton : public QPushButton
7 {
8  Q_OBJECT
9 
10 public:
11  ColorPickerButton(QColor color = Qt::black, QWidget *parent = nullptr);
12 
13  QColor currentColor() const { return mColor; }
14 
15 signals:
16  void colorPicked(QColor color);
17 
18 public slots:
25  void colorChanged(QColor color);
26 
27 private slots:
28  void clicked();
29 
30 private:
31  //sets the buttons icon to mColor
32  void setColor();
33 
34  QColor mColor;
35 };
36 
37 #endif // COLORPICKERBUTTON_H
ColorPickerButton(QColor color=Qt::black, QWidget *parent=nullptr)
Definition: colorpickerbutton.cpp:6
void colorChanged(QColor color)
colorChanged When the color this button represents changes by means other than the button...
Definition: colorpickerbutton.cpp:17
void colorPicked(QColor color)
Definition: colorpickerbutton.h:6
QColor currentColor() const
Definition: colorpickerbutton.h:13