Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
6
7#include <QtCore/qdebug.h>
8#include <QtCore/qpointer.h>
9
11
13 QObject(*(new QQmlDebugClientPrivate(name, parent)), parent)
14{
15 Q_D(QQmlDebugClient);
16 d->addToConnection();
17}
18
20 QObject(dd, dd.connection.data())
21{
22 Q_D(QQmlDebugClient);
23 d->addToConnection();
24}
25
27{
28 Q_D(QQmlDebugClient);
29 if (d->connection && !d->connection->removeClient(d->name))
30 qWarning() << "QQmlDebugClient: Plugin not registered" << d->name;
31}
32
38
40{
41 Q_Q(QQmlDebugClient);
43 qWarning() << "QQmlDebugClient: Conflicting plugin name" << name;
44 connection = nullptr;
45 }
46}
47
49{
50 Q_D(const QQmlDebugClient);
51 return d->name;
52}
53
55{
56 Q_D(const QQmlDebugClient);
57 return d->connection->serviceVersion(d->name);
58}
59
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
73{
74 Q_D(QQmlDebugClient);
75 d->connection->sendMessage(d->name, message);
76}
77
79{
80 Q_D(const QQmlDebugClient);
81 return d->connection;
82}
83
88
90
91#include "moc_qqmldebugclient_p.cpp"
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qobject.h:103
QPointer< QQmlDebugConnection > connection
QQmlDebugClientPrivate(const QString &name, QQmlDebugConnection *connection)
QQmlDebugClient(const QString &name, QQmlDebugConnection *parent)
QString name() const
virtual void messageReceived(const QByteArray &message)
float serviceVersion() const
void sendMessage(const QByteArray &message)
State state() const
QQmlDebugConnection * connection() const
bool addClient(const QString &name, QQmlDebugClient *client)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection * connection
#define qWarning
Definition qlogging.h:166
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLsizei const GLchar * message
GLuint name
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
#define Q_UNUSED(x)