widgets/colorbutton.h

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

mercurial