42 #include "private/qdeclarativedebugservice_p.h" 43 #include "private/qdeclarativedebugservice_p_p.h" 44 #include "private/qdeclarativedebugserver_p.h" 46 #include <QtCore/QDebug> 47 #include <QtCore/QStringList> 67 if (
d->server->serviceNames().contains(name)) {
68 qWarning() <<
"QDeclarativeDebugService: Conflicting plugin name" <<
name;
71 d->server->addService(
this);
79 d->server->removeService(
this);
97 struct ObjectReference
103 struct ObjectReferenceHash
105 ObjectReferenceHash() : nextId(0) {}
126 ObjectReferenceHash *
hash = objectReferenceHash();
128 hash->objects.find(
object);
130 if (iter == hash->objects.end()) {
131 int id = hash->nextId++;
133 hash->ids.insert(
id,
object);
134 iter = hash->objects.insert(
object, ObjectReference());
135 iter->object = object;
137 }
else if (iter->object !=
object) {
138 int id = hash->nextId++;
140 hash->ids.remove(iter->id);
142 hash->ids.insert(
id,
object);
143 iter->object = object;
156 ObjectReferenceHash *
hash = objectReferenceHash();
159 if (iter == hash->ids.end())
164 hash->objects.find(*iter);
165 Q_ASSERT(objIter != hash->objects.end());
167 if (objIter->object == 0) {
168 hash->ids.erase(iter);
169 hash->objects.erase(objIter);
209 d->server->sendMessage(
this, message);
219 return d->server->waitForMessage(
this);
bool hasDebuggingClient() const
virtual void messageReceived(const QByteArray &)
static uint hash(const uchar *p, int n)
QDeclarativeDebugServicePrivate()
~QDeclarativeDebugService()
#define QT_END_NAMESPACE
This macro expands to.
static QObject * objectForId(int)
Returns the object for unique id.
static QDeclarativeDebugServer * instance()
QString objectName
the name of this object
The QByteArray class provides an array of bytes.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
The QObject class is the base class of all Qt objects.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Q_CORE_EXPORT void qWarning(const char *,...)
QDeclarativeDebugService(const QString &, QObject *parent=0)
static bool isDebuggingEnabled()
static int idForObject(QObject *)
Returns a unique id for object.
static QAuServer & server()
static QString objectToString(QObject *obj)
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
QString objectName() const
static bool hasDebuggingClient()
virtual void statusChanged(Status)
Q_GLOBAL_STATIC(ObjectReferenceHash, objectReferenceHash)
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
void sendMessage(const QByteArray &)