Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlpropertyvalidator_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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#ifndef QQMLPROPERTYVALIDATOR_P_H
4#define QQMLPROPERTYVALIDATOR_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <private/qqmlengine_p.h>
18#include <private/qqmlimport_p.h>
19#include <private/qqmljsdiagnosticmessage_p.h>
20#include <private/qqmlpropertycache_p.h>
21#include <private/qv4compileddata_p.h>
22
23#include <QtCore/qcoreapplication.h>
24
26
28{
30public:
32 QQmlEnginePrivate *enginePrivate, const QQmlImports *imports,
33 const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit);
34
35 QVector<QQmlError> validate();
36
37 QQmlPropertyCache::ConstPtr rootPropertyCache() const { return propertyCaches.at(0); }
38 QUrl documentSourceUrl() const { return compilationUnit->url(); }
39
40private:
41 QVector<QQmlError> validateObject(
42 int objectIndex, const QV4::CompiledData::Binding *instantiatingBinding,
43 bool populatingValueTypeGroupProperty = false) const;
44 QQmlError validateLiteralBinding(
45 const QQmlPropertyCache::ConstPtr &propertyCache, const QQmlPropertyData *property,
46 const QV4::CompiledData::Binding *binding) const;
47 QQmlError validateObjectBinding(
48 const QQmlPropertyData *property, const QString &propertyName,
49 const QV4::CompiledData::Binding *binding) const;
50
51 bool canCoerce(QMetaType to, QQmlPropertyCache::ConstPtr fromMo) const;
52
53 Q_REQUIRED_RESULT QVector<QQmlError> recordError(
54 const QV4::CompiledData::Location &location, const QString &description) const;
55 Q_REQUIRED_RESULT QVector<QQmlError> recordError(const QQmlError &error) const;
56 QString stringAt(int index) const { return compilationUnit->stringAt(index); }
57 QV4::ResolvedTypeReference *resolvedType(int id) const
58 {
59 return compilationUnit->resolvedType(id);
60 }
61
62 QQmlEnginePrivate *enginePrivate;
63 QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit;
64 const QQmlImports *imports;
65 const QV4::CompiledData::Unit *qmlUnit;
66 const QQmlPropertyCacheVector &propertyCaches;
67
68 QVector<QV4::CompiledData::BindingPropertyData> * const bindingPropertyDataPerObject;
69};
70
72
73#endif // QQMLPROPERTYVALIDATOR_P_H
\inmodule QtCore
Definition qmetatype.h:341
The QQmlError class encapsulates a QML error.
Definition qqmlerror.h:18
The QQmlImports class encapsulates one QML document's import statements.
QQmlPropertyCache::ConstPtr at(int index) const
QQmlPropertyCache::ConstPtr rootPropertyCache() const
QVector< QQmlError > validate()
QQmlPropertyValidator(QQmlEnginePrivate *enginePrivate, const QQmlImports *imports, const QQmlRefPointer< QV4::CompiledData::CompilationUnit > &compilationUnit)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
#define Q_REQUIRED_RESULT
#define Q_DECLARE_TR_FUNCTIONS(context)
DBusConnection const char DBusError * error
GLint location
GLuint index
[2]
const char property[13]
Definition qwizard.cpp:101