72 explicit length(QString lstring,
bool *ok=0) {
73 bool myOk =
set(lstring);
101 bool set(QString lstring);
107 return (_length <= 0);
114 operator QString()
const {
115 return QString(
"%1mm").arg(
get(
mm));
126 return _length == other._length;
138 result._length = _length + rhs._length;
151 result._length = _length - rhs._length;
164 result._length = _length/div;
174 Q_DECLARE_METATYPE(
length)
The length stores a length and converts between units.
length()
Constructs a zero length.
const length operator-(const length rhs) const
Difference of two lengths.
void set(qreal l, unit u)
Sets length.
unit
List of supported units.
qreal get(unit u) const
Returns length in given unit.
bool set(QString lstring)
Constructs length from a string.
const length operator+(const length rhs) const
Sum of the lengths.
bool isNonPositive() const
Check if length is positive.
const length operator/(const qreal div) const
Divide a length by a number.
bool operator==(const length other) const
Checks for equality.
length(qreal l, unit u)
Constructs length of given value and unit.
length(QString lstring, bool *ok=0)
Constructs length from a string.