src/declarative/debugger/qdeclarativedebug.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
   560     }
   560     }
   561 
   561 
   562     return query;
   562     return query;
   563 }
   563 }
   564 
   564 
       
   565 bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName,
       
   566                                                   const QVariant &bindingExpression,
       
   567                                                   bool isLiteralValue)
       
   568 {
       
   569     Q_D(QDeclarativeEngineDebug);
       
   570 
       
   571     if (d->client->isConnected() && objectDebugId != -1) {
       
   572         QByteArray message;
       
   573         QDataStream ds(&message, QIODevice::WriteOnly);
       
   574         ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue;
       
   575         d->client->sendMessage(message);
       
   576         return true;
       
   577     } else {
       
   578         return false;
       
   579     }
       
   580 }
       
   581 
       
   582 bool QDeclarativeEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName)
       
   583 {
       
   584     Q_D(QDeclarativeEngineDebug);
       
   585 
       
   586     if (d->client->isConnected() && objectDebugId != -1) {
       
   587         QByteArray message;
       
   588         QDataStream ds(&message, QIODevice::WriteOnly);
       
   589         ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName;
       
   590         d->client->sendMessage(message);
       
   591         return true;
       
   592     } else {
       
   593         return false;
       
   594     }
       
   595 }
       
   596 
       
   597 bool QDeclarativeEngineDebug::setMethodBody(int objectDebugId, const QString &methodName,
       
   598                                             const QString &methodBody)
       
   599 {
       
   600     Q_D(QDeclarativeEngineDebug);
       
   601 
       
   602     if (d->client->isConnected() && objectDebugId != -1) {
       
   603         QByteArray message;
       
   604         QDataStream ds(&message, QIODevice::WriteOnly);
       
   605         ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody;
       
   606         d->client->sendMessage(message);
       
   607         return true;
       
   608     } else {
       
   609         return false;
       
   610     }
       
   611 }
       
   612 
   565 QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent)
   613 QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent)
   566 : QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
   614 : QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
   567 {
   615 {
   568 }
   616 }
   569 
   617 
   696 {
   744 {
   697     if (m_client && m_queryId != -1) 
   745     if (m_client && m_queryId != -1) 
   698         QDeclarativeEngineDebugPrivate::remove(m_client, this);
   746         QDeclarativeEngineDebugPrivate::remove(m_client, this);
   699 }
   747 }
   700 
   748 
   701 QString QDeclarativeDebugExpressionQuery::expression() const
   749 QVariant QDeclarativeDebugExpressionQuery::expression() const
   702 {
   750 {
   703     return m_expr;
   751     return m_expr;
   704 }
   752 }
   705 
   753 
   706 QVariant QDeclarativeDebugExpressionQuery::result() const
   754 QVariant QDeclarativeDebugExpressionQuery::result() const