1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#include "qquickliteralbindingcheck_p.h"
5#include "qquickvaluetypefromstringcheck_p.h"
6
7QT_BEGIN_NAMESPACE
8
9using namespace Qt::StringLiterals;
10
11QQmlJSStructuredTypeError QQuickLiteralBindingCheck::check(const QString &typeName,
12 const QString &value) const
13{
14 return QQuickValueTypeFromStringCheck::check(typeName, value);
15}
16
17void QQuickLiteralBindingCheck::onBinding(
18 const QQmlSA::Element &element, const QString &propertyName, const QQmlSA::Binding &binding,
19 const QQmlSA::Element &bindingScope, const QQmlSA::Element &value)
20{
21 Q_UNUSED(value);
22 Q_UNUSED(element);
23
24 const auto property = getProperty(propertyName, binding, bindingScope);
25 if (!property.isValid())
26 return;
27
28 if (const auto propertyType = property.type())
29 warnOnCheckedBinding(binding, propertyType);
30}
31
32
33QT_END_NAMESPACE
34

source code of qtdeclarative/src/plugins/qmllint/quick/qquickliteralbindingcheck.cpp