From: Kai Koehne Date: Sat, 9 Oct 2010 19:20:15 +0000 (+0200) Subject: QmlApp: Only use QMLJSDEBUGGER define to activate qml debugging X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0a8c34d382a64f21c4;p=qt-creator-jp%2Fqt-creator-jp.git QmlApp: Only use QMLJSDEBUGGER define to activate qml debugging Don't confuse users by two defines they have to comment in when they just want to 'debug': Instead QMLJSDEBUGGER now activates both the Js Debugger & and the QmlObserver services. Finetuning can still be done by using the (undocumented) NO_JSDEBUGGER, NO_QMLOBSERVER defines. --- diff --git a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri index 6abc94f3ac..50135803cd 100644 --- a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri +++ b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri @@ -9,14 +9,16 @@ contains(CONFIG, dll) { } ## Input +!contains(DEFINES, NO_JSDEBUGGER) { HEADERS += \ include/jsdebuggeragent.h \ include/qmljsdebugger_global.h SOURCES += \ jsdebuggeragent.cpp +} -contains(DEFINES, QMLOBSERVER) { +!contains(DEFINES, NO_QMLOBSERVER) { include($$PWD/editor/editor.pri) HEADERS += \ diff --git a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro index 1fc040262e..013795a1db 100644 --- a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro +++ b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro @@ -2,8 +2,6 @@ TEMPLATE = lib CONFIG+=dll TARGET = QmlJSDebugger -DEFINES += QMLOBSERVER - unix:QMAKE_CXXFLAGS_DEBUG += -O3 include(../../../../src/qtcreatorlibrary.pri) diff --git a/share/qtcreator/qml/qmlobserver/qmlobserver.pro b/share/qtcreator/qml/qmlobserver/qmlobserver.pro index d05ca7ee1e..379ca5fb04 100644 --- a/share/qtcreator/qml/qmlobserver/qmlobserver.pro +++ b/share/qtcreator/qml/qmlobserver/qmlobserver.pro @@ -1,5 +1,4 @@ TEMPLATE = app -DEFINES += QMLOBSERVER ### FIXME: only debug plugins are now supported. CONFIG -= release diff --git a/share/qtcreator/templates/qmlapp/app.pro b/share/qtcreator/templates/qmlapp/app.pro index cb0abcbfd3..c27c04e91e 100644 --- a/share/qtcreator/templates/qmlapp/app.pro +++ b/share/qtcreator/templates/qmlapp/app.pro @@ -20,10 +20,9 @@ DEFINES += NETWORKACCESS # TARGETUID3 # symbian:TARGET.UID3 = 0xE1111234 -# Define QMLJSDEBUGGER to enable basic debugging (setting breakpoints etc) -# Define QMLOBSERVER for advanced features (requires experimental QmlInspector plugin!) -#DEFINES += QMLJSDEBUGGER -#DEFINES += QMLOBSERVER +# Define QMLJSDEBUGGER to allow debugging of QML +# (This might significantly increase build time) +# DEFINES += QMLJSDEBUGGER # The .cpp file which was generated for your project. Feel free to hack it. SOURCES += main.cpp diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp index 2e4adfc3b2..3e2ed95be8 100644 --- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -7,10 +7,10 @@ #include #include -#if defined(QMLJSDEBUGGER) +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) #include #endif -#if defined(QMLOBSERVER) +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) #include #endif @@ -53,10 +53,10 @@ QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : { connect(engine(), SIGNAL(quit()), SLOT(close())); setResizeMode(QDeclarativeView::SizeRootObjectToView); -#ifdef QMLJSDEBUGGER +#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) new QmlJSDebugger::JSDebuggerAgent(engine()); #endif -#ifdef QMLOBSERVER +#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) new QmlJSDebugger::QDeclarativeViewObserver(this, parent); #endif } diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri index 319587d782..5c8ff0585f 100644 --- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri +++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri @@ -7,10 +7,6 @@ SOURCES += $$PWD/qmlapplicationviewer.cpp HEADERS += $$PWD/qmlapplicationviewer.h INCLUDEPATH += $$PWD -contains(DEFINES, QMLOBSERVER) { - DEFINES *= QMLJSDEBUGGER -} - defineTest(minQtVersion) { maj = $$1 min = $$2