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
124
125
126
138
139
140
141
142 QStringList dotSplit = name().split(QChar(
'.'));
143 pn = cn->findPropertyNode(dotSplit[0]);
146
147
148
149
150 if (dotSplit.size() > 1) {
151 QStringList path(extractClassName(pn->qualifiedDataType()));
157
158
159
160
161
162
163 return (pn2 ? pn2 : pn);
197QRegularExpression
QmlPropertyNode::cppBasicList(
"^(Q[A-Za-z0-9]+)List$");
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
220 QString qmlType = type;
221 if (qmlType.isNull())
222 qmlType = dataType();
228 auto match = qmlBasicList.match(qmlType);
229 if (match.hasMatch())
230 return validateDataType(match.captured(1));
232 if (cppQmlValueTypes.contains(qmlType) ||
233 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.
void markReadOnly(bool flag) override
If this node is a QmlPropertyNode, then the property's read-only flag is set to flag.
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.
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 ...
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.