78 qreal
get(
unit u)
const;
86 void set(qreal l,
unit u);
93 return (_resolution <= 0);
101 return qFuzzyIsNull(_resolution);
109 qreal ridpi =
get(
dpi);
116 operator QString()
const {
117 return QString(
"%1dpi").arg(
get(
dpi));
128 return _resolution == other._resolution;
187 return res1._resolution > res2._resolution ? res1 : res2;
The resolution class stores a resolution and converts between units.
resolution()
Constructs a zero resolution.
qreal get(unit u) const
Get numerical value for resolution.
bool isZero() const
Fuzzy check if resolution is zero.
qreal get(unit u) const
Returns length in given unit.
bool isValid() const
Check if resolution is valid.
static const int minResDPI
Minimal resolution handled by scantools.
static const int maxResDPI
Maximal resolution handled by scantools.
resolution operator/(qreal numerator, const length &denominator)
Divide a scalar by a length to obtain a resolution.
The length stores a length and converts between units.
friend resolution qMax(const resolution &res1, const resolution &res2)
Find the maximum of two resolutions.
resolution(qreal l, unit u)
Constructs resolution of given value and unit.
bool isNonPositive() const
Check if resolution is zero or less.
bool operator==(const resolution &other) const
Check for equality.
unit
List of supported units.
length operator/(qreal numerator, const resolution &denominator)
Divide a scalar ("number of dots") by a resolution to obtain a length.