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
qquick3dutils_p.h
Go to the documentation of this file.
1
// Copyright (C) 2019 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
6
#
ifndef
QQUICK3DUTILS_P_H
7
#
define
QQUICK3DUTILS_P_H
8
9
//
10
// W A R N I N G
11
// -------------
12
//
13
// This file is not part of the Qt API. It exists purely as an
14
// implementation detail. This header file may change from version to
15
// version without notice, or even be removed.
16
//
17
// We mean it.
18
//
19
20
#
include
<
type_traits
>
21
22
#
include
<
QtCore
/
QtGlobal
>
23
#
include
<
private
/
qglobal_p
.
h
>
24
25
QT_BEGIN_NAMESPACE
26
27
template
<
typename
T,
typename
=
void
>
28
struct
hasFuzzyCompare : std::false_type {};
29
30
template
<
typename
T>
31
struct
hasFuzzyCompare
<
T
,
std
::
void_t
<
decltype
(
qFuzzyCompare
(
std
::
declval
<
T
&>(),
std
::
declval
<
T
&>()))>> :
std
::
true_type
{};
32
33
// Assigns 'updated' to 'orig' and returns true if they are different
34
template
<
typename
T, std::enable_if_t<!hasFuzzyCompare<T>::value,
bool
> =
true
>
35
bool
qUpdateIfNeeded
(T &orig, T updated)
36
{
37
if
(orig == updated)
38
return
false
;
39
orig = updated;
40
return
true
;
41
}
42
43
// Assigns 'updated' to 'orig' and returns true if they are different, compared with qFuzzyCompare
44
template
<
typename
T, std::enable_if_t<hasFuzzyCompare<T>::value,
bool
> =
true
>
45
bool
qUpdateIfNeeded
(T &orig, T updated)
46
{
47
if
(qFuzzyCompare(orig, updated))
48
return
false
;
49
orig = updated;
50
return
true
;
51
}
52
53
QT_END_NAMESPACE
54
55
#
endif
// QQUICK3DUTILS_P_H
QQuick3DCamera
Definition
qquick3dcamera_p.h:26
QQuick3DQuaternionUtils
Definition
qquick3dquaternionutils_p.h:30
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qUpdateIfNeeded
bool qUpdateIfNeeded(T &orig, T updated)
Definition
qquick3dutils_p.h:35
hasFuzzyCompare< T, std::void_t< decltype(qFuzzyCompare(std::declval< T & >(), std::declval< T & >()))> >
Definition
qquick3dutils_p.h:31
qtquick3d
src
quick3d
qquick3dutils_p.h
Generated on
for Qt by
1.18.0