42 #include "private/qdeclarativeenginedebug_p.h" 44 #include "private/qdeclarativedebugclient_p.h" 48 #include <private/qobject_p.h> 128 enginesIter.
value()->m_client = 0;
135 rootContextIter.
value()->m_client = 0;
142 objectIter.
value()->m_client = 0;
149 exprIter.
value()->m_client = 0;
155 for (; watchIter !=
watched.
end(); ++watchIter) {
156 watchIter.
value()->m_client = 0;
215 o.
m_name = data.objectName;
228 ds >> childCount >> recur;
230 for (
int ii = 0; ii < childCount; ++ii) {
238 for (
int ii = 0; ii < propCount; ++ii) {
277 for (
int ii = 0; ii < contextCount; ++ii) {
296 emit q_func()->statusChanged(status);
308 if (type ==
"LIST_ENGINES_R") {
320 for (
int ii = 0; ii < count; ++ii) {
329 }
else if (type ==
"LIST_OBJECTS_R") {
343 }
else if (type ==
"FETCH_OBJECT_R") {
357 }
else if (type ==
"EVAL_EXPRESSION_R") {
360 ds >> queryId >> result;
370 }
else if (type ==
"WATCH_PROPERTY_R") {
380 }
else if (type ==
"WATCH_OBJECT_R") {
390 }
else if (type ==
"WATCH_EXPR_OBJECT_R") {
400 }
else if (type ==
"UPDATE_WATCH") {
405 ds >> queryId >> debugId >> name >> value;
411 }
else if (type ==
"OBJECT_CREATED") {
412 emit q_func()->newObjects();
434 int queryId =
d->getId();
435 watch->m_queryId = queryId;
436 watch->m_client =
this;
438 watch->
m_name =
property.name();
439 d->watched.insert(queryId, watch);
443 ds <<
QByteArray(
"WATCH_PROPERTY") << queryId <<
property.objectDebugId() <<
property.name().toUtf8();
444 d->client->sendMessage(message);
454 qWarning(
"QDeclarativeEngineDebug::addWatch(): Not implemented");
463 int queryId =
d->getId();
464 watch->m_queryId = queryId;
465 watch->m_client =
this;
466 watch->m_objectDebugId =
object.debugId();
468 d->watched.insert(queryId, watch);
472 ds <<
QByteArray(
"WATCH_EXPR_OBJECT") << queryId <<
object.debugId() << expr;
473 d->client->sendMessage(message);
486 int queryId =
d->getId();
490 d->watched.insert(queryId, watch);
494 ds <<
QByteArray(
"WATCH_OBJECT") << queryId <<
object.debugId();
495 d->client->sendMessage(message);
505 qWarning(
"QDeclarativeEngineDebug::addWatch(): Not implemented");
519 d->watched.remove(watch->
queryId());
525 d->client->sendMessage(message);
536 int queryId =
d->getId();
538 d->enginesQuery.insert(queryId, query);
543 d->client->sendMessage(message);
558 int queryId =
d->getId();
560 d->rootContextQuery.insert(queryId, query);
565 d->client->sendMessage(message);
580 int queryId =
d->getId();
582 d->objectQuery.insert(queryId, query);
586 ds <<
QByteArray(
"FETCH_OBJECT") << queryId <<
object.debugId()
588 d->client->sendMessage(message);
603 int queryId =
d->getId();
605 d->objectQuery.insert(queryId, query);
609 ds <<
QByteArray(
"FETCH_OBJECT") << queryId <<
object.debugId()
611 d->client->sendMessage(message);
627 int queryId =
d->getId();
629 d->expressionQuery.insert(queryId, query);
633 ds <<
QByteArray(
"EVAL_EXPRESSION") << queryId << objectDebugId << expr;
634 d->client->sendMessage(message);
652 ds <<
QByteArray(
"SET_BINDING") <<
d->getId() << objectDebugId << propertyName <<
653 bindingExpression << isLiteralValue << source << line;
654 d->client->sendMessage(message);
668 ds <<
QByteArray(
"RESET_BINDING") <<
d->getId() << objectDebugId << propertyName;
669 d->client->sendMessage(message);
684 ds <<
QByteArray(
"SET_METHOD_BODY") <<
d->getId() << objectDebugId << methodName
686 d->client->sendMessage(message);
694 :
QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
874 :
m_debugId(-1), m_parentId(-1), m_contextDebugId(-1), m_needsMoreData(false)
988 : m_lineNumber(-1), m_columnNumber(-1)
1034 : m_objectDebugId(-1), m_hasNotifySignal(false)
The QVariant class acts like a union for the most common Qt data types.
QDeclarativeDebugExpressionQuery * queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent=0)
QDeclarativeDebugPropertyReference()
QHash< int, QDeclarativeDebugEnginesQuery * > enginesQuery
QHash< int, QDeclarativeDebugExpressionQuery * > expressionQuery
QList< QDeclarativeDebugEngineReference > m_engines
#define QT_END_NAMESPACE
This macro expands to.
QDeclarativeDebugObjectQuery * queryObjectRecursive(const QDeclarativeDebugObjectReference &, QObject *parent=0)
QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, QDeclarativeEngineDebugPrivate *p)
QDeclarativeDebugFileReference source() const
int remove(const Key &key)
Removes all the items that have the key from the hash.
~QDeclarativeDebugWatch()
static QBasicAtomicInt objectCount
QDeclarativeDebugFileReference & operator=(const QDeclarativeDebugFileReference &)
bool atEnd() const
Returns true if the I/O device has reached the end position (end of the stream or file) or if there i...
The QByteArray class provides an array of bytes.
virtual ~QDeclarativeDebugRootContextQuery()
QDeclarativeDebugFileReference()
void stateChanged(QDeclarativeDebugQuery::State)
QDeclarativeDebugContextReference rootContext() const
void decode(QDataStream &, QDeclarativeDebugContextReference &)
static LibLoadStatus status
QDeclarativeDebugPropertyReference & operator=(const QDeclarativeDebugPropertyReference &)
void stateChanged(QDeclarativeDebugWatch::State)
QHash< int, QDeclarativeDebugRootContextQuery * > rootContextQuery
QDeclarativeDebugObjectReference m_object
void removeWatch(QDeclarativeDebugWatch *watch)
T & value() const
Returns a modifiable reference to the current item's value.
virtual ~QDeclarativeDebugExpressionQuery()
friend class QDeclarativeEngineDebugPrivate
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
QDeclarativeDebugObjectReference & operator=(const QDeclarativeDebugObjectReference &)
The QObject class is the base class of all Qt objects.
QList< QDeclarativeDebugContextReference > m_contexts
QDeclarativeDebugRootContextQuery(QObject *)
static QObjectPrivate * get(QObject *o)
const T value(const Key &key) const
Returns the value associated with the key.
QHash< int, QDeclarativeDebugWatch * > watched
QDeclarativeDebugObjectExpressionWatch(QObject *parent)
QHash< int, QDeclarativeDebugObjectQuery * > objectQuery
QDeclarativeDebugContextReference m_context
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
QDeclarativeDebugObjectQuery * queryObject(const QDeclarativeDebugObjectReference &, QObject *parent=0)
QDeclarativeDebugObjectReference object() const
void append(const T &t)
Inserts value at the end of the list.
QList< QDeclarativeDebugObjectReference > m_objects
QDeclarativeDebugExpressionQuery(QObject *)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QDeclarativeEngineDebug * m_client
virtual void statusChanged(Status status)
QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *)
void message(const QByteArray &)
bool needsMoreData() const
QDeclarativeEngineDebug * m_client
QDeclarativeDebugEnginesQuery * queryAvailableEngines(QObject *parent=0)
QDeclarativeDebugWatch(QObject *)
QDeclarativeDebugObjectReference()
virtual ~QDeclarativeDebugEnginesQuery()
Q_CORE_EXPORT void qWarning(const char *,...)
QString className() const
bool resetBindingForObject(int objectDebugId, const QString &propertyName)
static const char * data(const QByteArray &arr)
QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject *=0)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
QDeclarativeEngineDebug * m_client
void statusChanged(QDeclarativeEngineDebug::Status status)
QList< QDeclarativeDebugContextReference > contexts() const
virtual void messageReceived(const QByteArray &)
QDeclarativeDebugPropertyWatch * addWatch(const QDeclarativeDebugPropertyReference &, QObject *parent=0)
The State element defines configurations of objects and properties.
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
bool setBindingForObject(int objectDebugId, const QString &propertyName, const QVariant &bindingExpression, bool isLiteralValue, QString source=QString(), int line=-1)
QString valueTypeName() const
void valueChanged(const QByteArray &name, const QVariant &value)
static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugEnginesQuery *)
QDeclarativeDebugFileReference m_source
int contextDebugId() const
int objectDebugId() const
#define Q_DECLARE_PUBLIC(Class)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
QList< QDeclarativeDebugObjectReference > m_children
~QDeclarativeEngineDebugPrivate()
QDeclarativeDebugObjectQuery(QObject *)
QList< QDeclarativeDebugPropertyReference > properties() const
void setColumnNumber(int)
QDeclarativeDebugQuery(QObject *)
QList< QDeclarativeDebugEngineReference > engines() const
QVariant expression() const
int objectDebugId() const
QString expression() const
QObject * parent() const
Returns a pointer to the parent object.
T & last()
Returns a reference to the last item in the list.
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
static QByteArray methodName(const char *signature, int nameLength)
Makes a deep copy of the first nameLength characters of the given method signature and returns the co...
QList< QDeclarativeDebugPropertyReference > m_properties
QDeclarativeEngineDebugClient * client
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
QDeclarativeDebugRootContextQuery * queryRootContexts(const QDeclarativeDebugEngineReference &, QObject *parent=0)
QDeclarativeEngineDebug * m_client
QVariant property(const char *name) const
Returns the value of the object's name property.
QDeclarativeDebugPropertyWatch(QObject *parent)
bool hasNotifySignal() const
QList< QDeclarativeDebugObjectReference > objects() const
QDeclarativeDebugContextReference()
QDeclarativeDebugEnginesQuery(QObject *)
The QDataStream class provides serialization of binary data to a QIODevice.
QDeclarativeDebugEngineReference & operator=(const QDeclarativeDebugEngineReference &)
virtual ~QDeclarativeDebugObjectQuery()
T value() const
Returns the stored value converted to the template type T.
QDeclarativeDebugEngineReference()
void setUrl(const QUrl &)
QDeclarativeEngineDebug * m_client
bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody)
QList< QDeclarativeDebugObjectReference > children() const
QDeclarativeEngineDebugPrivate * priv
QDeclarativeDebugContextReference & operator=(const QDeclarativeDebugContextReference &)