1// Copyright (C) 2021 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 "qqmljsannotation_p.h"
5
6QT_BEGIN_NAMESPACE
7
8bool QQmlJSAnnotation::isDeprecation() const { return name == QStringLiteral("Deprecated"); }
9
10QQQmlJSDeprecation QQmlJSAnnotation::deprecation() const {
11 Q_ASSERT(isDeprecation());
12 QQQmlJSDeprecation deprecation;
13 if (bindings.contains(QStringLiteral("reason"))) {
14
15 auto reason = bindings[QStringLiteral("reason")];
16
17 if (std::holds_alternative<QString>(v: reason)) {
18 deprecation.reason = std::get<QString>(v&: reason);
19 }
20 }
21
22 return deprecation;
23}
24
25QT_END_NAMESPACE
26

source code of qtdeclarative/src/qmlcompiler/qqmljsannotation.cpp