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