Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmljsliteralbindingcheck_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QQMLJSLITERALBINDINGCHECK_P_H
6#define QQMLJSLITERALBINDINGCHECK_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#include <QtCore/qglobal.h>
19#include <QtQmlCompiler/qqmlsa.h>
20
22
24
25class QQmlJSImportVisitor;
26class QQmlJSTypeResolver;
27
29{
30public:
32
33protected:
34 virtual QQmlJSStructuredTypeError check(const QString &typeName, const QString &value) const = 0;
35
36 QQmlSA::Property getProperty(const QString &propertyName, const QQmlSA::Binding &binding,
37 const QQmlSA::Element &bindingScope) const;
38
39 void warnOnCheckedBinding(const QQmlSA::Binding &binding, const QQmlSA::Element &propertyType);
40};
41
43{
44public:
45 QQmlJSLiteralBindingCheck(QQmlSA::PassManager *manager);
46
47 void onBinding(const QQmlSA::Element &element, const QString &propertyName,
48 const QQmlSA::Binding &binding, const QQmlSA::Element &bindingScope,
49 const QQmlSA::Element &value) override;
50
51private:
52 QQmlJSTypeResolver *m_resolver;
53
54protected:
55 QQmlJSStructuredTypeError check(const QString &typeName, const QString &value) const override;
56};
57
58QT_END_NAMESPACE
59
60#endif // QQMLJSLITERALBINDINGCHECK_P_H
void warnOnCheckedBinding(const QQmlSA::Binding &binding, const QQmlSA::Element &propertyType)
QQmlSA::Property getProperty(const QString &propertyName, const QQmlSA::Binding &binding, const QQmlSA::Element &bindingScope) const
virtual QQmlJSStructuredTypeError check(const QString &typeName, const QString &value) const =0
QQmlJSLiteralBindingCheck(QQmlSA::PassManager *manager)
QQmlJSStructuredTypeError check(const QString &typeName, const QString &value) const override
void onBinding(const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Binding &binding, const QQmlSA::Element &bindingScope, const QQmlSA::Element &value) override
Executes whenever a property gets bound to a value.
Combined button and popup list for selecting options.
static bool canConvertForLiteralBinding(QQmlJSTypeResolver *resolver, const QQmlSA::Element &fromElement, const QQmlSA::Element &toElement)
static QString literalPrettyTypeName(QQmlSA::BindingType type)