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
qqmlnotifylist_p.h
Go to the documentation of this file.
1
// Copyright (C) 2026 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
4
5
#
ifndef
QQMLNOTIFYLIST_P_H
6
#
define
QQMLNOTIFYLIST_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
<
private
/
qqmlnotifierendpoint_p
.
h
>
20
21
QT_BEGIN_NAMESPACE
22
23
class
QQmlNotifyList
24
{
25
public
:
26
QAtomicInteger<quint64> connectionMask;
27
QQmlNotifierEndpoint *todo =
nullptr
;
28
QQmlNotifierEndpoint **notifies =
nullptr
;
29
quint16 maximumTodoIndex = 0;
30
quint16 notifiesSize = 0;
31
32
void
layout();
33
34
private
:
35
void
layout(QQmlNotifierEndpoint *endpoint);
36
};
37
38
inline
void
QQmlNotifyList::layout(QQmlNotifierEndpoint *endpoint)
39
{
40
// Add a temporary sentinel at beginning of list. This will be overwritten
41
// when the end point is inserted into the notifies further down.
42
endpoint->prev =
nullptr
;
43
44
while
(endpoint->next) {
45
Q_ASSERT(
reinterpret_cast
<QQmlNotifierEndpoint *>(endpoint->next->prev) == endpoint);
46
endpoint = endpoint->next;
47
}
48
49
while
(endpoint) {
50
QQmlNotifierEndpoint *ep = (QQmlNotifierEndpoint *) endpoint->prev;
51
52
int
index = endpoint->sourceSignal;
53
index = qMin(index, 0xFFFF - 1);
54
55
endpoint->next = notifies[index];
56
if
(endpoint->next) endpoint->next->prev = &endpoint->next;
57
endpoint->prev = ¬ifies[index];
58
notifies[index] = endpoint;
59
60
endpoint = ep;
61
}
62
}
63
64
inline
void
QQmlNotifyList::layout()
65
{
66
Q_ASSERT(maximumTodoIndex >= notifiesSize);
67
68
if
(todo) {
69
QQmlNotifierEndpoint **old = notifies;
70
const
int
reallocSize = (maximumTodoIndex + 1) *
sizeof
(QQmlNotifierEndpoint *);
71
notifies = (QQmlNotifierEndpoint **)realloc(notifies, reallocSize);
72
const
int
memsetSize = (maximumTodoIndex - notifiesSize + 1) *
73
sizeof
(QQmlNotifierEndpoint *);
74
memset(notifies + notifiesSize, 0, memsetSize);
75
76
if
(notifies != old) {
77
for
(
int
ii = 0; ii < notifiesSize; ++ii)
78
if
(notifies[ii])
79
notifies[ii]->prev = ¬ifies[ii];
80
}
81
82
notifiesSize = maximumTodoIndex + 1;
83
84
layout(todo);
85
}
86
87
maximumTodoIndex = 0;
88
todo =
nullptr
;
89
}
90
91
QT_END_NAMESPACE
92
93
#
endif
// QQMLNOTIFYLIST_P_H
qtdeclarative
src
qml
qml
qqmlnotifylist_p.h
Generated on
for Qt by
1.18.0