QCAD Application Framework
CAD Application Development and Automation.
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
RMathLineEdit.h
Go to the documentation of this file.
1
#ifndef RMATHLINEEDIT_H_
2
#define RMATHLINEEDIT_H_
3
4
#include <QMetaType>
5
#include <QLineEdit>
6
#include <QtDesigner/QDesignerExportWidget>
7
8
#include "
RMath.h
"
9
13
class
/*QDESIGNER_WIDGET_EXPORT*/
RMathLineEdit
:
public
QLineEdit {
14
15
Q_OBJECT
16
Q_PROPERTY(
bool
angle
READ
isAngle
WRITE
setAngle
);
17
//Q_PROPERTY(double defaultValue READ getDefaultValue WRITE setDefaultValue);
18
//Q_PROPERTY(int defaultUnit READ getDefaultUnit WRITE setDefaultUnit);
19
//Q_PROPERTY(RS::Unit defaultUnit READ getDefaultUnit WRITE setDefaultUnit);
20
//Q_ENUMS(RS::Unit);
21
22
public
:
23
RMathLineEdit
(QWidget* parent);
24
25
bool
isAngle
()
const
{
26
return
angle
;
27
}
28
void
setAngle
(
bool
on) {
29
angle
= on;
30
}
31
bool
isInteger
()
const
{
32
return
integer
;
33
}
34
void
setInteger
(
bool
on) {
35
integer
= on;
36
}
37
38
void
setValue
(
double
v,
int
precision=6);
39
double
getValue
();
40
QString
getError
();
41
void
clearError
();
42
43
bool
isValid
() {
44
return
!
RMath::isNaN
(
value
);
45
}
46
47
void
setToolTip
(
const
QString& toolTip);
48
49
/*
50
double getDefaultValue() {
51
return defaultValue;
52
}
53
void setDefaultValue(double v) {
54
defaultValue = v;
55
}
56
*/
57
58
//void setDefaultUnit(int defaultUnit);
59
//int getDefaultUnit();
60
61
protected
:
62
virtual
void
keyPressEvent
(QKeyEvent* event);
63
virtual
void
keyReleaseEvent
(QKeyEvent* event);
64
65
public
slots:
66
void
slotTextChanged
(
const
QString& text);
67
68
signals:
69
void
valueChanged
(
double
value
,
const
QString&
error
);
70
71
private
:
72
QPalette
oriPalette
;
73
bool
angle
;
74
bool
integer
;
75
double
value
;
76
//RS::Unit defaultUnit;
77
QString
error
;
78
QString
originalToolTip
;
79
//double defaultValue;
80
};
81
82
Q_DECLARE_METATYPE
(
RMathLineEdit
*)
83
84
#endif
src
gui
RMathLineEdit.h
Generated on Tue Jun 26 2012 18:41:08 for QCAD Application Framework by
1.8.1.1