| 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 | |
| 7 | QT_BEGIN_NAMESPACE |
| 8 | |
| 9 | using namespace Qt::StringLiterals; |
| 10 | |
| 11 | QQmlJSStructuredTypeError QQuickLiteralBindingCheck::check(const QString &typeName, |
| 12 | const QString &value) const |
| 13 | { |
| 14 | return QQuickValueTypeFromStringCheck::check(typeName, value); |
| 15 | } |
| 16 | |
| 17 | void 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 | |
| 33 | QT_END_NAMESPACE |
| 34 |
