diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-24 16:37:45 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-24 18:27:41 +0100 |
commit | 22041acdfe85c9a9b814e11cd86e8ee5a55be82d (patch) | |
tree | 1b4d1bfa0ebba9e5d1495b5ca7055dba94642c46 /src/qml/qml | |
parent | 6ae57f01bb1495a74b23a81c590672ce788d5400 (diff) | |
parent | 2407cd29e628671f7f5144e0d241d4249a3ab612 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/imports/dialogs/qquickmessagedialog.cpp
src/imports/dialogs/qquickmessagedialog_p.h
src/qml/debugger/qqmlprofilerservice_p.h
src/qml/jsruntime/qv4regexpobject.cpp
tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlboundsignal.cpp | 11 | ||||
-rw-r--r-- | src/qml/qml/qqmlboundsignal_p.h | 1 | ||||
-rw-r--r-- | src/qml/qml/qqmlcompiler.cpp | 1 | ||||
-rw-r--r-- | src/qml/qml/qqmlinstruction_p.h | 4 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 11 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype_p.h | 1 |
6 files changed, 29 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index 68160edf5e..bc56fe1f2d 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -136,6 +136,17 @@ QString QQmlBoundSignalExpression::expression() const } } +QV4::Function *QQmlBoundSignalExpression::function() const +{ + if (m_expressionFunctionValid) { + Q_ASSERT (context() && engine()); + QV4::Scope scope(QQmlEnginePrivate::get(engine())->v4engine()); + QV4::Scoped<QV4::FunctionObject> v(scope, m_v8function.value()); + return v ? v->function : 0; + } + return 0; +} + // Parts of this function mirror code in QQmlExpressionPrivate::value() and v8value(). // Changes made here may need to be made there and vice versa. void QQmlBoundSignalExpression::evaluate(void **a) diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h index feb79d5484..fe0dbd380e 100644 --- a/src/qml/qml/qqmlboundsignal_p.h +++ b/src/qml/qml/qqmlboundsignal_p.h @@ -90,6 +90,7 @@ public: quint16 lineNumber() const { return m_line; } quint16 columnNumber() const { return m_column; } QString expression() const; + QV4::Function *function() const; QObject *target() const { return m_target; } QQmlEngine *engine() const { return context() ? context()->engine : 0; } diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index cd0dea975b..e36f3fd967 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -1681,6 +1681,7 @@ static AST::FunctionDeclaration *convertSignalHandlerExpressionToFunctionDeclara AST::FunctionBody *body = new (pool) AST::FunctionBody(elements); AST::FunctionDeclaration *functionDeclaration = new (pool) AST::FunctionDeclaration(jsEngine->newStringRef(signalName), paramList, body); + functionDeclaration->functionToken = statement->firstSourceLocation(); return functionDeclaration; } diff --git a/src/qml/qml/qqmlinstruction_p.h b/src/qml/qml/qqmlinstruction_p.h index aeda9832f3..d76c9f9f64 100644 --- a/src/qml/qml/qqmlinstruction_p.h +++ b/src/qml/qml/qqmlinstruction_p.h @@ -151,8 +151,10 @@ QT_BEGIN_NAMESPACE #ifdef QML_THREADED_VME_INTERPRETER # define QML_INSTR_HEADER void *code; +# define QML_INSTR_HEADER_INIT this->code = 0; #else # define QML_INSTR_HEADER quint8 instructionType; +# define QML_INSTR_HEADER_INIT this->instructionType = 0; #endif #define QML_INSTR_ENUM(I, FMT) I, @@ -547,6 +549,8 @@ FOR_EACH_QML_INSTR(QML_INSTR_META_TEMPLATE); template<int Instr> class QQmlInstructionData : public QQmlInstructionMeta<Instr>::DataType { +public: + QQmlInstructionData() : QQmlInstructionMeta<Instr>::DataType() { QML_INSTR_HEADER_INIT } }; QT_END_NAMESPACE diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 1dd8ce0e3e..90d3ca3308 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1836,6 +1836,17 @@ QList<QQmlType*> QQmlMetaType::qmlTypes() } /*! + Returns the list of all registered types. +*/ +QList<QQmlType*> QQmlMetaType::qmlAllTypes() +{ + QReadLocker lock(metaTypeDataLock()); + QQmlMetaTypeData *data = metaTypeData(); + + return data->types; +} + +/*! Returns the list of registered QML singleton types. */ QList<QQmlType*> QQmlMetaType::qmlSingletonTypes() diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h index 6c19da6b15..019e6b8821 100644 --- a/src/qml/qml/qqmlmetatype_p.h +++ b/src/qml/qml/qqmlmetatype_p.h @@ -80,6 +80,7 @@ public: static QList<QString> qmlTypeNames(); static QList<QQmlType*> qmlTypes(); static QList<QQmlType*> qmlSingletonTypes(); + static QList<QQmlType*> qmlAllTypes(); static QQmlType *qmlType(const QString &qualifiedName, int, int); static QQmlType *qmlType(const QHashedStringRef &name, const QHashedStringRef &module, int, int); |