diff options
Diffstat (limited to 'src/plugins/qmltooling')
8 files changed, 19 insertions, 27 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp index f72b8a51f9..2b8dcc19ee 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp @@ -660,7 +660,7 @@ bool QQmlEngineDebugServiceImpl::setBinding(int objectId, filename, line, column); QQmlPropertyPrivate::takeSignalExpression(property, qmlExpression); } else if (property.isProperty()) { - QQmlBinding *binding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, expression.toString(), object, QQmlContextData::get(context), filename, line, column); + QQmlBinding *binding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, expression.toString(), object, QQmlContextData::get(context), filename, line); binding->setTarget(property); QQmlPropertyPrivate::setBinding(binding); binding->update(); diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlnativedebugservice.cpp index 5b96163b48..14dfc5356e 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qqmlnativedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlnativedebugservice.cpp @@ -336,18 +336,16 @@ void NativeDebugger::handleBacktrace(QJsonObject *response, const QJsonObject &a QJsonArray frameArray; QV4::ExecutionContext *executionContext = m_engine->currentContext; for (int i = 0; i < limit && executionContext; ++i) { - QV4::Heap::FunctionObject *heapFunctionObject = executionContext->getFunctionObject(); - if (heapFunctionObject) { + if (QV4::Function *function = executionContext->getFunction()) { QJsonObject frame; frame[QStringLiteral("language")] = QStringLiteral("js"); frame[QStringLiteral("context")] = encodeContext(executionContext); - if (QV4::Function *function = heapFunctionObject->function) { - if (QV4::Heap::String *functionName = function->name()) - frame[QStringLiteral("function")] = functionName->toQString(); - frame[QStringLiteral("file")] = function->sourceFile(); - } + if (QV4::Heap::String *functionName = function->name()) + frame[QStringLiteral("function")] = functionName->toQString(); + frame[QStringLiteral("file")] = function->sourceFile(); + int line = executionContext->d()->lineNumber; frame[QStringLiteral("line")] = (line < 0 ? -line : line); @@ -667,11 +665,9 @@ void NativeDebugger::aboutToThrow() QV4::Function *NativeDebugger::getFunction() const { - QV4::Scope scope(m_engine); QV4::ExecutionContext *context = m_engine->currentContext; - QV4::ScopedFunctionObject function(scope, context->getFunctionObject()); - if (function) - return function->function(); + if (QV4::Function *function = context->getFunction()) + return function; else return context->d()->engine->globalCode; } @@ -683,10 +679,8 @@ void NativeDebugger::pauseAndWait() event.insert(QStringLiteral("event"), QStringLiteral("break")); event.insert(QStringLiteral("language"), QStringLiteral("js")); if (QV4::ExecutionContext *executionContext = m_engine->currentContext) { - QV4::Heap::FunctionObject *heapFunctionObject = executionContext->getFunctionObject(); - if (heapFunctionObject) { - if (QV4::Function *function = heapFunctionObject->function) - event.insert(QStringLiteral("file"), function->sourceFile()); + if (QV4::Function *function = executionContext->getFunction()) { + event.insert(QStringLiteral("file"), function->sourceFile()); int line = executionContext->d()->lineNumber; event.insert(QStringLiteral("line"), (line < 0 ? -line : line)); } diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp index b2db23d78c..aed2759383 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp @@ -60,7 +60,7 @@ QV4::CallContext *QV4DataCollector::findContext(int frame) QV4::ExecutionContext *ctx = engine()->currentContext; while (ctx) { QV4::CallContext *cCtxt = ctx->asCallContext(); - if (cCtxt && cCtxt->d()->function) { + if (cCtxt && cCtxt->d()->v4Function) { if (frame < 1) return cCtxt; --frame; diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp index 44810dd4cb..5cc2043cb1 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp @@ -252,9 +252,8 @@ QV4::Function *QV4Debugger::getFunction() const { QV4::Scope scope(m_engine); QV4::ExecutionContext *context = m_engine->currentContext; - QV4::ScopedFunctionObject function(scope, context->getFunctionObject()); - if (function) - return function->function(); + if (QV4::Function *function = context->getFunction()) + return function; else return context->d()->engine->globalCode; } diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp index a2d2fff72b..d5cc765ea8 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp @@ -41,6 +41,7 @@ #include <private/qv4script_p.h> #include <private/qqmlcontext_p.h> +#include <private/qv4qmlcontext_p.h> #include <private/qv4qobjectwrapper_p.h> #include <QtQml/qqmlengine.h> @@ -81,7 +82,7 @@ void JavaScriptJob::run() } } if (!engine->qmlContext()) { - engine->pushContext(ctx->newQmlContext(QQmlContextData::get(qmlRootContext), + engine->pushContext(QV4::QmlContext::create(ctx, QQmlContextData::get(qmlRootContext), &scopeObject)); ctx = engine->currentContext; } @@ -201,7 +202,7 @@ void ValueLookupJob::run() QV4::ExecutionEngine *engine = collector->engine(); if (engine->qmlEngine() && !engine->qmlContext()) { scopeObject.reset(new QObject); - engine->pushContext(engine->currentContext->newQmlContext( + engine->pushContext(QV4::QmlContext::create(engine->currentContext, QQmlContextData::get(engine->qmlEngine()->rootContext()), scopeObject.data())); } diff --git a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp index 107d54c626..ca7c76ab50 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp @@ -234,9 +234,7 @@ bool GlobalInspector::syncSelectedItems(const QList<QQuickItem *> &items) bool selectionChanged = false; // Disconnect and remove items that are no longer selected - foreach (const QPointer<QQuickItem> &item, m_selectedItems) { - if (!item) // Don't see how this can happen due to handling of destroyed() - continue; + foreach (QQuickItem *item, m_selectedItems) { if (items.contains(item)) continue; diff --git a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h index 338eee14c3..f7b325c454 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h +++ b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h @@ -84,7 +84,7 @@ private: bool syncSelectedItems(const QList<QQuickItem *> &items); // Hash< object to be destroyed, QPair<destroy eventId, object debugId> > - QList<QPointer<QQuickItem> > m_selectedItems; + QList<QQuickItem *> m_selectedItems; QHash<QQuickItem *, SelectionHighlight *> m_highlightItems; QList<QQuickWindowInspector *> m_windowInspectors; int m_eventId; diff --git a/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp index 2525500e65..7d260a4d2a 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp @@ -153,7 +153,7 @@ bool QQuickWindowInspector::eventFilter(QObject *obj, QEvent *event) case QEvent::MouseButtonDblClick: m_tool->mouseDoubleClickEvent(static_cast<QMouseEvent*>(event)); return true; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) case QEvent::Wheel: return true; #endif |