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
qqmljsvaluetypefromstringcheck_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 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 QQMLJSVALUETYPEFROMSTRINGCHECK_H
6#define QQMLJSVALUETYPEFROMSTRINGCHECK_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
19#include <QtCore/qglobal.h>
20#include <QtCore/qstring.h>
21
22QT_BEGIN_NAMESPACE
23
24struct QQmlJSStructuredTypeError
25{
26 QString code;
27 bool constructedFromInvalidString = false;
28
29 bool isValid() const { return !code.isEmpty() || constructedFromInvalidString; }
30 static QQmlJSStructuredTypeError withInvalidString() { return { QString(), true }; }
31 static QQmlJSStructuredTypeError withValidString() { return { QString(), false }; }
32 static QQmlJSStructuredTypeError fromSuggestedString(const QString &enhancedString)
33 {
34 return { enhancedString, false };
35 }
36};
37
39{
40public:
41 static QQmlJSStructuredTypeError hasError(const QString &typeName, const QString &value);
42};
43
44QT_END_NAMESPACE
45
46#endif // QQMLJSVALUETYPEFROMSTRINGCHECK_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.
static QQmlJSStructuredTypeError hasError(const QString &typeName, const QString &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)