OSDN Git Service

QmlApp: Only use QMLJSDEBUGGER define to activate qml debugging
authorKai Koehne <kai.koehne@nokia.com>
Sat, 9 Oct 2010 19:20:15 +0000 (21:20 +0200)
committerdt <qtc-committer@nokia.com>
Wed, 13 Oct 2010 14:52:58 +0000 (16:52 +0200)
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.

share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri
share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro
share/qtcreator/qml/qmlobserver/qmlobserver.pro
share/qtcreator/templates/qmlapp/app.pro
share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp
share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri

index 6abc94f..5013580 100644 (file)
@@ -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 += \
index 1fc0402..013795a 100644 (file)
@@ -2,8 +2,6 @@ TEMPLATE = lib
 CONFIG+=dll
 TARGET = QmlJSDebugger
 
-DEFINES += QMLOBSERVER
-
 unix:QMAKE_CXXFLAGS_DEBUG += -O3
 
 include(../../../../src/qtcreatorlibrary.pri)
index d05ca7e..379ca5f 100644 (file)
@@ -1,5 +1,4 @@
 TEMPLATE = app
-DEFINES += QMLOBSERVER
 
 ### FIXME: only debug plugins are now supported.
 CONFIG -= release
index cb0abcb..c27c04e 100644 (file)
@@ -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
index 2e4adfc..3e2ed95 100644 (file)
@@ -7,10 +7,10 @@
 #include <QtDeclarative/QDeclarativeEngine>
 #include <QtDeclarative/QDeclarativeContext>
 
-#if defined(QMLJSDEBUGGER)
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
 #include <jsdebuggeragent.h>
 #endif
-#if defined(QMLOBSERVER)
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
 #include <qdeclarativeviewobserver.h>
 #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
 }
index 319587d..5c8ff05 100644 (file)
@@ -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