diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp | 21 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp | 32 |
2 files changed, 37 insertions, 16 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp index f191fe9679..9514204392 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp @@ -209,19 +209,32 @@ QVariant QQmlEngineDebugServiceImpl::valueContents(QVariant value) const } if (QQmlValueTypeFactory::isValueType(userType)) { + switch (userType) { + case QMetaType::QRect: + case QMetaType::QRectF: + case QMetaType::QPoint: + case QMetaType::QPointF: + case QMetaType::QSize: + case QMetaType::QSizeF: + case QMetaType::QFont: + // Don't call the toString() method on those. The stream operators are better. + return value; + default: + break; + } + const QMetaObject *mo = QQmlValueTypeFactory::metaObjectForMetaType(userType); if (mo) { - int toStringIndex = mo->indexOfMethod("toString"); + int toStringIndex = mo->indexOfMethod("toString()"); if (toStringIndex != -1) { QMetaMethod mm = mo->method(toStringIndex); - QMetaType info(userType); QString s; - if (info.flags() & QMetaType::IsGadget - && mm.invokeOnGadget(value.data(), Q_RETURN_ARG(QString, s))) + if (mm.invokeOnGadget(value.data(), Q_RETURN_ARG(QString, s))) return s; } } + // We expect all QML value types to either have a toString() method or stream operators return value; } diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp index 0d69b2ab66..a2bc4c09a3 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp @@ -296,10 +296,11 @@ void QQmlProfilerServiceImpl::stopProfiling(QJSEngine *engine) for (QMultiHash<QJSEngine *, QQmlAbstractProfilerAdapter *>::iterator i(m_engineProfilers.begin()); i != m_engineProfilers.end(); ++i) { if (i.value()->isRunning()) { + m_startTimes.insert(-1, i.value()); if (engine == 0 || i.key() == engine) { - m_startTimes.insert(-1, i.value()); stopping << i.value(); } else { + reporting << i.value(); stillRunning = true; } } @@ -369,25 +370,32 @@ void QQmlProfilerServiceImpl::sendMessages() } } + bool stillRunning = false; + for (const QQmlAbstractProfilerAdapter *profiler : qAsConst(m_engineProfilers)) { + if (profiler->isRunning()) { + stillRunning = true; + break; + } + } + if (m_waitingForStop) { - //indicate completion + // EndTrace can be sent multiple times, as it's engine specific. messages << traceEnd.data(); - QQmlDebugPacket ds; - ds << static_cast<qint64>(-1) << static_cast<qint32>(Complete); - messages << ds.data(); - m_waitingForStop = false; + if (!stillRunning) { + // Complete is only sent once, when no engines are running anymore. + QQmlDebugPacket ds; + ds << static_cast<qint64>(-1) << static_cast<qint32>(Complete); + messages << ds.data(); + m_waitingForStop = false; + } } emit messagesToClient(name(), messages); // Restart flushing if any profilers are still running - for (const QQmlAbstractProfilerAdapter *profiler : qAsConst(m_engineProfilers)) { - if (profiler->isRunning()) { - emit startFlushTimer(); - break; - } - } + if (stillRunning) + emit startFlushTimer(); } void QQmlProfilerServiceImpl::stateAboutToBeChanged(QQmlDebugService::State newState) |