diff --git a/share/qtcreator/qml/qmljsdebugger/include/qt_private/qdeclarativedebughelper_p.h b/share/qtcreator/qml/qmljsdebugger/include/qt_private/qdeclarativedebughelper_p.h index d676ebce4d1e04f6b4335d21b1c42ebd0db1fbd9..4f57be9a5a4088011879c9742442d1781f636a88 100644 --- a/share/qtcreator/qml/qmljsdebugger/include/qt_private/qdeclarativedebughelper_p.h +++ b/share/qtcreator/qml/qmljsdebugger/include/qt_private/qdeclarativedebughelper_p.h @@ -59,6 +59,10 @@ class QMLJSDEBUGGER_EXTERN QDeclarativeDebugHelper public: static QScriptEngine *getScriptEngine(QDeclarativeEngine *engine); static void setAnimationSlowDownFactor(qreal factor); + + // Enables remote debugging functionality + // Only use this for debugging in a safe environment! + static void enableDebugging(); }; QT_END_NAMESPACE diff --git a/share/qtcreator/templates/qmlapp/app.pro b/share/qtcreator/templates/qmlapp/app.pro index 73a99b843e8ea7899d71f1b5c3f66c322b3f8eae..5dcaeb3f68bdb4b24e4a8c863b9de700b536d8ae 100644 --- a/share/qtcreator/templates/qmlapp/app.pro +++ b/share/qtcreator/templates/qmlapp/app.pro @@ -20,7 +20,7 @@ DEFINES += NETWORKACCESS # TARGETUID3 # symbian:TARGET.UID3 = 0xE1111234 -# Define QMLJSDEBUGGER to allow debugging of QML +# Define QMLJSDEBUGGER to allow debugging of QML in debug builds # (This might significantly increase build time) # DEFINES += QMLJSDEBUGGER diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp index 5fdc94c8cd8e0db3c01bf24c5d2f14f9895e95d7..59d9750edd66850b87e87446f247cd5e7e106722 100644 --- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -16,6 +16,10 @@ #include <QtDeclarative/QDeclarativeEngine> #include <QtDeclarative/QDeclarativeContext> +#if defined(QMLJSDEBUGGER) +#include <qt_private/qdeclarativedebughelper_p.h> +#endif + #if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) #include <jsdebuggeragent.h> #endif @@ -30,6 +34,22 @@ #include <aknappui.h> #endif // Q_OS_SYMBIAN && ORIENTATIONLOCK +#if defined(QMLJSDEBUGGER) + +// Enable debugging before any QDeclarativeEngine is created +struct QmlJsDebuggingEnabler +{ + QmlJsDebuggingEnabler() + { + QDeclarativeDebugHelper::enableDebugging(); + } +}; + +// Execute code in constructor before first QDeclarativeEngine is instantiated +static QmlJsDebuggingEnabler enableDebuggingHelper; + +#endif // QMLJSDEBUGGER + class QmlApplicationViewerPrivate { QString mainQmlFile; diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp index 807f4274923236fee06cbc489c0a62dfbe77fce1..3a3586229abd6dcdb8d642ce7a7cd70fbd64526d 100644 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp @@ -477,7 +477,7 @@ bool QmlStandaloneApp::updateFiles(const QList<QmlAppGeneratedFileInfo> &list, Q return true; } -const int QmlStandaloneApp::StubVersion = 9; +const int QmlStandaloneApp::StubVersion = 10; } // namespace Internal } // namespace Qt4ProjectManager