-
Notifications
You must be signed in to change notification settings - Fork 6
/
QVectorEdit.h
93 lines (90 loc) · 2.27 KB
/
QVectorEdit.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef QVECTOREDIT_H
#define QVECTOREDIT_H
#include <QWidget>
#include <QVector3D>
#include "GeneratedFiles/ui_QVectorEdit.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 SIMUL_QT_WIDGETS_EXPORT QVectorEdit : public QWidget
{
Q_OBJECT
Q_PROPERTY(QString title READ title WRITE setTitle DESIGNABLE true)
Q_PROPERTY(bool colourEdit READ colourEdit WRITE setColourEdit DESIGNABLE true)
Q_PROPERTY(bool liveUpdate READ liveUpdate WRITE setLiveUpdate DESIGNABLE true)
Q_PROPERTY(int labelWidth READ labelWidth WRITE setLabelWidth DESIGNABLE true)
Q_PROPERTY(int textWidth READ textWidth WRITE setTextWidth DESIGNABLE true)
Q_PROPERTY(QString units READ units WRITE setUnits DESIGNABLE true)
Q_PROPERTY(int unitsWidth READ unitsWidth WRITE setUnitsWidth DESIGNABLE true)
Q_PROPERTY(QVector3D value READ value WRITE setValue DESIGNABLE true)
public:
QVectorEdit(QWidget *parent = 0);
~QVectorEdit();
QVector3D value() const;
void setValue(QVector3D f);
void setValue(QVector3D f,bool single_valued);
void setDefaultValue(QVector3D f)
{
defaultValue_ = f;
setShowDefaultButton();
}
QVector3D defaultValue() const
{
return defaultValue_;
}
void setTitle(QString f);
QString title() const;
void setUnits(QString f);
QString units() const;
void setLiveUpdate(bool l);
bool liveUpdate() const;
void setColourEdit(bool l);
bool colourEdit() const;
int labelWidth() const
{
return labelWidth_;
}
void setLabelWidth(int w);
int textWidth() const
{
return textWidth_;
}
void setTextWidth(int w);
int unitsWidth() const
{
return unitsWidth_;
}
void setUnitsWidth(int w);
signals:
void valueChanged();
public slots:
void on_reset_clicked();
void on_x_editingFinished();
void on_y_editingFinished();
void on_z_editingFinished();
protected:
Ui::QVectorEdit ui;
bool colourEdit_;
int labelWidth_;
int textWidth_;
int unitsWidth_;
bool liveUpdate_;
QVector3D value_;
QVector3D defaultValue_;
void setShowDefaultButton();
};
#endif // QVECTOREDIT_H