Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qminmax.qdoc
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \headerfile <QtMinMax>
6 \inmodule QtCore
7 \ingroup funclists
8 \brief Functions for limiting a value to lower and/or upper bounds.
9*/
10
11/*! \fn template <typename T> const T &qMin(const T &a, const T &b)
12 \relates <QtMinMax>
13
14 Returns the minimum of \a a and \a b.
15
16 Example:
17
18 \snippet code/src_corelib_global_qglobal.cpp 13
19
20 \sa qMax(), qBound()
21*/
22
23/*! \fn template <typename T> const T &qMax(const T &a, const T &b)
24 \relates <QtMinMax>
25
26 Returns the maximum of \a a and \a b.
27
28 Example:
29
30 \snippet code/src_corelib_global_qglobal.cpp 14
31
32 \sa qMin(), qBound()
33*/
34
35/*! \fn template <typename T> const T &qBound(const T &min, const T &val, const T &max)
36 \relates <QtMinMax>
37
38 Returns \a val bounded by \a min and \a max.
39
40 Example:
41
42 \snippet code/src_corelib_global_qglobal.cpp 15
43
44 \sa qMin(), qMax()
45*/