I. Function Documentation▲
I-1. [constexpr] const T &qBound(const T &min, const T &val, const T &max)▲
Returns val bounded by min and max. This is equivalent to qMax(min, qMin(val, max)).
Example:
Sélectionnez
int
myValue =
10
;
int
minValue =
2
;
int
maxValue =
6
;
int
boundedValue =
qBound(minValue, myValue, maxValue);
// boundedValue == 6
I-1-1. See Also▲
I-2. [constexpr] const T &qMax(const T &a, const T &b)▲
Returns the maximum of a and b.
Example:
Sélectionnez
int
myValue =
6
;
int
yourValue =
4
;
int
maxValue =
qMax(myValue, yourValue);
// maxValue == myValue