summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-05-06 05:15:27 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-05-06 05:15:27 (GMT)
commitf0a172d19821e37604004cd6b8fa17b998b39857 (patch)
tree28049b952cfe7da29e59d77fde0c27081e8c59d7 /src/declarative/qml
parent5edf4ed878bbe933e6ff0023cce8808b1dcff6c0 (diff)
downloadQt-f0a172d19821e37604004cd6b8fa17b998b39857.zip
Qt-f0a172d19821e37604004cd6b8fa17b998b39857.tar.gz
Qt-f0a172d19821e37604004cd6b8fa17b998b39857.tar.bz2
Beginings of an experimental QML debugger view
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmlboundsignal.cpp1
-rw-r--r--src/declarative/qml/qmlcompiler.cpp9
-rw-r--r--src/declarative/qml/qmlcomponent.cpp5
-rw-r--r--src/declarative/qml/qmlcontext.cpp2
-rw-r--r--src/declarative/qml/qmlcontext_p.h3
-rw-r--r--src/declarative/qml/qmlinstruction_p.h1
-rw-r--r--src/declarative/qml/qmlparser.cpp2
-rw-r--r--src/declarative/qml/qmlparser_p.h3
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp5
9 files changed, 28 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlboundsignal.cpp b/src/declarative/qml/qmlboundsignal.cpp
index 67e3dcf..5815dc6 100644
--- a/src/declarative/qml/qmlboundsignal.cpp
+++ b/src/declarative/qml/qmlboundsignal.cpp
@@ -99,6 +99,7 @@ QmlBoundSignalParameters::QmlBoundSignalParameters(const QMetaMethod &method,
// ### Ensure only supported types are allowed, otherwise it might crash
QMetaObjectBuilder mob;
mob.setSuperClass(&QmlBoundSignalParameters::staticMetaObject);
+ mob.setClassName("QmlBoundSignalParameters");
QList<QByteArray> paramTypes = method.parameterTypes();
QList<QByteArray> paramNames = method.parameterNames();
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 67a0a04..9ae1278 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -60,6 +60,7 @@
#include <qmlmetatype.h>
#include <QtCore/qdebug.h>
#include "private/qmlcustomparser_p_p.h"
+#include <private/qmlcontext_p.h>
#include "qmlscriptparser_p.h"
@@ -675,6 +676,7 @@ bool QmlCompiler::compileComponentFromRoot(Object *obj, int ctxt)
QmlInstruction &create = output->bytecode.last();
create.type = QmlInstruction::CreateComponent;
create.line = obj->line;
+ create.createComponent.endLine = obj->endLine;
int count = output->bytecode.count();
QmlInstruction init;
@@ -1468,7 +1470,12 @@ QObject *QmlCompiledData::TypeReference::createInstance(QmlContext *ctxt) const
QmlEngine::setContextForObject(rv, ctxt);
return rv;
} else if (component) {
- return component->create(ctxt);
+ QObject *rv = component->create(ctxt);
+ QmlContext *ctxt = qmlContext(rv);
+ if(ctxt) {
+ static_cast<QmlContextPrivate *>(QObjectPrivate::get(ctxt))->typeName = className;
+ }
+ return rv;
} else {
return 0;
}
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp
index b257d5f..027c2a8 100644
--- a/src/declarative/qml/qmlcomponent.cpp
+++ b/src/declarative/qml/qmlcomponent.cpp
@@ -462,6 +462,11 @@ QObject *QmlComponent::beginCreate(QmlContext *context)
QmlContext *ctxt =
new QmlContext(context, 0);
static_cast<QmlContextPrivate*>(ctxt->d_ptr)->url = d->cc->url;
+ if(d->start != -1) {
+ // ### FIXME
+ static_cast<QmlContextPrivate*>(ctxt->d_ptr)->startLine = d->cc->bytecode.at(d->start - 1).line;
+ static_cast<QmlContextPrivate*>(ctxt->d_ptr)->endLine = d->cc->bytecode.at(d->start - 1).createComponent.endLine;
+ }
ctxt->activate();
QmlVME vme;
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index 68453c3..7187c4c 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -53,7 +53,7 @@
QT_BEGIN_NAMESPACE
QmlContextPrivate::QmlContextPrivate()
- : parent(0), engine(0), highPriorityCount(0)
+ : parent(0), engine(0), highPriorityCount(0), startLine(-1), endLine(-1)
{
}
diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h
index 40848fb..d7c6d29 100644
--- a/src/declarative/qml/qmlcontext_p.h
+++ b/src/declarative/qml/qmlcontext_p.h
@@ -70,6 +70,9 @@ public:
QScriptValueList scopeChain;
QUrl url;
+ QByteArray typeName;
+ int startLine;
+ int endLine;
void init();
diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h
index 01bdfdd..e9c81d6 100644
--- a/src/declarative/qml/qmlinstruction_p.h
+++ b/src/declarative/qml/qmlinstruction_p.h
@@ -275,6 +275,7 @@ public:
} assignSignalObject;
struct {
int count;
+ int endLine;
} createComponent;
struct {
int id;
diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp
index d68eb68..a6cb2ca 100644
--- a/src/declarative/qml/qmlparser.cpp
+++ b/src/declarative/qml/qmlparser.cpp
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
using namespace QmlParser;
QmlParser::Object::Object()
-: type(-1), metatype(0), extObjectData(0), defaultProperty(0), line(-1), column(-1)
+: type(-1), metatype(0), extObjectData(0), defaultProperty(0), line(-1), column(-1), endLine(-1), endColumn(-1)
{
}
diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h
index 2c9b0f1..aa22928 100644
--- a/src/declarative/qml/qmlparser_p.h
+++ b/src/declarative/qml/qmlparser_p.h
@@ -106,6 +106,9 @@ namespace QmlParser
qint64 line;
qint64 column;
+ qint64 endLine;
+ qint64 endColumn;
+
struct DynamicProperty {
DynamicProperty();
DynamicProperty(const DynamicProperty &);
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index aed17d6..8be0e5a 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -235,6 +235,11 @@ Object *ProcessAST::defineObjectBinding_helper(int line,
_scope.removeLast();
obj->line = line;
+ if(initializer) {
+ obj->endLine = initializer->rbraceToken.startLine;
+ obj->endColumn = initializer->rbraceToken.startColumn;
+ }
+
if (propertyCount) {
Property *prop = currentProperty();
Value *v = new Value;