From 7545deafbe6aa996aa9c3ec7297a312692b22ff4 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 5 Apr 2011 16:39:52 +0200 Subject: QDeclarativeDebug: Warn user for Qt configured with -no-declarative-debug Print a warning if the user passes -qmljsdebugger on command line, but Qt is configured with -no-declarative-debug Change-Id: I72c9ffad9631ffe8582c13e3a4e798b102d0efad Reviewed-by: Christiaan Janssen --- src/declarative/debugger/qdeclarativedebughelper.cpp | 2 ++ src/declarative/debugger/qdeclarativedebugserver.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/declarative/debugger/qdeclarativedebughelper.cpp b/src/declarative/debugger/qdeclarativedebughelper.cpp index 0478209..93f7423 100644 --- a/src/declarative/debugger/qdeclarativedebughelper.cpp +++ b/src/declarative/debugger/qdeclarativedebughelper.cpp @@ -65,10 +65,12 @@ void QDeclarativeDebugHelper::setAnimationSlowDownFactor(qreal factor) } void QDeclarativeDebugHelper::enableDebugging() { +#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL if (!QDeclarativeEnginePrivate::qml_debugging_enabled) { qWarning("Qml debugging is enabled. Only use this in a safe environment!"); } QDeclarativeEnginePrivate::qml_debugging_enabled = true; +#endif } QT_END_NAMESPACE diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp index ea3d9a3..14e7187 100644 --- a/src/declarative/debugger/qdeclarativedebugserver.cpp +++ b/src/declarative/debugger/qdeclarativedebugserver.cpp @@ -159,8 +159,8 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() if (!commandLineTested) { commandLineTested = true; -#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL QApplicationPrivate *appD = static_cast(QObjectPrivate::get(qApp)); +#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL // ### remove port definition when protocol is changed int port = 0; bool block = false; @@ -204,6 +204,12 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() appD->qmljsDebugArgumentsString()).toAscii().constData()); } } +#else + if (!appD->qmljsDebugArgumentsString().isEmpty()) { + qWarning(QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " + "QtDeclarative is not configured for debugging.").arg( + appD->qmljsDebugArgumentsString()).toAscii().constData()); + } #endif } -- cgit v0.12 From 5f741649cff218367100f3a9d7cdf9e0d393e327 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 6 Apr 2011 12:41:05 +0200 Subject: QmlViewer: Enable remote qml debugging Allow users to use qmlviewer for profiling. Change-Id: I4bddabceade17260159ff5b46b35072afb204ff6 Task-number: QTBUG-18595 Reviewed-by: Christiaan Janssen --- tools/qml/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 6ca6bfb..b2c7f4f 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -51,6 +51,7 @@ #include #include #include "qdeclarativetester.h" +#include QT_USE_NAMESPACE @@ -538,6 +539,8 @@ int main(int argc, char ** argv) QApplication::setGraphicsSystem("raster"); #endif + QDeclarativeDebugHelper::enableDebugging(); + Application app(argc, argv); app.setApplicationName("QtQmlViewer"); app.setOrganizationName("Nokia"); -- cgit v0.12