18using namespace Qt::StringLiterals;
21
22
29 if (m_type ==
"alias")
31 if (name.startsWith(
"__"))
34 m_nativeEnum.setPrefix(parent->name());
38
39
40
41
53
54
55
56
57
60
61
62
63
69 if ((m_isList = toFlagValue(isList)))
70 m_type =
"list<%1>"_L1.arg(m_type);
74
75
76
77
78
79
80
81
82
83
91 while (parent && !(parent->isQmlType()))
92 parent = parent->parent();
95 if (
auto qcn =
static_cast<
QmlTypeNode *>(parent); qcn && qcn->classNode()) {
96 if (
auto propertyNode = findCorrespondingCppProperty(); propertyNode)
99 qCDebug(lcQdoc).nospace()
100 << qPrintable(defLocation().toString())
101 <<
": Automatic resolution of QML property attributes failed for "
103 <<
" (Q_PROPERTY not found in the C++ class hierarchy known to QDoc. "
104 <<
"Likely, the type is replaced with a private implementation.)";
111
112
113
114
115
116
129
130
131
132
133
134
135
136
137
155
156
157
158
159
160
161
162
163
164
165
166
167
172 result << u"default"_s;
174 result << u"read-only"_s;
176 result << u"required"_s;
182
183
184
192 auto *qcn =
static_cast<QmlTypeNode *>(n);
196
197
198
199
200 QStringList dotSplit = name().split(QChar(
'.'));
201 pn = cn->findPropertyNode(dotSplit[0]);
204
205
206
207
208 if (dotSplit.size() > 1) {
209 QStringList path(extractClassName(pn->qualifiedDataType()));
212 auto *cn =
static_cast<ClassNode *>(nn);
215
216
217
218
219
220
221 return (pn2 ? pn2 : pn);
255QRegularExpression
QmlPropertyNode::cppBasicList(
"^(Q[A-Za-z0-9]+)List$");
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
278 QString qmlType = type;
279 if (qmlType.isNull())
280 qmlType = dataType();
286 auto match = qmlBasicList.match(qmlType);
287 if (match.hasMatch())
288 return validateDataType(match.captured(1));
290 if (cppQmlValueTypes.contains(qmlType) ||
291 cppBasicList.match(qmlType).hasMatch())
The ClassNode represents a C++ class.
This class describes one instance of using the Q_PROPERTY macro.
This class provides exclusive access to the qdoc database, which consists of a forrest of trees and a...
static QDocDatabase * qdocDB()
Creates the singleton.
NodeMultiMap & getQmlValueTypes()
Returns a reference to the map of QML basic types.
Status
Specifies the status of the QQmlIncubator.
QStringList hints() const
Returns a list of hint strings for this QML property, such as "default", "read-only",...
void markReadOnly(bool flag) override
If this node is a QmlPropertyNode, then the property's read-only flag is set to flag.
bool isReadOnly() const
Returns true if this QML property node is marked as a read-only property.
bool isRequired()
Returns true if this QML property is marked with \required or the corresponding C++ property uses the...
void setIsList(bool isList)
Marks this property as a list if isList is true.
bool isRequired() const
Const overloads that delegate to the resolving non-const versions when the attribute hasn't been cach...
void setDataType(const QString &dataType) override
Sets the data type of this property to dataType, preserving the list property modifier if one is set ...
QmlPropertyNode(Aggregate *parent, const QString &name, QString type, bool attached)
Constructor for the QML property node.
bool isReadOnly()
Returns true if this QML property or attached property is read-only.
bool validateDataType(const QString &type=QString()) const
Validates a QML property type for the property, returning true if the type is a QML type or QML list ...
void markRequired(bool flag)
Combined button and popup list for selecting options.
The Node class is the base class for all the nodes in QDoc's parse tree.
bool isQmlType() const
Returns true if the node type is QmlType or QmlValueType.
Aggregate * parent() const
Returns the node's parent pointer.
static bool fromFlagValue(FlagValue fv, bool defaultValue)
Converts the enum fv back to a boolean value.
void setStatus(Status t)
Sets the node's status to t.