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
qqmldebugclient.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 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
4
#
include
"qqmldebugclient_p_p.h"
5
#
include
"qqmldebugconnection_p.h"
6
7
#
include
<
QtCore
/
qdebug
.
h
>
8
#
include
<
QtCore
/
qpointer
.
h
>
9
10
QT_BEGIN_NAMESPACE
11
12
QQmlDebugClient::QQmlDebugClient(
const
QString &name, QQmlDebugConnection *parent) :
13
QObject(*(
new
QQmlDebugClientPrivate(name, parent)), parent)
14
{
15
Q_D(QQmlDebugClient);
16
d->addToConnection();
17
}
18
19
QQmlDebugClient
::
QQmlDebugClient
(
QQmlDebugClientPrivate
&dd) :
20
QObject
(
dd
,
dd
.
connection
.
data
())
21
{
22
Q_D(QQmlDebugClient);
23
d->addToConnection();
24
}
25
26
QQmlDebugClient
::~
QQmlDebugClient
()
27
{
28
Q_D(QQmlDebugClient);
29
if
(d->connection && !d->connection->removeClient(d->name))
30
qWarning() <<
"QQmlDebugClient: Plugin not registered"
<< d->name;
31
}
32
33
QQmlDebugClientPrivate
::QQmlDebugClientPrivate(
const
QString &name,
34
QQmlDebugConnection
*connection) :
35
name(name), connection(connection)
36
{
37
}
38
39
void
QQmlDebugClientPrivate
::
addToConnection
()
40
{
41
Q_Q(QQmlDebugClient);
42
if
(connection && !connection->addClient(name, q)) {
43
qWarning() <<
"QQmlDebugClient: Conflicting plugin name"
<< name;
44
connection =
nullptr
;
45
}
46
}
47
48
QString
QQmlDebugClient
::
name
()
const
49
{
50
Q_D(
const
QQmlDebugClient);
51
return
d->name;
52
}
53
54
float
QQmlDebugClient
::
serviceVersion
()
const
55
{
56
Q_D(
const
QQmlDebugClient);
57
return
d->connection->serviceVersion(d->name);
58
}
59
60
QQmlDebugClient
::
State
QQmlDebugClient
::
state
()
const
61
{
62
Q_D(
const
QQmlDebugClient);
63
if
(!d->connection || !d->connection->isConnected())
64
return
NotConnected;
65
66
if
(d->connection->serviceVersion(d->name) != -1)
67
return
Enabled;
68
69
return
Unavailable;
70
}
71
72
void
QQmlDebugClient
::
sendMessage
(
const
QByteArray &message)
73
{
74
Q_D(QQmlDebugClient);
75
d->connection->sendMessage(d->name, message);
76
}
77
78
QQmlDebugConnection
*
QQmlDebugClient
::
connection
()
const
79
{
80
Q_D(
const
QQmlDebugClient);
81
return
d->connection;
82
}
83
84
void
QQmlDebugClient
::
messageReceived
(
const
QByteArray &message)
85
{
86
Q_UNUSED(message);
87
}
88
89
QT_END_NAMESPACE
90
91
#
include
"moc_qqmldebugclient_p.cpp"
QQmlDebugClientPrivate
Definition
qqmldebugclient_p_p.h:26
QQmlDebugClientPrivate::addToConnection
void addToConnection()
Definition
qqmldebugclient.cpp:39
QQmlDebugClient
Definition
qqmldebugclient_p.h:26
QQmlDebugClient::name
QString name() const
Definition
qqmldebugclient.cpp:48
QQmlDebugClient::messageReceived
virtual void messageReceived(const QByteArray &message)
Definition
qqmldebugclient.cpp:84
QQmlDebugClient::serviceVersion
float serviceVersion() const
Definition
qqmldebugclient.cpp:54
QQmlDebugClient::QQmlDebugClient
QQmlDebugClient(QQmlDebugClientPrivate &dd)
Definition
qqmldebugclient.cpp:19
QQmlDebugClient::sendMessage
void sendMessage(const QByteArray &message)
Definition
qqmldebugclient.cpp:72
QQmlDebugClient::state
State state() const
Definition
qqmldebugclient.cpp:60
QQmlDebugClient::connection
QQmlDebugConnection * connection() const
Definition
qqmldebugclient.cpp:78
QQmlDebugClient::~QQmlDebugClient
~QQmlDebugClient()
Definition
qqmldebugclient.cpp:26
QQmlDebugConnection
Definition
qqmldebugconnection_p.h:27
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtdeclarative
src
qmldebug
qqmldebugclient.cpp
Generated on
for Qt by
1.14.0