Qt
6.x
The Qt SDK
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
4
#include "
qqmljsannotation_p.h
"
5
6
QT_BEGIN_NAMESPACE
7
8
bool
QQmlJSAnnotation::isDeprecation
()
const
{
return
name
==
QStringLiteral
(
"Deprecated"
); }
9
10
QQQmlJSDeprecation
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>(reason)) {
18
deprecation
.
reason
= std::get<QString>(reason);
19
}
20
}
21
22
return
deprecation
;
23
}
24
25
QT_END_NAMESPACE
QHash::contains
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
Definition
qhash.h:991
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
name
GLuint name
Definition
qopengles2ext.h:156
qqmljsannotation_p.h
Q_ASSERT
#define Q_ASSERT(cond)
Definition
qrandom.cpp:47
QStringLiteral
#define QStringLiteral(str)
Definition
qstringliteral.h:36
QQQmlJSDeprecation
Definition
qqmljsannotation_p.h:25
QQQmlJSDeprecation::reason
QString reason
Definition
qqmljsannotation_p.h:26
QQmlJSAnnotation::deprecation
QQQmlJSDeprecation deprecation() const
Definition
qqmljsannotation.cpp:10
QQmlJSAnnotation::bindings
QHash< QString, Value > bindings
Definition
qqmljsannotation_p.h:34
QQmlJSAnnotation::isDeprecation
bool isDeprecation() const
Definition
qqmljsannotation.cpp:8
qtdeclarative
src
qmlcompiler
qqmljsannotation.cpp
Generated by
1.9.7