cut 3.4.3
Loading...
Searching...
No Matches
QeColorLabel.hpp
1#ifndef QECOLORLABEL_HPP
2#define QECOLORLABEL_HPP
3
4#include <QLabel>
5#include <QColor>
6
10class QeColorLabel : public QLabel{
11 Q_OBJECT
12
16 Q_PROPERTY(QColor color READ GetColor WRITE SetColor NOTIFY ColorChanged RESET ColorReset)
17
18
21 Q_PROPERTY(bool showCodes READ ShowsCodes WRITE SetShowCodes NOTIFY ShowCodesChanged RESET ResetShowCodes)
22
23public:
24 QeColorLabel(QWidget* parent = nullptr);
25
26 QColor GetColor() const;
27 void ColorReset();
28 bool ShowsCodes() const;
29 void ResetShowCodes();
30
31public slots:
32 void SetColor(const QColor &newColor);
33 void SetShowCodes(bool newShowCodes);
34
35signals:
36 void ColorChanged(QColor);
37 void ShowCodesChanged(bool);
38
39protected:
40 QSize sizeHint();
41
42private:
43 QColor m_color;
44 bool m_showCodes;
45};
46
47#endif // QECOLORLABEL_HPP
bool showCodes
Enables or disables showing the hexadecimal and 8-bit RGB representation.
Definition QeColorLabel.hpp:21
QColor color
The color to be shown as a property.
Definition QeColorLabel.hpp:16