diff --git a/share/qtcreator/qml/qmljsdebugger/include/qmljsdebugger_global.h b/share/qtcreator/qml/qmljsdebugger/include/qmljsdebugger_global.h
index 42b0c2fa078..9d6f0884fd9 100644
--- a/share/qtcreator/qml/qmljsdebugger/include/qmljsdebugger_global.h
+++ b/share/qtcreator/qml/qmljsdebugger/include/qmljsdebugger_global.h
@@ -43,7 +43,7 @@
# define QMLJSDEBUGGER_EXPORT
# define QMLJSDEBUGGER_EXTERN Q_DECL_IMPORT
# else
-# define QMLJSDEBUGGER_EXPORT Q_DECL_IMPORT
+# define QMLJSDEBUGGER_EXPORT
# define QMLJSDEBUGGER_EXTERN Q_DECL_IMPORT
#endif
diff --git a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri
index fc303162734..66734cc61a6 100644
--- a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri
+++ b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri
@@ -1,67 +1,6 @@
# This file is part of Qt Creator
# It enables debugging of Qt Quick applications
-QT += declarative script
+QT += declarative
INCLUDEPATH += $$PWD/include
-DEPENDPATH += $$PWD $$PWD/include editor $$PWD/qt-private
-
-contains(CONFIG, dll) {
- DEFINES += BUILD_QMLJSDEBUGGER_LIB
-} else {
- DEFINES += BUILD_QMLJSDEBUGGER_STATIC_LIB
-}
-
-!contains(DEFINES, NO_JSDEBUGGER) {
-
- HEADERS += \
- include/jsdebuggeragent.h \
- include/qmljsdebugger_global.h
-
- SOURCES += \
- jsdebuggeragent.cpp
-}
-
-!contains(DEFINES, NO_QMLOBSERVER) {
-
- HEADERS += \
- include/qdeclarativeviewobserver.h \
- include/qdeclarativeobserverservice.h \
- include/qmlobserverconstants.h \
- editor/abstractliveedittool.h \
- editor/liveselectiontool.h \
- editor/livelayeritem.h \
- editor/livesingleselectionmanipulator.h \
- editor/liverubberbandselectionmanipulator.h \
- editor/liveselectionrectangle.h \
- editor/liveselectionindicator.h \
- editor/boundingrecthighlighter.h \
- editor/subcomponenteditortool.h \
- editor/subcomponentmasklayeritem.h \
- editor/zoomtool.h \
- editor/colorpickertool.h \
- editor/qmltoolbar.h \
- editor/toolbarcolorbox.h \
- qdeclarativeviewobserver_p.h
-
- SOURCES += \
- qdeclarativeviewobserver.cpp \
- qdeclarativeobserverservice.cpp \
- editor/abstractliveedittool.cpp \
- editor/liveselectiontool.cpp \
- editor/livelayeritem.cpp \
- editor/livesingleselectionmanipulator.cpp \
- editor/liverubberbandselectionmanipulator.cpp \
- editor/liveselectionrectangle.cpp \
- editor/liveselectionindicator.cpp \
- editor/boundingrecthighlighter.cpp \
- editor/subcomponenteditortool.cpp \
- editor/subcomponentmasklayeritem.cpp \
- editor/zoomtool.cpp \
- editor/colorpickertool.cpp \
- editor/qmltoolbar.cpp \
- editor/toolbarcolorbox.cpp
-
- RESOURCES += editor/editor.qrc
-}
-
-OTHER_FILES += qmljsdebugger.pri
+LIBS += -L$$PWD -lQmlJSDebugger
diff --git a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro
index c46322ef5c2..34d687f9b8a 100644
--- a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro
+++ b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger.pro
@@ -2,10 +2,67 @@
# It enables debugging of Qt Quick applications
TEMPLATE = lib
-CONFIG+=dll
-TARGET = QmlJSDebugger
+CONFIG += staticlib
+QT += declarative script
+INCLUDEPATH += $$PWD/include
+DEPENDPATH += $$PWD $$PWD/include editor $$PWD/qt-private
+
+DEFINES += BUILD_QMLJSDEBUGGER_STATIC_LIB
unix:QMAKE_CXXFLAGS_DEBUG += -O3
-include(../../../../src/qtcreatorlibrary.pri)
-include(qmljsdebugger-lib.pri)
+DESTDIR = $$PWD
+TARGET=qmljsdebugger
+CONFIG(debug, debug|release) {
+ windows:TARGET=qmljsdebuggerd
+}
+
+# JS Debugging
+HEADERS += \
+ include/jsdebuggeragent.h \
+ include/qmljsdebugger_global.h
+
+SOURCES += \
+ jsdebuggeragent.cpp
+
+HEADERS += \
+ include/qdeclarativeviewobserver.h \
+ include/qdeclarativeobserverservice.h \
+ include/qmlobserverconstants.h \
+ editor/abstractliveedittool.h \
+ editor/liveselectiontool.h \
+ editor/livelayeritem.h \
+ editor/livesingleselectionmanipulator.h \
+ editor/liverubberbandselectionmanipulator.h \
+ editor/liveselectionrectangle.h \
+ editor/liveselectionindicator.h \
+ editor/boundingrecthighlighter.h \
+ editor/subcomponenteditortool.h \
+ editor/subcomponentmasklayeritem.h \
+ editor/zoomtool.h \
+ editor/colorpickertool.h \
+ editor/qmltoolbar.h \
+ editor/toolbarcolorbox.h \
+ qdeclarativeviewobserver_p.h
+
+SOURCES += \
+ qdeclarativeviewobserver.cpp \
+ qdeclarativeobserverservice.cpp \
+ editor/abstractliveedittool.cpp \
+ editor/liveselectiontool.cpp \
+ editor/livelayeritem.cpp \
+ editor/livesingleselectionmanipulator.cpp \
+ editor/liverubberbandselectionmanipulator.cpp \
+ editor/liveselectionrectangle.cpp \
+ editor/liveselectionindicator.cpp \
+ editor/boundingrecthighlighter.cpp \
+ editor/subcomponenteditortool.cpp \
+ editor/subcomponentmasklayeritem.cpp \
+ editor/zoomtool.cpp \
+ editor/colorpickertool.cpp \
+ editor/qmltoolbar.cpp \
+ editor/toolbarcolorbox.cpp
+
+RESOURCES += editor/editor.qrc
+
+OTHER_FILES += qmljsdebugger.pri
diff --git a/share/qtcreator/qml/qmlobserver/qmlobserver.pro b/share/qtcreator/qml/qmlobserver/qmlobserver.pro
index cd81702cbb3..b442d957967 100644
--- a/share/qtcreator/qml/qmlobserver/qmlobserver.pro
+++ b/share/qtcreator/qml/qmlobserver/qmlobserver.pro
@@ -2,20 +2,17 @@ TEMPLATE = app
CONFIG += qt uic
-### FIXME: only debug plugins are now supported.
-CONFIG -= release
-CONFIG += debug
-
include(qml.pri)
SOURCES += main.cpp
-exists($$PWD/qmljsdebugger/qmljsdebugger-lib.pri) {
-# for building helpers within QT_INSTALL_DATA, we deploy the lib inside the observer directory.
- include($$PWD/qmljsdebugger/qmljsdebugger-lib.pri)
-} else {
- include($$PWD/../qmljsdebugger/qmljsdebugger-lib.pri)
+# INCLUDEPATH and library path has to be extended by qmake call
+
+DEBUGLIB=qmljsdebugger
+CONFIG(debug, debug|release) {
+ windows:DEBUGLIB = qmljsdebuggerd
}
+LIBS+=-l$$DEBUGLIB
#INCLUDEPATH += ../../include/QtDeclarative
#INCLUDEPATH += ../../src/declarative/util
diff --git a/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.pri b/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.pri
index 246f25e7845..6704a74c1b1 100644
--- a/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.pri
+++ b/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -10,49 +10,9 @@ SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD
-defineTest(minQtVersion) {
- maj = $$1
- min = $$2
- patch = $$3
- isEqual(QT_MAJOR_VERSION, $$maj) {
- isEqual(QT_MINOR_VERSION, $$min) {
- isEqual(QT_PATCH_VERSION, $$patch) {
- return(true)
- }
- greaterThan(QT_PATCH_VERSION, $$patch) {
- return(true)
- }
- }
- greaterThan(QT_MINOR_VERSION, $$min) {
- return(true)
- }
- }
- return(false)
-}
-
-contains(DEFINES, QMLJSDEBUGGER) {
- CONFIG(debug, debug|release) {
- !minQtVersion(4, 7, 1) {
- warning()
- warning("Disabling QML debugging:")
- warning()
- warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
- warning("This library requires Qt 4.7.1 or newer.")
- warning()
- DEFINES -= QMLJSDEBUGGER
- } else:isEmpty(QMLJSDEBUGGER_PATH) {
- warning()
- warning("Disabling QML debugging:")
- warning()
- warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
- warning("Please specify its location on the qmake command line, eg")
- warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
- warning()
- DEFINES -= QMLJSDEBUGGER
- } else {
- include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
- }
- } else {
- DEFINES -= QMLJSDEBUGGER
- }
+# Include JS debugger library if QMLJSDEBUGGER_PATH is set
+!isEmpty(QMLJSDEBUGGER_PATH) {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+} else {
+ DEFINES -= QMLJSDEBUGGER
}
diff --git a/src/libs/utils/buildablehelperlibrary.cpp b/src/libs/utils/buildablehelperlibrary.cpp
index 7f14df30133..ae1e9042803 100644
--- a/src/libs/utils/buildablehelperlibrary.cpp
+++ b/src/libs/utils/buildablehelperlibrary.cpp
@@ -255,7 +255,8 @@ bool BuildableHelperLibrary::buildHelper(const QString &helperName, const QStrin
const QString &directory, const QString &makeCommand,
const QString &qmakeCommand, const QString &mkspec,
const Utils::Environment &env, const QString &targetMode,
- QString *output, QString *errorMessage)
+ const QStringList &qmakeArguments, QString *output,
+ QString *errorMessage)
{
const QChar newline = QLatin1Char('\n');
// Setup process
@@ -284,13 +285,14 @@ bool BuildableHelperLibrary::buildHelper(const QString &helperName, const QStrin
output->append(newline);
output->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary", "Running %1 ...\n").arg(qmakeCommand));
- QStringList qMakeArgs;
+ QStringList qmakeArgs;
if (!targetMode.isEmpty())
- qMakeArgs << targetMode;
+ qmakeArgs << targetMode;
if (!mkspec.isEmpty())
- qMakeArgs << QLatin1String("-spec") << mkspec;
- qMakeArgs << proFilename;
- if (!runBuildProcess(proc, qmakeCommand, qMakeArgs, 30000, false, output, errorMessage))
+ qmakeArgs << QLatin1String("-spec") << mkspec;
+ qmakeArgs << proFilename;
+ qmakeArgs << qmakeArguments;
+ if (!runBuildProcess(proc, qmakeCommand, qmakeArgs, 30000, false, output, errorMessage))
return false;
output->append(newline);
if (makeFullPath.isEmpty()) {
diff --git a/src/libs/utils/buildablehelperlibrary.h b/src/libs/utils/buildablehelperlibrary.h
index 14a9001e60a..5753eeccf06 100644
--- a/src/libs/utils/buildablehelperlibrary.h
+++ b/src/libs/utils/buildablehelperlibrary.h
@@ -70,7 +70,8 @@ public:
const QString &directory, const QString &makeCommand,
const QString &qmakeCommand, const QString &mkspec,
const Utils::Environment &env, const QString &targetMode,
- QString *output, QString *errorMessage);
+ const QStringList &qmakeArguments, QString *output,
+ QString *errorMessage);
static bool getHelperFileInfoFor(const QStringList &validBinaryFilenames,
const QString &directory, QFileInfo* info);
diff --git a/src/libs/utils/debuggerlanguagechooser.cpp b/src/libs/utils/debuggerlanguagechooser.cpp
index 2f918d095f7..5f50a6aad17 100644
--- a/src/libs/utils/debuggerlanguagechooser.cpp
+++ b/src/libs/utils/debuggerlanguagechooser.cpp
@@ -58,6 +58,8 @@ DebuggerLanguageChooser::DebuggerLanguageChooser(QWidget *parent) :
m_debugServerPortLabel->setBuddy(m_debugServerPort);
+ m_qmlDebuggerInfoLabel = new QLabel(tr("What are the prerequisites?"));
+
connect(m_useQmlDebugger, SIGNAL(toggled(bool)), m_debugServerPort, SLOT(setEnabled(bool)));
connect(m_useQmlDebugger, SIGNAL(toggled(bool)), m_debugServerPortLabel, SLOT(setEnabled(bool)));
connect(m_debugServerPort, SIGNAL(valueChanged(int)), this, SLOT(onDebugServerPortChanged(int)));
@@ -67,6 +69,7 @@ DebuggerLanguageChooser::DebuggerLanguageChooser(QWidget *parent) :
qmlLayout->addWidget(m_useQmlDebugger);
qmlLayout->addWidget(m_debugServerPortLabel);
qmlLayout->addWidget(m_debugServerPort);
+ qmlLayout->addWidget(m_qmlDebuggerInfoLabel);
qmlLayout->addStretch();
QVBoxLayout *layout = new QVBoxLayout;
diff --git a/src/libs/utils/debuggerlanguagechooser.h b/src/libs/utils/debuggerlanguagechooser.h
index a8976494d17..86ba37bca3a 100644
--- a/src/libs/utils/debuggerlanguagechooser.h
+++ b/src/libs/utils/debuggerlanguagechooser.h
@@ -73,6 +73,7 @@ private:
QCheckBox *m_useQmlDebugger;
QSpinBox *m_debugServerPort;
QLabel *m_debugServerPortLabel;
+ QLabel *m_qmlDebuggerInfoLabel;
};
} // namespace Utils
diff --git a/src/plugins/projectexplorer/debugginghelper.cpp b/src/plugins/projectexplorer/debugginghelper.cpp
index 35024087bdd..35cfed88a6d 100644
--- a/src/plugins/projectexplorer/debugginghelper.cpp
+++ b/src/plugins/projectexplorer/debugginghelper.cpp
@@ -125,9 +125,10 @@ QString DebuggingHelperLibrary::copy(const QString &qtInstallData,
bool DebuggingHelperLibrary::build(const QString &directory, const QString &makeCommand,
const QString &qmakeCommand, const QString &mkspec,
const Utils::Environment &env, const QString &targetMode,
- QString *output, QString *errorMessage)
+ const QStringList &qmakeArguments, QString *output,
+ QString *errorMessage)
{
return buildHelper(QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary",
"GDB helper"), QLatin1String("gdbmacros.pro"), directory,
- makeCommand, qmakeCommand, mkspec, env, targetMode, output, errorMessage);
+ makeCommand, qmakeCommand, mkspec, env, targetMode, qmakeArguments, output, errorMessage);
}
diff --git a/src/plugins/projectexplorer/debugginghelper.h b/src/plugins/projectexplorer/debugginghelper.h
index 931c46f3d64..71e9344f7db 100644
--- a/src/plugins/projectexplorer/debugginghelper.h
+++ b/src/plugins/projectexplorer/debugginghelper.h
@@ -54,7 +54,7 @@ public:
static bool build(const QString &directory, const QString &makeCommand,
const QString &qmakeCommand, const QString &mkspec,
const Utils::Environment &env, const QString &targetMode,
- QString *output, QString *errorMessage);
+ const QStringList &qmakeArguments, QString *output, QString *errorMessage);
// Copy the source files to a target location and return the chosen target location.
static QString copy(const QString &qtInstallData, QString *errorMessage);
diff --git a/src/plugins/qt4projectmanager/debugginghelper.ui b/src/plugins/qt4projectmanager/debugginghelper.ui
index 6b16da7b6e5..2b77036a2dd 100644
--- a/src/plugins/qt4projectmanager/debugginghelper.ui
+++ b/src/plugins/qt4projectmanager/debugginghelper.ui
@@ -68,7 +68,7 @@
- -
+
-
A modified version of qmlviewer with support for QML/JS debugging.
@@ -78,14 +78,14 @@
- -
+
-
TextLabel
- -
+
-
Qt::Horizontal
@@ -112,13 +112,47 @@
- -
+
-
Build
+ -
+
+
+ Qml Debugging Library:
+
+
+
+ -
+
+
+ TextLabel
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Build
+
+
+
-
diff --git a/src/plugins/qt4projectmanager/debugginghelperbuildtask.cpp b/src/plugins/qt4projectmanager/debugginghelperbuildtask.cpp
index a02c25041c8..fcb99b6421c 100644
--- a/src/plugins/qt4projectmanager/debugginghelperbuildtask.cpp
+++ b/src/plugins/qt4projectmanager/debugginghelperbuildtask.cpp
@@ -34,6 +34,7 @@
#include "debugginghelperbuildtask.h"
#include "qmldumptool.h"
#include "qmlobservertool.h"
+#include "qmldebugginglibrary.h"
#include
#include
@@ -97,14 +98,25 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(QtVersion *version, Tools too
m_tools = tools;
// Check the build requirements of the tools
+
if (m_tools & QmlDump) {
if (!QmlDumpTool::canBuild(version)) {
m_tools ^= QmlDump;
}
}
+
if (m_tools & QmlObserver) {
if (!QmlObserverTool::canBuild(version)) {
m_tools ^= QmlObserver;
+ } else {
+ m_tools |= QmlDebugging;
+ }
+ }
+
+ if (m_tools & QmlDebugging) {
+ if (!QmlDebuggingLibrary::canBuild(version)) {
+ m_tools ^= QmlDebugging;
+ m_tools &= ~QmlObserver; // remove observer if set
}
}
}
@@ -143,7 +155,7 @@ bool DebuggingHelperBuildTask::buildDebuggingHelper(QFutureInterface &futu
return false;
if (!DebuggingHelperLibrary::build(gdbHelperDirectory, m_makeCommand,
m_qmakeCommand, m_mkspec, m_environment,
- m_target, output, &m_errorMessage))
+ m_target, QStringList(), output, &m_errorMessage))
return false;
}
future.setProgressValue(2);
@@ -153,20 +165,37 @@ bool DebuggingHelperBuildTask::buildDebuggingHelper(QFutureInterface &futu
if (qmlDumpToolDirectory.isEmpty())
return false;
if (!QmlDumpTool::build(qmlDumpToolDirectory, m_makeCommand, m_qmakeCommand, m_mkspec,
- m_environment, m_target, output, &m_errorMessage))
+ m_environment, m_target, QStringList(), output, &m_errorMessage))
return false;
}
future.setProgressValue(3);
+ QString qmlDebuggingDirectory;
+ if (m_tools & QmlDebugging) {
+ qmlDebuggingDirectory = QmlDebuggingLibrary::copy(m_qtInstallData, &m_errorMessage);
+ if (qmlDebuggingDirectory.isEmpty())
+ return false;
+ if (!QmlDebuggingLibrary::build(qmlDebuggingDirectory, m_makeCommand,
+ m_qmakeCommand, m_mkspec, m_environment,
+ m_target, QStringList(), output, &m_errorMessage))
+ return false;
+ }
+ future.setProgressValue(4);
+
if (m_tools & QmlObserver) {
const QString qmlObserverDirectory = QmlObserverTool::copy(m_qtInstallData,
&m_errorMessage);
if (qmlObserverDirectory.isEmpty())
return false;
+
+ QStringList qmakeArgs;
+ qmakeArgs << QLatin1String("INCLUDEPATH+=") + qmlDebuggingDirectory + "/include";
+ qmakeArgs << QLatin1String("LIBS+=-L") + qmlDebuggingDirectory;
+
if (!QmlObserverTool::build(qmlObserverDirectory, m_makeCommand, m_qmakeCommand, m_mkspec,
- m_environment, m_target, output, &m_errorMessage))
+ m_environment, m_target, qmakeArgs, output, &m_errorMessage))
return false;
}
- future.setProgressValue(4);
+ future.setProgressValue(5);
return true;
}
diff --git a/src/plugins/qt4projectmanager/debugginghelperbuildtask.h b/src/plugins/qt4projectmanager/debugginghelperbuildtask.h
index d38dbb04340..3db7f8ce6dd 100644
--- a/src/plugins/qt4projectmanager/debugginghelperbuildtask.h
+++ b/src/plugins/qt4projectmanager/debugginghelperbuildtask.h
@@ -47,9 +47,10 @@ class DebuggingHelperBuildTask : public QObject {
public:
enum DebuggingHelper {
GdbDebugging = 0x01,
- QmlObserver = 0x02,
- QmlDump = 0x04,
- AllTools = GdbDebugging | QmlObserver | QmlDump
+ QmlDebugging = 0x02,
+ QmlObserver = 0x04,
+ QmlDump = 0x08,
+ AllTools = GdbDebugging | QmlDebugging | QmlObserver | QmlDump
};
Q_DECLARE_FLAGS(Tools, DebuggingHelper)
diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp
index 902436cf4b9..e6afac81834 100644
--- a/src/plugins/qt4projectmanager/qmakestep.cpp
+++ b/src/plugins/qt4projectmanager/qmakestep.cpp
@@ -42,15 +42,19 @@
#include "qt4projectmanager.h"
#include "qt4target.h"
#include "qtversionmanager.h"
+#include "debugginghelperbuildtask.h"
#include
#include
+#include
#include
#include
#include
#include
+#include
+#include
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
@@ -61,18 +65,21 @@ const char * const QMAKE_BS_ID("QtProjectManager.QMakeBuildStep");
const char * const QMAKE_ARGUMENTS_KEY("QtProjectManager.QMakeBuildStep.QMakeArguments");
const char * const QMAKE_FORCED_KEY("QtProjectManager.QMakeBuildStep.QMakeForced");
+const char * const QMAKE_QMLDEBUGLIB_KEY("QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary");
}
QMakeStep::QMakeStep(BuildStepList *bsl) :
AbstractProcessStep(bsl, QLatin1String(QMAKE_BS_ID)),
- m_forced(false)
+ m_forced(false),
+ m_linkQmlDebuggingLibrary(false)
{
ctor();
}
QMakeStep::QMakeStep(BuildStepList *bsl, const QString &id) :
AbstractProcessStep(bsl, id),
- m_forced(false)
+ m_forced(false),
+ m_linkQmlDebuggingLibrary(false)
{
ctor();
}
@@ -80,7 +87,8 @@ QMakeStep::QMakeStep(BuildStepList *bsl, const QString &id) :
QMakeStep::QMakeStep(BuildStepList *bsl, QMakeStep *bs) :
AbstractProcessStep(bsl, bs),
m_forced(bs->m_forced),
- m_userArgs(bs->m_userArgs)
+ m_userArgs(bs->m_userArgs),
+ m_linkQmlDebuggingLibrary(bs->m_linkQmlDebuggingLibrary)
{
ctor();
}
@@ -166,9 +174,15 @@ QStringList QMakeStep::moreArguments()
<< QLatin1String("RCC_DIR=rcc");
}
- // Do not turn debugger path into native path separators: Qmake does not like that!
- arguments << QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH) + QLatin1Char('=') +
- Core::ICore::instance()->resourcePath() + QLatin1String("/qml/qmljsdebugger");
+ if (m_linkQmlDebuggingLibrary
+ && !bc->qtVersion()->qmlDebuggingHelperLibrary(true).isEmpty()) {
+ // Do not turn debugger path into native path separators: Qmake does not like that!
+ const QString debuggingHelperPath
+ = QFileInfo(bc->qtVersion()->qmlDebuggingHelperLibrary(true)).dir().path();
+
+ arguments << QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)
+ + QLatin1Char('=') + debuggingHelperPath;
+ }
return arguments;
}
@@ -313,6 +327,57 @@ void QMakeStep::setUserArguments(const QString &arguments)
qt4BuildConfiguration()->emitProFileEvaluteNeeded();
}
+bool QMakeStep::isQmlDebuggingLibrarySupported(QString *reason) const
+{
+ if (qt4BuildConfiguration()->qtVersion()->hasQmlDebuggingLibrary())
+ return true;
+
+ int major, minor, patch;
+ if (!qt4BuildConfiguration()->qtVersion()->versionNumbers(&major, &minor, &patch)) {
+ if (reason)
+ *reason = tr("Invalid Qt version.");
+ return false;
+ }
+
+ // only support 4.7.1 onwards
+ bool compatibleQt = false;
+ if (major == 4) {
+ if (minor == 7) {
+ if (patch >= 1)
+ compatibleQt = true;
+ } else if (minor > 7)
+ compatibleQt = true;
+ }
+
+ if (!compatibleQt) {
+ if (reason)
+ *reason = tr("Requires Qt 4.7.1 or newer.");
+ return false;
+ }
+
+ if (reason)
+ *reason = tr("Library not available. Compile....");
+
+ return false;
+}
+
+bool QMakeStep::linkQmlDebuggingLibrary() const
+{
+ return m_linkQmlDebuggingLibrary;
+}
+
+void QMakeStep::setLinkQmlDebuggingLibrary(bool enable)
+{
+ if (m_linkQmlDebuggingLibrary == enable)
+ return;
+ m_linkQmlDebuggingLibrary = enable;
+
+ emit linkQmlDebuggingLibraryChanged();
+
+ qt4BuildConfiguration()->emitQMakeBuildConfigurationChanged();
+ qt4BuildConfiguration()->emitProFileEvaluteNeeded();
+}
+
QStringList QMakeStep::parserArguments()
{
QStringList result;
@@ -342,6 +407,7 @@ QVariantMap QMakeStep::toMap() const
{
QVariantMap map(AbstractProcessStep::toMap());
map.insert(QLatin1String(QMAKE_ARGUMENTS_KEY), m_userArgs);
+ map.insert(QLatin1String(QMAKE_QMLDEBUGLIB_KEY), m_linkQmlDebuggingLibrary);
map.insert(QLatin1String(QMAKE_FORCED_KEY), m_forced);
return map;
}
@@ -350,6 +416,7 @@ bool QMakeStep::fromMap(const QVariantMap &map)
{
m_userArgs = map.value(QLatin1String(QMAKE_ARGUMENTS_KEY)).toString();
m_forced = map.value(QLatin1String(QMAKE_FORCED_KEY), false).toBool();
+ m_linkQmlDebuggingLibrary = map.value(QLatin1String(QMAKE_QMLDEBUGLIB_KEY), false).toBool();
return BuildStep::fromMap(map);
}
@@ -365,8 +432,14 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
this, SLOT(qmakeArgumentsLineEdited()));
connect(m_ui.buildConfigurationComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(buildConfigurationSelected()));
+ connect(m_ui.qmlDebuggingLibraryCheckBox, SIGNAL(toggled(bool)),
+ this, SLOT(linkQmlDebuggingLibraryChecked(bool)));
+ connect(m_ui.qmlDebuggingWarningText, SIGNAL(linkActivated(QString)),
+ this, SLOT(buildQmlDebuggingHelper()));
connect(step, SIGNAL(userArgumentsChanged()),
this, SLOT(userArgumentsChanged()));
+ connect(step, SIGNAL(linkQmlDebuggingLibraryChanged()),
+ this, SLOT(linkQmlDebuggingLibraryChanged()));
connect(step->qt4BuildConfiguration(), SIGNAL(qtVersionChanged()),
this, SLOT(qtVersionChanged()));
connect(step->qt4BuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
@@ -376,11 +449,14 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
void QMakeStepConfigWidget::init()
{
m_ui.qmakeAdditonalArgumentsLineEdit->setText(m_step->userArguments());
+ m_ui.qmlDebuggingLibraryCheckBox->setEnabled(m_step->isQmlDebuggingLibrarySupported());
+ m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
qmakeBuildConfigChanged();
updateSummaryLabel();
updateEffectiveQMakeCall();
+ updateQmlDebuggingWarningsLabel();
}
QString QMakeStepConfigWidget::summaryText() const
@@ -423,6 +499,18 @@ void QMakeStepConfigWidget::userArgumentsChanged()
updateEffectiveQMakeCall();
}
+void QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged()
+{
+ if (m_ignoreChange)
+ return;
+ m_ui.qmlDebuggingLibraryCheckBox->setEnabled(m_step->isQmlDebuggingLibrarySupported());
+ m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
+
+ updateSummaryLabel();
+ updateEffectiveQMakeCall();
+ updateQmlDebuggingWarningsLabel();
+}
+
void QMakeStepConfigWidget::qmakeArgumentsLineEdited()
{
m_ignoreChange = true;
@@ -459,6 +547,46 @@ void QMakeStepConfigWidget::buildConfigurationSelected()
updateEffectiveQMakeCall();
}
+void QMakeStepConfigWidget::linkQmlDebuggingLibraryChecked(bool checked)
+{
+ if (m_ignoreChange)
+ return;
+
+ m_ignoreChange = true;
+ m_step->setLinkQmlDebuggingLibrary(checked);
+ m_ignoreChange = false;
+
+ updateSummaryLabel();
+ updateEffectiveQMakeCall();
+ updateQmlDebuggingWarningsLabel();
+}
+
+void QMakeStepConfigWidget::buildQmlDebuggingHelper()
+{
+ QtVersion *version = m_step->qt4BuildConfiguration()->qtVersion();
+ DebuggingHelperBuildTask *buildTask = new DebuggingHelperBuildTask(version,
+ DebuggingHelperBuildTask::QmlDebugging);
+
+ connect(buildTask, SIGNAL(finished(int,DebuggingHelperBuildTask::Tools,QString)),
+ this, SLOT(debuggingHelperBuildFinished()),
+ Qt::QueuedConnection);
+
+ QFuture task = QtConcurrent::run(&DebuggingHelperBuildTask::run, buildTask);
+ const QString taskName = tr("Building helpers");
+ Core::ICore::instance()->progressManager()->addTask(task, taskName,
+ QLatin1String("Qt4ProjectManager::BuildHelpers"));
+}
+
+void QMakeStepConfigWidget::debuggingHelperBuildFinished()
+{
+ m_step->qt4BuildConfiguration()->qtVersion()->invalidateCache();
+ m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
+ m_ui.qmlDebuggingLibraryCheckBox->setEnabled(m_step->isQmlDebuggingLibrarySupported());
+ updateSummaryLabel();
+ updateEffectiveQMakeCall();
+ updateQmlDebuggingWarningsLabel();
+}
+
void QMakeStepConfigWidget::updateSummaryLabel()
{
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
@@ -478,6 +606,23 @@ void QMakeStepConfigWidget::updateSummaryLabel()
}
+void QMakeStepConfigWidget::updateQmlDebuggingWarningsLabel()
+{
+ QString reason;
+ m_ui.qmlDebuggingWarningText->clear();
+ if (!m_step->isQmlDebuggingLibrarySupported(&reason)) {
+ m_ui.qmlDebuggingWarningText->setText(reason);
+ }
+
+ if (m_step->linkQmlDebuggingLibrary()) {
+ if (m_step->isQmlDebuggingLibrarySupported()) {
+ m_ui.qmlDebuggingWarningText->setText("Might make your application vulnerable. Only use in a safe environment!");
+ }
+ }
+
+ m_ui.qmlDebuggingWarningIcon->setVisible(!m_ui.qmlDebuggingWarningText->text().isEmpty());
+}
+
void QMakeStepConfigWidget::updateEffectiveQMakeCall()
{
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
diff --git a/src/plugins/qt4projectmanager/qmakestep.h b/src/plugins/qt4projectmanager/qmakestep.h
index a1e82bbc1d5..24869cf0c19 100644
--- a/src/plugins/qt4projectmanager/qmakestep.h
+++ b/src/plugins/qt4projectmanager/qmakestep.h
@@ -95,11 +95,15 @@ public:
QStringList parserArguments();
QString userArguments();
void setUserArguments(const QString &arguments);
+ bool linkQmlDebuggingLibrary() const;
+ void setLinkQmlDebuggingLibrary(bool enable);
+ bool isQmlDebuggingLibrarySupported(QString *reason = 0) const;
QVariantMap toMap() const;
signals:
void userArgumentsChanged();
+ void linkQmlDebuggingLibraryChanged();
protected:
QMakeStep(ProjectExplorer::BuildStepList *parent, QMakeStep *source);
@@ -117,6 +121,7 @@ private:
bool m_forced;
bool m_needToRunQMake; // set in init(), read in run()
QString m_userArgs;
+ bool m_linkQmlDebuggingLibrary;
bool m_scriptTemplate;
QList m_tasks;
};
@@ -135,12 +140,20 @@ private slots:
void qtVersionChanged();
void qmakeBuildConfigChanged();
void userArgumentsChanged();
+ void linkQmlDebuggingLibraryChanged();
// slots for dealing with user changes in our UI
void qmakeArgumentsLineEdited();
void buildConfigurationSelected();
+ void linkQmlDebuggingLibraryChecked(bool checked);
+
+ // other
+ void buildQmlDebuggingHelper();
+ void debuggingHelperBuildFinished();
+
private:
void updateSummaryLabel();
+ void updateQmlDebuggingWarningsLabel();
void updateEffectiveQMakeCall();
Ui::QMakeStep m_ui;
QMakeStep *m_step;
diff --git a/src/plugins/qt4projectmanager/qmakestep.ui b/src/plugins/qt4projectmanager/qmakestep.ui
index cf2214062d6..9beeadf36cf 100644
--- a/src/plugins/qt4projectmanager/qmakestep.ui
+++ b/src/plugins/qt4projectmanager/qmakestep.ui
@@ -6,14 +6,11 @@
0
0
- 390
- 172
+ 440
+ 190
-
- 0
-
-
@@ -57,6 +54,56 @@
-
+
+
+ Link QML debugging library:
+
+
+
+ -
+
+
+
+ 0
+
+
-
+
+
+
+
+
+
+ -
+
+
+ :/projectexplorer/images/compile_warning.png
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ -
Effective qmake call:
@@ -66,7 +113,7 @@
- -
+
-
true
@@ -84,6 +131,8 @@
-
+
+
+
diff --git a/src/plugins/qt4projectmanager/qmldebugginglibrary.cpp b/src/plugins/qt4projectmanager/qmldebugginglibrary.cpp
new file mode 100644
index 00000000000..354e9904201
--- /dev/null
+++ b/src/plugins/qt4projectmanager/qmldebugginglibrary.cpp
@@ -0,0 +1,156 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** No Commercial Usage
+**
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**************************************************************************/
+
+#include "qmldebugginglibrary.h"
+
+#include "qt4project.h"
+#include "qt4projectmanagerconstants.h"
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+namespace Qt4ProjectManager {
+
+
+QString QmlDebuggingLibrary::libraryByInstallData(const QString &qtInstallData, bool debugBuild)
+{
+ if (!Core::ICore::instance())
+ return QString();
+
+ const QString mainFilename = Core::ICore::instance()->resourcePath()
+ + QLatin1String("/qml/qmljsdebugger/qmljsdebugger.pro");
+ const QStringList directories = installDirectories(qtInstallData);
+
+ QStringList binFilenames;
+ if (debugBuild) {
+ binFilenames << QLatin1String("qmljsdebuggerd.lib");
+ binFilenames << QLatin1String("libqmljsdebuggerd.a"); // mingw
+ } else {
+ binFilenames << QLatin1String("qmljsdebugger.lib");
+ }
+ binFilenames << QLatin1String("libqmljsdebugger.a");
+
+ return byInstallDataHelper(mainFilename, directories, binFilenames);
+}
+
+bool QmlDebuggingLibrary::canBuild(const QtVersion *qtVersion)
+{
+ return checkMinimumQtVersion(qtVersion->qtVersionString(), 4, 7, 1);
+}
+
+bool QmlDebuggingLibrary::build(const QString &directory, const QString &makeCommand,
+ const QString &qmakeCommand, const QString &mkspec,
+ const Utils::Environment &env, const QString &targetMode,
+ const QStringList &qmakeArguments, QString *output, QString *errorMessage)
+{
+ return buildHelper(QCoreApplication::translate("Qt4ProjectManager::QmlDebuggingLibrary", "Qml Debugging"),
+ QLatin1String("qmljsdebugger.pro"),
+ directory, makeCommand, qmakeCommand, mkspec, env, targetMode,
+ qmakeArguments, output, errorMessage);
+}
+
+static inline bool mkpath(const QString &targetDirectory, QString *errorMessage)
+{
+ if (!QDir().mkpath(targetDirectory)) {
+ *errorMessage = QCoreApplication::translate("Qt4ProjectManager::QmlDebuggingLibrary", "The target directory %1 could not be created.").arg(targetDirectory);
+ return false;
+ }
+ return true;
+}
+
+QString QmlDebuggingLibrary::copy(const QString &qtInstallData, QString *errorMessage)
+{
+ const QStringList directories = QmlDebuggingLibrary::installDirectories(qtInstallData);
+
+ QString sourcePath = Core::ICore::instance()->resourcePath() + QLatin1String("/qml/qmljsdebugger/");
+
+ QStringList qmljsDebuggerFiles = recursiveFileList(QDir(sourcePath));
+
+ // Try to find a writeable directory.
+ foreach (const QString &directory, directories) {
+ if (!mkpath(directory, errorMessage)) {
+ continue;
+ } else {
+ errorMessage->clear();
+ }
+
+ if (copyFiles(sourcePath, qmljsDebuggerFiles,
+ directory, errorMessage))
+ {
+ errorMessage->clear();
+ return directory;
+ }
+ }
+ *errorMessage = QCoreApplication::translate("Qt4ProjectManager::QmlDebuggingLibrary",
+ "Qml Debugging library could not be built in any of the directories:\n- %1\n\nReason: %2")
+ .arg(directories.join(QLatin1String("\n- ")), *errorMessage);
+ return QString();
+}
+
+QStringList QmlDebuggingLibrary::recursiveFileList(const QDir &dir, const QString &prefix)
+{
+ QStringList files;
+
+ QString _prefix = prefix;
+ if (!_prefix.isEmpty() && !_prefix.endsWith('/')) {
+ _prefix = _prefix + '/';
+ }
+ foreach (const QString &fileName, dir.entryList(QDir::Files)) {
+ files << _prefix + fileName;
+ }
+
+ foreach (const QString &subDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) {
+ files += recursiveFileList(QDir(dir.absoluteFilePath(subDir)), _prefix + subDir);
+ }
+ return files;
+}
+
+QStringList QmlDebuggingLibrary::installDirectories(const QString &qtInstallData)
+{
+ const QChar slash = QLatin1Char('/');
+ const uint hash = qHash(qtInstallData);
+ QStringList directories;
+ directories
+ << (qtInstallData + QLatin1String("/qtc-qmldbg/"))
+ << QDir::cleanPath((QCoreApplication::applicationDirPath() + QLatin1String("/../qtc-qmldbg/") + QString::number(hash))) + slash
+ << (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/qtc-qmldbg/") + QString::number(hash)) + slash;
+ return directories;
+}
+
+
+} // namespace
diff --git a/src/plugins/qt4projectmanager/qmldebugginglibrary.h b/src/plugins/qt4projectmanager/qmldebugginglibrary.h
new file mode 100644
index 00000000000..21db8f0a911
--- /dev/null
+++ b/src/plugins/qt4projectmanager/qmldebugginglibrary.h
@@ -0,0 +1,74 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** No Commercial Usage
+**
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**************************************************************************/
+
+#ifndef QMLDEBUGGINGLIBRARY_H
+#define QMLDEBUGGINGLIBRARY_H
+
+#include
+#include "qt4projectmanager_global.h"
+
+QT_FORWARD_DECLARE_CLASS(QDir)
+
+namespace Utils {
+ class Environment;
+}
+
+namespace ProjectExplorer {
+ class Project;
+}
+
+namespace Qt4ProjectManager {
+
+class QtVersion;
+
+class QmlDebuggingLibrary : public Utils::BuildableHelperLibrary
+{
+public:
+ static QString libraryByInstallData(const QString &qtInstallData, bool debugBuild);
+
+ static bool canBuild(const QtVersion *qtVersion);
+ static bool build(const QString &directory, const QString &makeCommand,
+ const QString &qmakeCommand, const QString &mkspec,
+ const Utils::Environment &env, const QString &targetMode,
+ const QStringList &qmakeArguments, QString *output, QString *errorMessage);
+ static QString copy(const QString &qtInstallData, QString *errorMessage);
+
+private:
+ static QStringList recursiveFileList(const QDir &dir, const QString &prefix = QString());
+ static QStringList installDirectories(const QString &qtInstallData);
+
+};
+
+} // namespace
+
+#endif // QMLDEBUGGINGLIBRARY_H
diff --git a/src/plugins/qt4projectmanager/qmldumptool.cpp b/src/plugins/qt4projectmanager/qmldumptool.cpp
index 6350313aa67..47b0d966859 100644
--- a/src/plugins/qt4projectmanager/qmldumptool.cpp
+++ b/src/plugins/qt4projectmanager/qmldumptool.cpp
@@ -256,11 +256,11 @@ QStringList QmlDumpTool::locationsByInstallData(const QString &qtInstallData, bo
bool QmlDumpTool::build(const QString &directory, const QString &makeCommand,
const QString &qmakeCommand, const QString &mkspec,
const Utils::Environment &env, const QString &targetMode,
- QString *output, QString *errorMessage)
+ const QStringList &qmakeArguments, QString *output, QString *errorMessage)
{
return buildHelper(QCoreApplication::translate("Qt4ProjectManager::QmlDumpTool", "qmldump"), QLatin1String("qmldump.pro"),
directory, makeCommand, qmakeCommand, mkspec, env, targetMode,
- output, errorMessage);
+ qmakeArguments, output, errorMessage);
}
QString QmlDumpTool::copy(const QString &qtInstallData, QString *errorMessage)
diff --git a/src/plugins/qt4projectmanager/qmldumptool.h b/src/plugins/qt4projectmanager/qmldumptool.h
index 132b205868f..f02b03d1c6f 100644
--- a/src/plugins/qt4projectmanager/qmldumptool.h
+++ b/src/plugins/qt4projectmanager/qmldumptool.h
@@ -60,7 +60,7 @@ public:
static bool build(const QString &directory, const QString &makeCommand,
const QString &qmakeCommand, const QString &mkspec,
const Utils::Environment &env, const QString &targetMode,
- QString *output, QString *errorMessage);
+ const QStringList &qmakeArguments, QString *output, QString *errorMessage);
// Copy the source files to a target location and return the chosen target location.
static QString copy(const QString &qtInstallData, QString *errorMessage);
diff --git a/src/plugins/qt4projectmanager/qmlobservertool.cpp b/src/plugins/qt4projectmanager/qmlobservertool.cpp
index c15df93c3cf..cfd888e8f32 100644
--- a/src/plugins/qt4projectmanager/qmlobservertool.cpp
+++ b/src/plugins/qt4projectmanager/qmlobservertool.cpp
@@ -107,12 +107,13 @@ QStringList QmlObserverTool::locationsByInstallData(const QString &qtInstallData
bool QmlObserverTool::build(const QString &directory, const QString &makeCommand,
const QString &qmakeCommand, const QString &mkspec,
const Utils::Environment &env, const QString &targetMode,
- QString *output, QString *errorMessage)
+ const QStringList &qmakeArguments, QString *output,
+ QString *errorMessage)
{
return buildHelper(QCoreApplication::translate("Qt4ProjectManager::QmlObserverTool", "QMLObserver"),
QLatin1String("qmlobserver.pro"),
directory, makeCommand, qmakeCommand, mkspec, env, targetMode,
- output, errorMessage);
+ qmakeArguments, output, errorMessage);
}
static inline bool mkpath(const QString &targetDirectory, QString *errorMessage)
@@ -129,10 +130,8 @@ QString QmlObserverTool::copy(const QString &qtInstallData, QString *errorMessag
const QStringList directories = QmlObserverTool::installDirectories(qtInstallData);
QString sourcePath = Core::ICore::instance()->resourcePath() + QLatin1String("/qml/qmlobserver/");
- QString libSourcePath = Core::ICore::instance()->resourcePath() + QLatin1String("/qml/qmljsdebugger/");
QStringList observerFiles = recursiveFileList(QDir(sourcePath));
- QStringList qmljsDebuggerFiles = recursiveFileList(QDir(libSourcePath));
// Try to find a writeable directory.
foreach(const QString &directory, directories) {
@@ -142,10 +141,7 @@ QString QmlObserverTool::copy(const QString &qtInstallData, QString *errorMessag
errorMessage->clear();
}
- if (copyFiles(sourcePath, observerFiles, directory, errorMessage)
- && copyFiles(libSourcePath, qmljsDebuggerFiles,
- directory + QLatin1String("/qmljsdebugger/"), errorMessage))
- {
+ if (copyFiles(sourcePath, observerFiles, directory, errorMessage)) {
errorMessage->clear();
return directory;
}
diff --git a/src/plugins/qt4projectmanager/qmlobservertool.h b/src/plugins/qt4projectmanager/qmlobservertool.h
index 0b26869c75e..865c8ef42d2 100644
--- a/src/plugins/qt4projectmanager/qmlobservertool.h
+++ b/src/plugins/qt4projectmanager/qmlobservertool.h
@@ -63,7 +63,7 @@ public:
static bool build(const QString &directory, const QString &makeCommand,
const QString &qmakeCommand, const QString &mkspec,
const Utils::Environment &env, const QString &targetMode,
- QString *output, QString *errorMessage);
+ const QStringList &qmakeArguments, QString *output, QString *errorMessage);
// Copy the source files to a target location and return the chosen target location.
static QString copy(const QString &qtInstallData, QString *errorMessage);
diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp
index ecae28a0911..0c9f05d8926 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp
@@ -42,6 +42,7 @@
#include "qt4projectmanagerconstants.h"
#include "qtoutputformatter.h"
#include "qt4desktoptarget.h"
+#include "qmakestep.h"
#include
#include
diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
index 454bcff0355..b64a83cb4f7 100644
--- a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
@@ -563,7 +563,7 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
void Qt4BuildConfiguration::removeQMLInspectorFromArguments(QString *args)
{
for (Utils::QtcProcess::ArgIterator ait(args); ait.next(); )
- if (ait.value().startsWith(QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)))
+ if (ait.value().contains(QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)))
ait.deleteArg();
}
diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro
index 55293315306..206020966a2 100644
--- a/src/plugins/qt4projectmanager/qt4projectmanager.pro
+++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro
@@ -68,6 +68,7 @@ HEADERS += \
qt4projectmanager_global.h \
qmldumptool.h \
qmlobservertool.h \
+ qmldebugginglibrary.h \
profilecompletion.h \
profilekeywords.h \
debugginghelperbuildtask.h
@@ -132,6 +133,7 @@ SOURCES += qt4projectmanagerplugin.cpp \
findqt4profiles.cpp \
qmldumptool.cpp \
qmlobservertool.cpp \
+ qmldebugginglibrary.cpp \
profilecompletion.cpp \
profilekeywords.cpp \
debugginghelperbuildtask.cpp
diff --git a/src/plugins/qt4projectmanager/qtoptionspage.cpp b/src/plugins/qt4projectmanager/qtoptionspage.cpp
index b16cf93717a..92fec7ce5f8 100644
--- a/src/plugins/qt4projectmanager/qtoptionspage.cpp
+++ b/src/plugins/qt4projectmanager/qtoptionspage.cpp
@@ -41,6 +41,7 @@
#include "qtversionmanager.h"
#include "qmldumptool.h"
#include "qmlobservertool.h"
+#include "qmldebugginglibrary.h"
#include "debugginghelperbuildtask.h"
#include
@@ -232,6 +233,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList ver
this, SLOT(buildGdbHelper()));
connect(m_debuggingHelperUi->qmlDumpBuildButton, SIGNAL(clicked()),
this, SLOT(buildQmlDump()));
+ connect(m_debuggingHelperUi->qmlDebuggingLibBuildButton, SIGNAL(clicked()),
+ this, SLOT(buildQmlDebuggingLibrary()));
connect(m_debuggingHelperUi->qmlObserverBuildButton, SIGNAL(clicked()),
this, SLOT(buildQmlObserver()));
@@ -309,6 +312,8 @@ void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, Debuggin
bool success = true;
if (tools & DebuggingHelperBuildTask::GdbDebugging)
success &= qtVersion->hasDebuggingHelper();
+ if (tools & DebuggingHelperBuildTask::QmlDebugging)
+ success &= qtVersion->hasQmlDebuggingLibrary();
if (tools & DebuggingHelperBuildTask::QmlDump)
success &= qtVersion->hasQmlDump();
if (tools & DebuggingHelperBuildTask::QmlObserver)
@@ -363,9 +368,17 @@ void QtOptionsPageWidget::buildQmlDump()
buildDebuggingHelper(DebuggingHelperBuildTask::QmlDump);
}
+void QtOptionsPageWidget::buildQmlDebuggingLibrary()
+{
+ buildDebuggingHelper(DebuggingHelperBuildTask::QmlDebugging);
+}
+
void QtOptionsPageWidget::buildQmlObserver()
{
- buildDebuggingHelper(DebuggingHelperBuildTask::QmlObserver);
+ DebuggingHelperBuildTask::Tools qmlDbgTools =
+ DebuggingHelperBuildTask::QmlObserver
+ | DebuggingHelperBuildTask::QmlDebugging;
+ buildDebuggingHelper(qmlDbgTools);
}
// Non-modal dialog
@@ -445,9 +458,13 @@ void QtOptionsPageWidget::removeQtDir()
}
// Format html table tooltip about helpers
-static inline QString msgHtmlHelperToolTip(const QString &gdbHelperPath, const QString &qmlDumpPath, const QString &qmlObserverPath)
+static inline QString msgHtmlHelperToolTip(const QString &gdbHelperPath,
+ const QString &qmlJsDebugLibPath,
+ const QString &qmlDumpPath,
+ const QString &qmlObserverPath)
{
QFileInfo gdbHelperFI(gdbHelperPath);
+ QFileInfo qmlJsDebugLibFi(qmlJsDebugLibPath);
QFileInfo qmlDumpFI(qmlDumpPath);
QFileInfo qmlObserverFI(qmlObserverPath);
@@ -459,19 +476,26 @@ static inline QString msgHtmlHelperToolTip(const QString &gdbHelperPath, const Q
"File: | %1 |
"
"Last modified: | %2 |
"
"Size: | %3 Bytes |
"
- "QML type dumper |
"
+ "QML debugging library |
"
"File: | %4 |
"
"Last modified: | %5 |
"
"Size: | %6 Bytes |
"
- "QML observer |
"
+ "QML type dumper |
"
"File: | %7 |
"
"Last modified: | %8 |
"
"Size: | %9 Bytes |
"
+ "QML observer |
"
+ "File: | %10 |
"
+ "Last modified: | %11 |
"
+ "Size: | %12 Bytes |
"
"