Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qqmlpropertyresolver.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 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
5#include <private/qqmlcontextdata_p.h>
6
8
10 RevisionCheck check) const
11{
12 if (notInRevision) *notInRevision = false;
13
14 const QQmlPropertyData *d = cache->property(name, nullptr, nullptr);
15
16 // Find the first property
17 while (d && d->isFunction())
18 d = cache->overrideData(d);
19
20 if (check != IgnoreRevision && d && !cache->isAllowedInRevision(d)) {
21 if (notInRevision) *notInRevision = true;
22 return nullptr;
23 } else {
24 return d;
25 }
26}
27
28
29const QQmlPropertyData *QQmlPropertyResolver::signal(const QString &name, bool *notInRevision) const
30{
31 if (notInRevision) *notInRevision = false;
32
33 const QQmlPropertyData *d = cache->property(name, nullptr, nullptr);
34 if (notInRevision) *notInRevision = false;
35
36 while (d && !(d->isFunction()))
37 d = cache->overrideData(d);
38
39 if (d && !cache->isAllowedInRevision(d)) {
40 if (notInRevision) *notInRevision = true;
41 return nullptr;
42 } else if (d && d->isSignal()) {
43 return d;
44 }
45
46 if (name.endsWith(QLatin1String("Changed"))) {
47 QString propName = name.mid(0, name.size() - static_cast<int>(strlen("Changed")));
48
49 d = property(propName, notInRevision);
50 if (d)
51 return cache->signal(d->notifyIndex());
52 }
53
54 return nullptr;
55}
56
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
Definition qstring.cpp:5204
Combined button and popup list for selecting options.
GLuint name
const char property[13]
Definition qwizard.cpp:101
QQmlPropertyCache::ConstPtr cache
const QQmlPropertyData * property(int index) const
const QQmlPropertyData * signal(const QString &name, bool *notInRevision) const