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
qqmldebugmessageclient.cpp
Go to the documentation of this file.
1
// Copyright (C) 2017 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
#
include
"qqmldebugmessageclient_p.h"
6
7
#
include
<
QtCore
/
qdatastream
.
h
>
8
9
QT_BEGIN_NAMESPACE
10
11
/*!
12
\class QQmlDebugMessageClient
13
\internal
14
15
\brief Client for the debug message service
16
17
The QQmlDebugMessageClient receives debug messages routed through the QML
18
debug connection via QDebugMessageService.
19
*/
20
21
QQmlDebugMessageClient
::
QQmlDebugMessageClient
(QQmlDebugConnection *client)
22
:
QQmlDebugClient
(QLatin1String(
"DebugMessages"
), client)
23
{
24
}
25
26
void
QQmlDebugMessageClient
::
messageReceived
(
const
QByteArray &data)
27
{
28
QDataStream ds(data);
29
QByteArray command;
30
ds >> command;
31
32
if
(command ==
"MESSAGE"
) {
33
int
type;
34
int
line;
35
QByteArray debugMessage;
36
QByteArray file;
37
QByteArray function;
38
ds >> type >> debugMessage >> file >> line >> function;
39
QQmlDebugContextInfo
info;
40
info
.
line
= line;
41
info.file = QString::fromUtf8(file);
42
info.function = QString::fromUtf8(function);
43
info.timestamp = -1;
44
if
(!ds.atEnd()) {
45
QByteArray category;
46
ds >> category;
47
info.category = QString::fromUtf8(category);
48
if
(!ds.atEnd())
49
ds >> info.timestamp;
50
}
51
emit message(QtMsgType(type), QString::fromUtf8(debugMessage), info);
52
}
53
}
54
55
QT_END_NAMESPACE
56
57
#
include
"moc_qqmldebugmessageclient_p.cpp"
QQmlDebugClient
Definition
qqmldebugclient_p.h:27
QQmlDebugMessageClient
Client for the debug message service.
Definition
qqmldebugmessageclient_p.h:33
QQmlDebugMessageClient::messageReceived
virtual void messageReceived(const QByteArray &) override
Definition
qqmldebugmessageclient.cpp:26
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QQmlDebugContextInfo
Definition
qqmldebugmessageclient_p.h:24
QQmlDebugContextInfo::line
int line
Definition
qqmldebugmessageclient_p.h:25
qtdeclarative
src
qmldebug
qqmldebugmessageclient.cpp
Generated on
for Qt by
1.18.0