9#include <QtQml/private/qqmljsparser_p.h>
10#include <QtQml/private/qqmljslexer_p.h>
11#include <QtQml/private/qqmljsengine_p.h>
12#include <private/qqmljstypedescriptionreader_p.h>
14#include <QtCore/qdir.h>
33 PropertyDefinition prop;
34 prop.name =
property.propertyName();
35 prop.typeName =
property.typeName();
36 prop.isPointer =
property.isPointer();
37 prop.isReadonly = !
property.isWritable();
39 prop.isList =
property.isList();
40 int revision =
property.revision();
41 prop.isFinal =
property.isFinal();
42 prop.bindable =
property.bindable();
43 prop.read =
property.read();
44 prop.write =
property.write();
45 prop.notify =
property.notify();
47 if (prop.name.isEmpty() || prop.typeName.isEmpty()) {
49 .warning(
tr(
"Property object is missing a name or type script binding."))
62 case QQmlJSMetaMethodType::Method:
63 case QQmlJSMetaMethodType::Slot:
66 case QQmlJSMetaMethodType::Signal:
74 for (
int i = 0;
i < nParam; ++
i) {
76 param.name = parameters[
i].name();
77 param.typeName = parameters[
i].typeName();
78 methodInfo.parameters.append(
param);
82 int revision = metaMethod.
revision();
84 if (methodInfo.name.isEmpty()) {
100 for (
const auto &k : metaEnum.
keys()) {
102 lastValue = metaEnum.
value(k);
117 bool hasExports =
false;
119 int metaRev = jsE.version().toEncodedVersion<
int>();
126 bool incrementedPath =
false;
134 insertProperty(jsScope,
it.value(), objects);
143 insertSignalOrMethod(
it.value(), objects);
152 comp.addEnumeration(enumFromMetaEnum(
it.value()));
156 comp.setFileName(jsScope->
filePath());
158 m_currentPath = m_currentPath.
key(comp.name())
160 incrementedPath =
true;
178 auto it = objects.
end();
182 Path compPath = qmltypesFile()
184 .
field(Fields::components)
193 tr(
"negative meta revision %1 not supported").
arg(
it.key())));
195 revToPath.
insert(
it.key(), compPath.field(Fields::objects).index(objectIndex));
196 Path nextObjectPath = compPath.field(Fields::objects).index(++objectIndex);
200 it->setName(prototype);
202 it->addPrototypePath(nextObjectPath);
208 comp.setMetaRevisions(metaRevs);
213 auto v = jsE.version();
214 int metaRev =
v.toEncodedVersion<
int>();
216 e.uri = jsE.package();
217 e.typeName = jsE.type();
219 (
v.hasMinorVersion() ?
v.minorVersion() :
Version::Latest));
220 e.typePath = revToPath.
value(metaRev);
222 qCWarning(domLog) <<
"could not find version" << metaRev <<
"in" << revToPath.
keys();
224 e.exportSourcePath = exportSourcePath;
228 if (comp.name().isEmpty()) {
230 .
error(
tr(
"Component definition is missing a name binding."))
242 qmltypesFilePtr()->code());
245 m_isValid = reader(&objects, &dependencies);
246 for (
const auto &
obj : std::as_const(objects))
247 insertComponent(
obj.scope,
obj.exports);
248 qmltypesFilePtr()->setIsValid(m_isValid);
258 qmltypesFilePtr()->addErrorLocal(
message.handle());
const_iterator cbegin() const noexcept
const_iterator cend() const noexcept
qsizetype size() const noexcept
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
QList< Key > keys() const
const_iterator cbegin() const noexcept
const_iterator cend() const noexcept
QString extensionTypeName() const
QHash< QString, QQmlJSMetaEnum > ownEnumerations() const
QString baseTypeName() const
QString internalName() const
AccessSemantics accessSemantics() const
QString ownDefaultPropertyName() const
bool hasCustomParser() const
QString valueTypeName() const
QStringList interfaceNames() const
bool extensionIsNamespace() const
bool isPropertyLocallyRequired(const QString &name) const
QHash< QString, QQmlJSMetaProperty > ownProperties() const
QMultiHash< QString, QQmlJSMetaMethod > ownMethods() const
QString ownAttachedTypeName() const
QString canonicalFilePath()
Represents a set of tags grouping a set of related error messages.
Represents an error message connected to the dom.
Path dropTail(int n=1) const
Path key(QString name) const
Path field(QString name) const
Path index(index_type i) const
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QSet< QString >::iterator it
Path lookupCppTypePath(QString name)
static ErrorGroups readerParseErrors()
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
#define qCWarning(category,...)
GLenum GLsizei GLsizei GLint * values
[15]
GLsizei const GLfloat * v
[13]
GLuint64 GLenum void * handle
GLint GLenum GLint components
GLuint GLsizei const GLchar * message
GLenum const GLint * param
#define NewErrorGroup(name)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)