72 explicit length(QString lstring,
bool *ok=0) {
73 bool myOk =
set(lstring);
84 qreal
get(
unit u)
const;
92 void set(qreal l,
unit u);
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)
bool operator==(const length &other) const
Checks for equality.
const length operator-(const length &rhs) const
Difference of two lengths.
bool isNonPositive() const
Check if length is positive.
unit
List of supported units.
length(qreal l, unit u)
Constructs length of given value and unit.
The length stores a length and converts between units.
const length operator+(const length &rhs) const
Sum of the lengths.
length(QString lstring, bool *ok=0)
Constructs length from a string.
const length operator/(const qreal div) const
Divide a length by a number.
length()
Constructs a zero length.