-
Notifications
You must be signed in to change notification settings - Fork 6
/
QColourEdit.h
55 lines (51 loc) · 1.32 KB
/
QColourEdit.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
51
52
53
54
55
#ifndef QCOLOUREDIT_H
#define QCOLOUREDIT_H
#include <QWidget>
#include "../SimulQtWidgets/GeneratedFiles/ui_QColourEdit.h"
#ifndef _LIB
#if defined(SIMUL_QT_WIDGETS)
#define SIMUL_QT_WIDGETS_EXPORT Q_DECL_EXPORT
#else
#define SIMUL_QT_WIDGETS_EXPORT Q_DECL_IMPORT
#endif
#else
#define SIMUL_QT_WIDGETS_EXPORT
#endif
#if defined(SIMUL_QT_WIDGETS)
#else
#ifdef NDEBUG
#pragma comment(lib,"SimulQtWidgets_MD")
#else
#pragma comment(lib,"SimulQtWidgets_MDd")
#endif
#endif
class QColourEdit : public QWidget
{
Q_OBJECT
Q_PROPERTY(QString label READ label WRITE setLabel DESIGNABLE true)
Q_PROPERTY(int labelWidth READ labelWidth WRITE setLabelWidth DESIGNABLE true)
Q_PROPERTY(bool showAlpha READ showAlpha WRITE setShowAlpha DESIGNABLE true)
public:
QColourEdit(QWidget *parent = 0);
~QColourEdit();
void setLabel(QString f);
QString label() const;
int labelWidth() const;
void setLabelWidth(int w);
bool showAlpha() const;
void setShowAlpha(bool w);
void setColour(const double *c);
void setColour(double r,double g,double b,double a=1.0);
signals:
void valueChanged();
public slots:
void on_red_editingFinished();
void on_green_editingFinished();
void on_blue_editingFinished();
void on_alpha_editingFinished();
private:
int labelWidth_;
Ui::QColourEdit ui;
double red,green,blue,alpha;
};
#endif // QCOLOUREDIT_H