<QtMinMax>

값을 하한 및/또는 상한으로 제한하는 함수. 더 보기...

Header: #include <QtMinMax>

함수

const T &qBound(const T &min, const T &val, const T &max)
const T &qMax(const T &a, const T &b)
const T &qMin(const T &a, const T &b)

상세 설명

함수 문서

[constexpr] template <typename T> const T &qBound(const T &min, const T &val, const T &max)

min 와 max 사이의 범위에서 val 을 반환합니다.

예:

int myValue = 10;
int minValue = 2;
int maxValue = 6;

int boundedValue = qBound(minValue, myValue, maxValue);
// boundedValue == 6

qMin() 및 qMax()도 참조하십시오 .

[constexpr] template <typename T> const T &qMax(const T &a, const T &b)

a 와 b 중에서 더 큰 값을 반환합니다.

예시:

int myValue = 6;
int yourValue = 4;

int maxValue = qMax(myValue, yourValue);
// maxValue == myValue

qMin() 및 qBound()도 참조하십시오 .

[constexpr] template <typename T> const T &qMin(const T &a, const T &b)

a 와 b 중 더 작은 값을 반환합니다.

예시:

int myValue = 6;
int yourValue = 4;

int minValue = qMin(myValue, yourValue);
// minValue == yourValue

qMax() 및 qBound()도 참조하십시오 .

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.