-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathQLabelEdit.h
More file actions
69 lines (61 loc) · 1.7 KB
/
QLabelEdit.h
File metadata and controls
69 lines (61 loc) · 1.7 KB
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
#ifndef QLABELEDIT_H
#define QLABELEDIT_H
#include <QWidget>
#include "GeneratedFiles/ui_QLabelEdit.h"
#include "Export.h"
class SIMUL_QT_WIDGETS_EXPORT QLabelEdit : public QWidget
{
Q_OBJECT
Q_PROPERTY(bool showDefaultButton READ showDefaultButton WRITE setShowDefaultButton DESIGNABLE true)
Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly DESIGNABLE true)
Q_PROPERTY(QString value READ value WRITE setValue DESIGNABLE true)
Q_PROPERTY(QString defaultValue READ defaultValue WRITE setDefaultValue DESIGNABLE true)
Q_PROPERTY(QString title READ title WRITE setTitle DESIGNABLE true)
Q_PROPERTY(int labelWidth READ labelWidth WRITE setLabelWidth DESIGNABLE true)
Q_PROPERTY(QString units READ units WRITE setUnits DESIGNABLE true)
Q_PROPERTY(int unitsWidth READ unitsWidth WRITE setUnitsWidth DESIGNABLE true)
public:
QLabelEdit(QWidget *parent = 0);
~QLabelEdit();
void setShowDefaultButton(bool l);
bool showDefaultButton() const;
void setReadOnly(bool l);
bool readOnly() const;
void setValue(QString f);
QString value() const;
int labelWidth() const
{
return labelWidth_;
}
void setLabelWidth(int w);
int unitsWidth() const
{
return unitsWidth_;
}
void setUnitsWidth(int w);
void setDefaultValue(QString f)
{
defaultValue_ = f;
setShowDefaultButton(true);
}
QString defaultValue() const
{
return defaultValue_;
}
void setTitle(QString f);
QString title() const;
void setUnits(QString f);
QString units() const;
public slots:
void on_lineEdit_editingFinished();
void on_reset_clicked();
signals:
void valueChanged();
private:
Ui::QLabelEdit ui;
int labelWidth_;
int unitsWidth_;
QString value_,defaultValue_;
bool showDefaultButton_;
};
#endif // QLABELEDIT_H