Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qobject_impl.h
Go to the documentation of this file.
1
// Copyright (C) 2016 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
4
#ifndef Q_QDOC
5
6
#ifndef QOBJECT_H
7
#error Do not include qobject_impl.h directly
8
#endif
9
10
#if 0
11
#pragma qt_sync_skip_header_check
12
#pragma qt_sync_stop_processing
13
#endif
14
15
QT_BEGIN_NAMESPACE
16
17
18
namespace
QtPrivate
{
19
/*
20
Logic to statically generate the array of qMetaTypeId
21
ConnectionTypes<FunctionPointer<Signal>::Arguments>::types() returns an array
22
of int that is suitable for the types arguments of the connection functions.
23
24
The array only exist of all the types are declared as a metatype
25
(detected using the TypesAreDeclaredMetaType helper struct)
26
If one of the type is not declared, the function return 0 and the signal
27
cannot be used in queued connection.
28
*/
29
template
<
typename
ArgList>
struct
TypesAreDeclaredMetaType
{
enum
{
Value
=
false
}; };
30
template
<>
struct
TypesAreDeclaredMetaType
<
List
<>> {
enum
{
Value
=
true
}; };
31
template
<
typename
Arg,
typename
... Tail>
struct
TypesAreDeclaredMetaType
<
List
<Arg, Tail...> >
32
{
enum
{
Value
=
QMetaTypeId2<Arg>::Defined
&&
TypesAreDeclaredMetaType
<
List
<Tail...>>
::Value
}; };
33
34
template <typename ArgList, bool Declared = TypesAreDeclaredMetaType<ArgList>::Value >
struct
ConnectionTypes
35
{
static
const
int
*
types
() {
return
nullptr
; } };
36
template
<>
struct
ConnectionTypes
<
List
<>, true>
37
{
static
const
int
*
types
() {
return
nullptr
; } };
38
template
<
typename
... Args>
struct
ConnectionTypes
<
List
<Args...>, true>
39
{
static
const
int
*
types
() {
static
const
int
t
[
sizeof
...(Args) + 1] = { (
QtPrivate::QMetaTypeIdHelper<Args>::qt_metatype_id
())..., 0 };
return
t
; } };
40
}
41
42
43
QT_END_NAMESPACE
44
45
#endif
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
QtPrivate
\macro QT_NAMESPACE
Definition
qtconcurrentcompilertest.h:13
t
GLdouble GLdouble t
Definition
qopenglext.h:243
QMetaTypeId2
Definition
qmetatype.h:1218
QtPrivate::ConnectionTypes< List< Args... >, true >::types
static const int * types()
Definition
qobject_impl.h:39
QtPrivate::ConnectionTypes< List<>, true >::types
static const int * types()
Definition
qobject_impl.h:37
QtPrivate::ConnectionTypes
Definition
qobject_impl.h:35
QtPrivate::ConnectionTypes::types
static const int * types()
Definition
qobject_impl.h:35
QtPrivate::List
Definition
qobjectdefs_impl.h:36
QtPrivate::QMetaTypeIdHelper::qt_metatype_id
static constexpr int qt_metatype_id()
Definition
qmetatype.h:1238
QtPrivate::TypesAreDeclaredMetaType
Definition
qobject_impl.h:29
QtPrivate::TypesAreDeclaredMetaType::Value
@ Value
Definition
qobject_impl.h:29
qtbase
src
corelib
kernel
qobject_impl.h
Generated by
1.9.7