widgets/colorbutton.h

changeset 347
5c655cc006de
parent 344
a24da8de2a3b
equal deleted inserted replaced
346:3e3784c4cd3e 347:5c655cc006de
3 #include <QLineEdit> 3 #include <QLineEdit>
4 4
5 /** 5 /**
6 * @brief A button that can be used to select a color 6 * @brief A button that can be used to select a color
7 */ 7 */
8 class ColorButton : public QWidget 8 class ColorEdit : public QWidget
9 { 9 {
10 Q_OBJECT 10 Q_OBJECT
11 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) 11 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
12 QLineEdit* lineEdit; 12 QLineEdit* lineEdit;
13 QPushButton* button; 13 QPushButton* button;
14 public: 14 public:
15 ColorButton(const QColor& color = {}, QWidget* parent = nullptr); 15 ColorEdit(const QColor& color = {}, QWidget* parent = nullptr);
16 ColorButton(QWidget* parent = nullptr); 16 ColorEdit(QWidget* parent = nullptr);
17 QColor color() const; 17 QColor color() const;
18 Q_SLOT void setColor(const QColor& color); 18 Q_SLOT void setColor(const QColor& color);
19 Q_SIGNAL void colorChanged(const QColor& color); 19 Q_SIGNAL void colorChanged(const QColor& color);
20 }; 20 };

mercurial