-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathCColorProperty.h
50 lines (35 loc) · 1.24 KB
/
CColorProperty.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef CCOLORPROPERTY_H
#define CCOLORPROPERTY_H
#include "CBaseProperty.h"
#include "CButtonBasedEditor.h"
#include "QColorComboBox.h"
class CColorProperty : public CBaseProperty
{
public:
CColorProperty(const QByteArray& id, const QString &name, const QColor& color);
CColorProperty(CBaseProperty *top, const QByteArray& id, const QString &name, const QColor& color);
void setColor(const QColor& color);
const QColor& getColor() const;
void setColorsList(const QStringList& colorNames);
void allowListColorsOnly(bool on);
// reimp
virtual QVariant getVariantValue() const;
virtual void validateValue();
virtual void displayValue();
virtual QWidget* createEditor() const;
virtual void valueToEditor();
virtual void valueFromEditor();
protected:
class CColorButtonEditor : public TButtonBasedEditor<QColorComboBox>
{
public:
CColorButtonEditor(QColorComboBox* colorComboEditor, CColorProperty* property);
protected:
virtual void onEditButtonActivated();
CColorProperty* m_property;
};
mutable QColor m_color;
mutable QColorComboBox m_colorEditor;
bool m_listColorsOnly;
};
#endif // CCOLORPROPERTY_H