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
qqmljsannotation.cpp
Go to the documentation of this file.
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// Qt-Security score:significant
4
6
8
9bool QQmlJSAnnotation::isDeprecation() const { return name == QStringLiteral("Deprecated"); }
10
11QQQmlJSDeprecation QQmlJSAnnotation::deprecation() const {
12 Q_ASSERT(isDeprecation());
13 QQQmlJSDeprecation deprecation;
14 if (bindings.contains(QStringLiteral("reason"))) {
15
16 auto reason = bindings[QStringLiteral("reason")];
17
18 if (std::holds_alternative<QString>(reason)) {
19 deprecation.reason = std::get<QString>(reason);
20 }
21 }
22
23 return deprecation;
24}
25
26QT_END_NAMESPACE
QQQmlJSDeprecation deprecation() const
bool isDeprecation() const