Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qqmljsdiagnosticmessage_p.h
Go to the documentation of this file.
1
// Copyright (C) 2019 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant
4
5
#
ifndef
QQMLJSDIAGNOSTICMESSAGE_P_H
6
#
define
QQMLJSDIAGNOSTICMESSAGE_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtCore
/
qlogging
.
h
>
20
#
include
<
QtCore
/
qstring
.
h
>
21
22
// Include the API version here, to avoid complications when querying it for the
23
// QQmlSourceLocation -> line/column change.
24
25
#
include
"qqmljssourcelocation_p.h"
26
27
QT_BEGIN_NAMESPACE
28
29
namespace
QQmlJS
{
30
enum
class
DiagnosticCategory
:
quint8
{
31
// warnings -> QtWarningMsg
32
AliasCycle
,
33
DuplicateInlineComponent
,
34
DuplicatePropertyBinding
,
35
DuplicatedName
,
36
Import
,
37
38
// errors -> QtCriticalMsg
39
Syntax
,
40
SyntaxDuplicateIds
,
41
};
42
43
struct
MsgTypeOrDiagnosticCategory
44
{
45
public
:
46
MsgTypeOrDiagnosticCategory
() :
m_isQtMsgType
(1),
m_data
(
QtCriticalMsg
) { }
47
MsgTypeOrDiagnosticCategory
(QtMsgType qtMsgType) :
m_isQtMsgType
(1),
m_data
(
qtMsgType
) { }
48
MsgTypeOrDiagnosticCategory
(
DiagnosticCategory
diagnosticCategory)
49
:
m_isQtMsgType
(0),
m_data
(
static_cast
<
quint8
>(
diagnosticCategory
))
50
{
51
}
52
friend
bool
comparesEqual
(
MsgTypeOrDiagnosticCategory
a,
MsgTypeOrDiagnosticCategory
b)
noexcept
53
{
54
return
a.m_isQtMsgType == b.m_isQtMsgType && a.m_data == b.m_data;
55
}
56
Q_DECLARE_EQUALITY_COMPARABLE
(
MsgTypeOrDiagnosticCategory
);
57
58
QtMsgType
asMsgType
()
const
59
{
60
if
(m_isQtMsgType)
61
return
static_cast
<QtMsgType>(m_data);
62
return
static_cast
<DiagnosticCategory>(m_data) < DiagnosticCategory::Syntax ? QtWarningMsg
63
: QtCriticalMsg;
64
}
65
66
quint8
m_isQtMsgType
: 1;
67
quint8
m_data
: 7;
68
};
69
70
struct
DiagnosticMessage
71
{
72
QString
message
;
73
MsgTypeOrDiagnosticCategory
type
=
QtCriticalMsg
;
74
SourceLocation
loc
;
75
76
QtMsgType
msgType
()
const
{
return
type.asMsgType(); }
77
78
bool
isError
()
const
{
return
msgType() == QtCriticalMsg; }
79
80
bool
isWarning
()
const
{
return
msgType() == QtWarningMsg; }
81
};
82
}
// namespace QQmlJS
83
84
Q_DECLARE_TYPEINFO
(
QQmlJS
::
DiagnosticMessage
,
Q_RELOCATABLE_TYPE
);
85
86
QT_END_NAMESPACE
87
88
#
endif
// QQMLJSDIAGNOSTICMESSAGE_P_H
QQmlJS::SourceLocation
Definition
qqmljssourcelocation_p.h:27
QQmlJS::AST
Definition
qqmljsast.cpp:19
QQmlJS::AST::asAnonymousFunctionDefinition
FunctionExpression * asAnonymousFunctionDefinition(Node *n)
Definition
qqmljsast.cpp:21
QQmlJS::AST::asAnonymousClassDefinition
ClassExpression * asAnonymousClassDefinition(Node *n)
Definition
qqmljsast.cpp:31
QQmlJS
Definition
qv4bytecodegenerator_p.h:27
QQmlJS::DiagnosticCategory
DiagnosticCategory
Definition
qqmljsdiagnosticmessage_p.h:30
QQmlJS::DiagnosticCategory::AliasCycle
@ AliasCycle
Definition
qqmljsdiagnosticmessage_p.h:32
QQmlJS::DiagnosticCategory::DuplicatedName
@ DuplicatedName
Definition
qqmljsdiagnosticmessage_p.h:35
QQmlJS::DiagnosticCategory::Import
@ Import
Definition
qqmljsdiagnosticmessage_p.h:36
QQmlJS::DiagnosticCategory::SyntaxDuplicateIds
@ SyntaxDuplicateIds
Definition
qqmljsdiagnosticmessage_p.h:40
QQmlJS::DiagnosticCategory::Syntax
@ Syntax
Definition
qqmljsdiagnosticmessage_p.h:39
QQmlJS::DiagnosticCategory::DuplicatePropertyBinding
@ DuplicatePropertyBinding
Definition
qqmljsdiagnosticmessage_p.h:34
QQmlJS::DiagnosticCategory::DuplicateInlineComponent
@ DuplicateInlineComponent
Definition
qqmljsdiagnosticmessage_p.h:33
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(QQmlJS::DiagnosticMessage, Q_RELOCATABLE_TYPE)
QQmlJS::DiagnosticMessage
Definition
qqmljsdiagnosticmessage_p.h:71
QQmlJS::DiagnosticMessage::loc
SourceLocation loc
Definition
qqmljsdiagnosticmessage_p.h:74
QQmlJS::DiagnosticMessage::message
QString message
Definition
qqmljsdiagnosticmessage_p.h:72
QQmlJS::DiagnosticMessage::msgType
QtMsgType msgType() const
Definition
qqmljsdiagnosticmessage_p.h:76
QQmlJS::DiagnosticMessage::isError
bool isError() const
Definition
qqmljsdiagnosticmessage_p.h:78
QQmlJS::DiagnosticMessage::type
MsgTypeOrDiagnosticCategory type
Definition
qqmljsdiagnosticmessage_p.h:73
QQmlJS::DiagnosticMessage::isWarning
bool isWarning() const
Definition
qqmljsdiagnosticmessage_p.h:80
QQmlJS::MsgTypeOrDiagnosticCategory
Definition
qqmljsdiagnosticmessage_p.h:44
QQmlJS::MsgTypeOrDiagnosticCategory::MsgTypeOrDiagnosticCategory
MsgTypeOrDiagnosticCategory(DiagnosticCategory diagnosticCategory)
Definition
qqmljsdiagnosticmessage_p.h:48
QQmlJS::MsgTypeOrDiagnosticCategory::comparesEqual
friend bool comparesEqual(MsgTypeOrDiagnosticCategory a, MsgTypeOrDiagnosticCategory b) noexcept
Definition
qqmljsdiagnosticmessage_p.h:52
QQmlJS::MsgTypeOrDiagnosticCategory::m_data
quint8 m_data
Definition
qqmljsdiagnosticmessage_p.h:67
QQmlJS::MsgTypeOrDiagnosticCategory::MsgTypeOrDiagnosticCategory
MsgTypeOrDiagnosticCategory(QtMsgType qtMsgType)
Definition
qqmljsdiagnosticmessage_p.h:47
QQmlJS::MsgTypeOrDiagnosticCategory::m_isQtMsgType
quint8 m_isQtMsgType
Definition
qqmljsdiagnosticmessage_p.h:66
QQmlJS::MsgTypeOrDiagnosticCategory::MsgTypeOrDiagnosticCategory
MsgTypeOrDiagnosticCategory()
Definition
qqmljsdiagnosticmessage_p.h:46
QQmlJS::MsgTypeOrDiagnosticCategory::asMsgType
QtMsgType asMsgType() const
Definition
qqmljsdiagnosticmessage_p.h:58
qtdeclarative
src
qml
common
qqmljsdiagnosticmessage_p.h
Generated on
for Qt by
1.18.0