Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qminmax.h
Go to the documentation of this file.
1
// Copyright (C) 2022 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QMINMAX_H
6
#
define
QMINMAX_H
7
8
#
if
0
9
#
pragma
qt_class
(
QtMinMax
)
10
#
pragma
qt_sync_stop_processing
11
#
endif
12
13
#
include
<
QtCore
/
qassert
.
h
>
14
#
include
<
QtCore
/
qtconfigmacros
.
h
>
15
#
include
<
QtCore
/
qttypetraits
.
h
>
16
17
QT_BEGIN_NAMESPACE
18
19
template
<
typename
T>
20
constexpr
inline
const
T &qMin(
const
T &a,
const
T &b) {
return
(a < b) ? a : b; }
21
template
<
typename
T>
22
constexpr
inline
const
T &
qMax
(
const
T &a,
const
T &b) {
return
(a < b) ? b : a; }
23
template
<
typename
T>
24
constexpr
inline
const
T &
qBound
(
const
T &min,
const
T &val,
const
T &max)
25
{
26
Q_ASSERT(!(max < min));
27
return
qMax(min, qMin(max, val));
28
}
29
template
<
typename
T,
typename
U>
30
constexpr
inline
QTypeTraits
::
Promoted
<
T
,
U
>
qMin
(
const
T &a,
const
U &b)
31
{
32
using
P = QTypeTraits::Promoted<T, U>;
33
P _a = a;
34
P _b = b;
35
return
(_a < _b) ? _a : _b;
36
}
37
template
<
typename
T,
typename
U>
38
constexpr
inline
QTypeTraits
::
Promoted
<
T
,
U
>
qMax
(
const
T &a,
const
U &b)
39
{
40
using
P = QTypeTraits::Promoted<T, U>;
41
P _a = a;
42
P _b = b;
43
return
(_a < _b) ? _b : _a;
44
}
45
template
<
typename
T,
typename
U>
46
constexpr
inline
QTypeTraits
::
Promoted
<
T
,
U
>
qBound
(
const
T &min,
const
U &val,
const
T &max)
47
{
48
Q_ASSERT(!(max < min));
49
return
qMax(min, qMin(max, val));
50
}
51
template
<
typename
T,
typename
U>
52
constexpr
inline
QTypeTraits
::
Promoted
<
T
,
U
>
qBound
(
const
T &min,
const
T &val,
const
U &max)
53
{
54
using
P = QTypeTraits::Promoted<T, U>;
55
Q_ASSERT(!(P(max) < P(min)));
56
return
qMax(min, qMin(max, val));
57
}
58
template
<
typename
T,
typename
U>
59
constexpr
inline
QTypeTraits
::
Promoted
<
T
,
U
>
qBound
(
const
U &min,
const
T &val,
const
T &max)
60
{
61
using
P = QTypeTraits::Promoted<T, U>;
62
Q_ASSERT(!(P(max) < P(min)));
63
return
qMax(min, qMin(max, val));
64
}
65
66
QT_END_NAMESPACE
67
68
#
endif
// QMINMAX_H
QX11SurfaceCapture::Grabber
Definition
qx11surfacecapture.cpp:89
QX11SurfaceCapture::Grabber::create
static std::unique_ptr< Grabber > create(QX11SurfaceCapture &capture, QScreen *screen)
Definition
qx11surfacecapture.cpp:91
QX11SurfaceCapture::Grabber::format
const QVideoFrameFormat & format() const
Definition
qx11surfacecapture.cpp:110
QX11SurfaceCapture::Grabber::grabFrame
QVideoFrame grabFrame() override
Definition
qx11surfacecapture.cpp:302
QX11SurfaceCapture::Grabber::create
static std::unique_ptr< Grabber > create(QX11SurfaceCapture &capture, WId wid)
Definition
qx11surfacecapture.cpp:97
QX11SurfaceCapture::Grabber::~Grabber
~Grabber() override
Definition
qx11surfacecapture.cpp:103
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qCDebug
#define qCDebug(category,...)
Definition
qloggingcategory.h:162
Q_STATIC_LOGGING_CATEGORY
#define Q_STATIC_LOGGING_CATEGORY(name,...)
Definition
qloggingcategory.h:154
qMin
constexpr QTypeTraits::Promoted< T, U > qMin(const T &a, const U &b)
Definition
qminmax.h:30
qBound
constexpr QTypeTraits::Promoted< T, U > qBound(const T &min, const T &val, const U &max)
Definition
qminmax.h:52
qBound
constexpr QTypeTraits::Promoted< T, U > qBound(const T &min, const U &val, const T &max)
Definition
qminmax.h:46
qBound
constexpr QTypeTraits::Promoted< T, U > qBound(const U &min, const T &val, const T &max)
Definition
qminmax.h:59
qBound
constexpr const T & qBound(const T &min, const T &val, const T &max)
Definition
qminmax.h:24
qMax
constexpr const T & qMax(const T &a, const T &b)
Definition
qminmax.h:22
qMax
constexpr QTypeTraits::Promoted< T, U > qMax(const T &a, const U &b)
Definition
qminmax.h:38
qtbase
src
corelib
global
qminmax.h
Generated on
for Qt by
1.18.0