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
qqmltcpropertyutils_p.h
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
// Qt-Security score:significant
4
5
#
ifndef
QQMLTCPROPERTYUTILS_P_H
6
#
define
QQMLTCPROPERTYUTILS_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
/
qqmljsmetatypes_p
.
h
>
20
#
include
<
private
/
qqmljsscope_p
.
h
>
21
#
include
<
QtQml
/
private
/
qqmlsignalnames_p
.
h
>
22
23
QT_BEGIN_NAMESPACE
24
25
namespace
QQmltc
{
26
27
/*!
28
\internal
29
30
Returns an underlying C++ type of \a p property.
31
*/
32
inline
QString
getUnderlyingType
(
const
QQmlJSMetaProperty &p)
33
{
34
if
(p.isList()) {
35
// We cannot just use p.type()->internalName() here because it may be
36
// a list property of something that only receives a C++ name from qmltc.
37
const
QQmlJSScope::ConstPtr elementType = p.type()->elementType();
38
return
(elementType->isReferenceType() ? u"QQmlListProperty<" : u"QList<")
39
+ elementType->internalName() + u'>';
40
}
41
42
return
p.type()->augmentedInternalName();
43
}
44
45
// simple class that, for a given property, creates information for the
46
// Q_PROPERTY macro (READ/WRITE function names, etc.)
47
struct
PropertyData
48
{
49
PropertyData
(
const
QQmlJSMetaProperty &p) :
PropertyData
(p.propertyName()) { }
50
51
PropertyData
(
const
QString &propertyName)
52
{
53
read = propertyName;
54
write = QQmlSignalNames::addPrefixToPropertyName(u"set", propertyName);
55
bindable = QQmlSignalNames::addPrefixToPropertyName(u"bindable", propertyName);
56
notify = QQmlSignalNames::propertyNameToChangedSignalName(propertyName);
57
reset = QQmlSignalNames::addPrefixToPropertyName(u"reset", propertyName);
58
}
59
60
QString
read
;
61
QString
write
;
62
QString
bindable
;
63
QString
notify
;
64
QString
reset
;
65
};
66
67
}
// namespace QQmltc
68
69
QT_END_NAMESPACE
70
71
#
endif
// QQMLTCPROPERTYUTILS_P_H
QQmltc
Definition
qqmltccodewriter.cpp:19
QQmltc::isImplicitComponent
static bool isImplicitComponent(const QQmlJSScope::ConstPtr &type)
Definition
qqmltcvisitor.cpp:132
QQmltc::iterateBindings
void iterateBindings(const QQmlJSScope::ConstPtr &root, const QHash< QQmlJSScope::ConstPtr, QList< QQmlJSMetaPropertyBinding > > &qmlIrOrderedBindings, TypePredicate typePredicate, BindingPredicate bindingPredicate)
Definition
qqmltcvisitor.cpp:460
QQmltc::categoryOverrides
QSpan< const QmltcLoggingCategoryOverride > categoryOverrides()
Definition
qqmltcvisitor.cpp:28
QQmltc::isOrUnderComponent
static bool isOrUnderComponent(QQmlJSScope::ConstPtr type)
Definition
qqmltcvisitor.cpp:149
QQmltc::setAliasData
static void setAliasData(QQmlJSMetaProperty *alias, const QQmlJSUtils::ResolvedAlias &origin)
Definition
qqmltcvisitor.cpp:699
QQmltc::getUnderlyingType
QString getUnderlyingType(const QQmlJSMetaProperty &p)
Definition
qqmltcpropertyutils_p.h:32
QQmltc::addCleanQmlTypeName
static void addCleanQmlTypeName(QStringList *names, const QQmlJSScope::ConstPtr &scope)
Definition
qqmltcvisitor.cpp:267
QQmltc::iterateTypes
void iterateTypes(const QQmlJSScope::ConstPtr &root, const QHash< QQmlJSScope::ConstPtr, QList< QQmlJSMetaPropertyBinding > > &qmlIrOrderedBindings, Predicate predicate)
Definition
qqmltcvisitor.cpp:491
QQmltc::fetchType
QQmlJSScope::ConstPtr fetchType(const QQmlJSMetaPropertyBinding &binding)
Definition
qqmltcvisitor.cpp:440
QQmltc::isExplicitComponent
static bool isExplicitComponent(const QQmlJSScope::ConstPtr &type)
Definition
qqmltcvisitor.cpp:118
QQmltc::uniqueNameFromPieces
static QString uniqueNameFromPieces(const QStringList &pieces, QHash< QString, int > &repetitions)
Definition
qqmltcvisitor.cpp:109
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
Q_LOGGING_CATEGORY
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
QQmltc::PropertyData
Definition
qqmltcpropertyutils_p.h:48
QQmltc::PropertyData::PropertyData
PropertyData(const QQmlJSMetaProperty &p)
Definition
qqmltcpropertyutils_p.h:49
QQmltc::PropertyData::bindable
QString bindable
Definition
qqmltcpropertyutils_p.h:62
QQmltc::PropertyData::write
QString write
Definition
qqmltcpropertyutils_p.h:61
QQmltc::PropertyData::notify
QString notify
Definition
qqmltcpropertyutils_p.h:63
QQmltc::PropertyData::reset
QString reset
Definition
qqmltcpropertyutils_p.h:64
QQmltc::PropertyData::read
QString read
Definition
qqmltcpropertyutils_p.h:60
qtdeclarative
src
qmltc
qqmltcpropertyutils_p.h
Generated on
for Qt by
1.18.0