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
qquickdeferredpointer_p_p.h
Go to the documentation of this file.
1
// Copyright (C) 2017 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
QQUICKDEFERREDPOINTER_P_P_H
6
#
define
QQUICKDEFERREDPOINTER_P_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtCore
/
qglobal
.
h
>
20
#
include
<
QtQml
/
private
/
qbipointer_p
.
h
>
21
#
include
<
QtQml
/
private
/
qqmlcomponent_p
.
h
>
22
23
QT_BEGIN_NAMESPACE
24
25
class
QQuickUntypedDeferredPointer
26
{
27
Q_DISABLE_COPY_MOVE
(
QQuickUntypedDeferredPointer
)
28
public
:
29
QQmlComponentPrivate
::
DeferredState
*
deferredState
()
const
30
{
31
return
value
.
isT1
() ?
nullptr
: &
value
.
asT2
()->
state
;
32
}
33
34
void
clearDeferredState
()
35
{
36
if
(
value
.
isT1
())
37
return
;
38
value
.
clearFlag
();
39
DeferredState
*
state
=
value
.
asT2
();
40
value
=
state
->
value
;
41
delete
state
;
42
}
43
44
bool
wasExecuted
()
const
{
return
value
.
isT1
() &&
value
.
flag
(); }
45
void
setExecuted
()
46
{
47
Q_ASSERT
(
value
.
isT1
());
48
value
.
setFlag
();
49
}
50
51
bool
isExecuting
()
const
{
return
value
.
isT2
() &&
value
.
flag
(); }
52
bool
setExecuting
(
bool
b
)
53
{
54
if
(
b
) {
55
if
(
value
.
isT2
()) {
56
// Not our state. Set the flag, but leave it alone.
57
value
.
setFlag
();
58
return
false
;
59
}
60
61
value
=
new
DeferredState
{
62
QQmlComponentPrivate
::
DeferredState
(),
63
value
.
asT1
()
64
};
65
value
.
setFlag
();
66
return
true
;
67
}
68
69
if
(
value
.
isT2
()) {
70
value
.
clearFlag
();
71
return
true
;
72
}
73
74
return
false
;
75
}
76
77
protected
:
78
QQuickUntypedDeferredPointer
() =
default
;
79
QQuickUntypedDeferredPointer
(
void
*v) :
value
(
v
)
80
{
81
Q_ASSERT(value.isT1());
82
Q_ASSERT(!value.flag());
83
}
84
85
QQuickUntypedDeferredPointer
&
operator
=(
void
*v)
86
{
87
if
(value.isT1())
88
value = v;
89
else
90
value.asT2()->value = v;
91
return
*
this
;
92
}
93
94
~
QQuickUntypedDeferredPointer
()
95
{
96
if
(value.isT2())
97
delete
value.asT2();
98
}
99
100
void
*
data
()
const
{
return
value.isT1() ? value.asT1() : value.asT2()->value; }
101
102
private
:
103
struct
DeferredState
104
{
105
QQmlComponentPrivate::DeferredState state;
106
void
*value =
nullptr
;
107
};
108
109
QBiPointer<
void
, DeferredState> value;
110
};
111
112
template
<
typename
T>
113
class
QQuickDeferredPointer
:
public
QQuickUntypedDeferredPointer
114
{
115
Q_DISABLE_COPY_MOVE
(
QQuickDeferredPointer
)
116
public
:
117
Q_NODISCARD_CTOR
QQuickDeferredPointer
() =
default
;
118
~
QQuickDeferredPointer
() =
default
;
119
120
Q_NODISCARD_CTOR
QQuickDeferredPointer
(
T
*
v
) :
QQuickUntypedDeferredPointer
(
v
) {}
121
QQuickDeferredPointer
<T> &
operator
=(T *o) {
122
QQuickUntypedDeferredPointer
::operator=(o);
123
return
*
this
;
124
}
125
126
T *
data
()
const
{
return
static_cast
<T *>(
QQuickUntypedDeferredPointer
::
data
(
)
); }
127
operator
bool
()
const
{
return
data
(
)
!=
nullptr
; }
128
operator
T*()
const
{
return
data
(
)
; }
129
T *
operator
*()
const
{
return
data
(
)
; }
130
T *
operator
->()
const
{
return
data
(
)
; }
131
};
132
133
QT_END_NAMESPACE
134
135
#
endif
// QQUICKDEFERREDPOINTER_P_P_H
QQuickApplicationWindowAttachedPrivate
Definition
qquickapplicationwindow.cpp:836
QQuickApplicationWindowAttachedPrivate::windowChange
void windowChange(QQuickWindow *wnd)
Definition
qquickapplicationwindow.cpp:847
QQuickApplicationWindowAttachedPrivate::activeFocusControl
QQuickItem * activeFocusControl
Definition
qquickapplicationwindow.cpp:844
QQuickApplicationWindowAttachedPrivate::activeFocusChange
void activeFocusChange()
Definition
qquickapplicationwindow.cpp:899
QQuickApplicationWindowAttachedPrivate::window
QQuickWindow * window
Definition
qquickapplicationwindow.cpp:843
QQuickApplicationWindowPrivate
Definition
qquickapplicationwindow_p_p.h:33
QQuickControlPrivate
Definition
qquickcontrol_p_p.h:44
QQuickDeferredPointer
Definition
qquickdeferredpointer_p_p.h:114
QQuickDeferredPointer::operator*
T * operator*() const
Definition
qquickdeferredpointer_p_p.h:129
QQuickDeferredPointer::operator->
T * operator->() const
Definition
qquickdeferredpointer_p_p.h:130
QQuickDeferredPointer::~QQuickDeferredPointer
~QQuickDeferredPointer()=default
QQuickDeferredPointer::operator bool
operator bool() const
Definition
qquickdeferredpointer_p_p.h:127
QQuickDeferredPointer::data
T * data() const
Definition
qquickdeferredpointer_p_p.h:126
QQuickDeferredPointer::operator T*
operator T*() const
Definition
qquickdeferredpointer_p_p.h:128
QQuickDeferredPointer::operator=
QQuickDeferredPointer< T > & operator=(T *o)
Definition
qquickdeferredpointer_p_p.h:121
QQuickPopupPrivate
Definition
qquickpopup_p_p.h:63
QQuickPopupTransitionManager
Definition
qquickpopup_p_p.h:45
QQuickToolBarPrivate
Container for context-sensitive controls.
Definition
qquicktoolbar.cpp:70
QQuickToolBar
Definition
qquicktoolbar_p.h:26
QQuickUntypedDeferredPointer
Definition
qquickdeferredpointer_p_p.h:26
QQuickUntypedDeferredPointer::QQuickUntypedDeferredPointer
QQuickUntypedDeferredPointer(void *v)
Definition
qquickdeferredpointer_p_p.h:79
QQuickUntypedDeferredPointer::operator=
QQuickUntypedDeferredPointer & operator=(void *v)
Definition
qquickdeferredpointer_p_p.h:85
QQuickUntypedDeferredPointer::data
void * data() const
Definition
qquickdeferredpointer_p_p.h:100
QQuickUntypedDeferredPointer::~QQuickUntypedDeferredPointer
~QQuickUntypedDeferredPointer()
Definition
qquickdeferredpointer_p_p.h:94
QQuickTemplatesUtils
Definition
qquicktemplatesutils_p.h:23
QQuickTemplatesUtils::isInteractiveControlType
bool isInteractiveControlType(const QQuickItem *item)
Definition
qquicktemplatesutils.cpp:27
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
layoutItem
static void layoutItem(QQuickItem *item, qreal y, qreal width)
Definition
qquickapplicationwindow.cpp:118
ItemChanges
static const QQuickItemPrivate::ChangeTypes ItemChanges
Styled top-level window with support for a header and footer.
Definition
qquickapplicationwindow.cpp:115
findActiveFocusControl
static QQuickItem * findActiveFocusControl(QQuickWindow *window)
Definition
qquickapplicationwindow.cpp:235
qtdeclarative
src
quicktemplates
qquickdeferredpointer_p_p.h
Generated on
for Qt by
1.18.0