diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-07-27 13:35:38 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-07-28 07:34:57 (GMT) |
commit | 354bd0287c4178cbf512f10b5624a84c99e1d606 (patch) | |
tree | b470de79a5b51dc7c1a20d64cccf86d49721a7a7 /src/declarative/qml/qdeclarativevme.cpp | |
parent | 104e9d2b3f8ac981a277cb0d63a1e5be8e352275 (diff) | |
download | Qt-354bd0287c4178cbf512f10b5624a84c99e1d606.zip Qt-354bd0287c4178cbf512f10b5624a84c99e1d606.tar.gz Qt-354bd0287c4178cbf512f10b5624a84c99e1d606.tar.bz2 |
QtDeclarative: Give name to function bindings and signals.
Currently, bindings and signals are annonymous javascript functions.
If one give them a name, a proper name is then shown in the javascript
debugger.
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/declarative/qml/qdeclarativevme.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativevme.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index 3247f85..4e41c22 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -621,14 +621,15 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, case QDeclarativeInstruction::StoreSignal: { QObject *target = stack.top(); - QObject *context = stack.at(stack.count() - 1 - instr.assignBinding.context); - + QObject *context = stack.at(stack.count() - 1 - instr.storeSignal.context); + QMetaMethod signal = target->metaObject()->method(instr.storeSignal.signalIndex); QDeclarativeBoundSignal *bs = new QDeclarativeBoundSignal(target, signal, target); QDeclarativeExpression *expr = new QDeclarativeExpression(ctxt, context, primitives.at(instr.storeSignal.value)); expr->setSourceLocation(comp->name, instr.line); + static_cast<QDeclarativeExpressionPrivate *>(QObjectPrivate::get(expr))->name = datas.at(instr.storeSignal.name); bs->setExpression(expr); } break; |