Screen classification thresholds and utilities. More...
Functions | |
| AspectRatioClass | classify (qreal aspectRatio) |
| AspectRatioClass | classify (int width, int height) |
| QString | toString (AspectRatioClass cls) |
| AspectRatioClass | fromString (const QString &str) |
| qreal | aspectRatioForClass (AspectRatioClass cls, qreal fallback=16.0/9.0) |
| Representative aspect ratio for a class. | |
| bool | matches (AspectRatioClass layoutClass, AspectRatioClass screenClass) |
| Check if a layout's aspect ratio class matches the given screen class. | |
Variables | |
| constexpr qreal | PortraitMax = 1.0 |
| AR < 1.0 → portrait. | |
| constexpr qreal | UltrawideMin = 1.9 |
| AR ∈ [UltrawideMin, SuperUltrawideMin) → ultrawide. | |
| constexpr qreal | SuperUltrawideMin = 2.8 |
| AR >= 2.8 → super-ultrawide. | |
Screen classification thresholds and utilities.
Free helpers separated from the enum so consumers can pull just the enum without dragging the threshold constants into namespace pollution.
|
inline |
Representative aspect ratio for a class.
| cls | The aspect ratio class. |
| fallback | Value to return for AspectRatioClass::Any (default 16:9). |
|
inline |
|
inline |
|
inline |
|
inline |
Check if a layout's aspect ratio class matches the given screen class.
A layout with AspectRatioClass::Any matches every screen. Otherwise, exact match is required unless the layout specifies explicit min/max aspect ratio bounds (which take precedence at the layout consumer's level — this helper just does the class match).
|
inline |
|
constexpr |
AR < 1.0 → portrait.
|
constexpr |
AR >= 2.8 → super-ultrawide.
|
constexpr |
AR ∈ [UltrawideMin, SuperUltrawideMin) → ultrawide.