diff --git a/src/plugins/analyzerbase/analyzerruncontrol.cpp b/src/plugins/analyzerbase/analyzerruncontrol.cpp index ecd90fe3f368b458ef3b0e3247d7c92550287e75..ad1fb6bb0b1310e6fbc7a9e8507756868be06177 100644 --- a/src/plugins/analyzerbase/analyzerruncontrol.cpp +++ b/src/plugins/analyzerbase/analyzerruncontrol.cpp @@ -75,6 +75,9 @@ AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp, IAnalyzerTool *tool = AnalyzerManager::instance()->currentTool(); d->m_engine = tool->createEngine(sp, runConfiguration); + if (!d->m_engine) + return; + connect(d->m_engine, SIGNAL(outputReceived(QString,Utils::OutputFormat)), SLOT(receiveOutput(QString,Utils::OutputFormat))); connect(d->m_engine, SIGNAL(taskToBeAdded(ProjectExplorer::Task::TaskType,QString,QString,int)), @@ -94,6 +97,11 @@ AnalyzerRunControl::~AnalyzerRunControl() void AnalyzerRunControl::start() { + if (!d->m_engine) { + emit finished(); + return; + } + // clear about-to-be-outdated tasks ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ProjectExplorer::TaskHub *hub = pm->getObject<ProjectExplorer::TaskHub>(); @@ -106,7 +114,7 @@ void AnalyzerRunControl::start() ProjectExplorer::RunControl::StopResult AnalyzerRunControl::stop() { - if (!d->m_isRunning) + if (!d->m_engine || !d->m_isRunning) return StoppedSynchronously; d->m_engine->stop(); @@ -127,6 +135,8 @@ bool AnalyzerRunControl::isRunning() const QString AnalyzerRunControl::displayName() const { + if (!d->m_engine) + return QString(); return d->m_engine->startParameters().displayName; } diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 791708f82ae4a65570beb68121aa3f211822ae37..13f27f8b75d9eb4d0629824e220d3a8090ca889b 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -68,14 +68,17 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> +#include <qt4projectmanager/qt4buildconfiguration.h> #include <qt4projectmanager/qt-s60/s60deployconfiguration.h> #include <QtCore/QFile> +#include <QtGui/QApplication> #include <QtGui/QHBoxLayout> #include <QtGui/QLabel> #include <QtGui/QTabWidget> #include <QtGui/QToolButton> +#include <QtGui/QMessageBox> using namespace Analyzer; using namespace QmlProfiler::Internal; @@ -156,6 +159,22 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp { QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration); + // Check minimum Qt Version. We cannot really be sure what the Qt version at runtime is, + // but guess that the active build configuraiton has been used. + QtSupport::QtVersionNumber minimumVersion(4,7,4); + if (Qt4ProjectManager::Qt4BuildConfiguration *qt4Config + = qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration*>( + runConfiguration->target()->activeBuildConfiguration())) { + if (qt4Config->qtVersion()->isValid() && qt4Config->qtVersion()->qtVersion() < minimumVersion) { + int result = QMessageBox::warning(QApplication::activeWindow(), tr("QML Profiler"), + "The QML profiler requires Qt 4.7.4 or newer.\n" + "The Qt version configured in your active build configuration is too old.\n" + "Do you want to continue?", QMessageBox::Yes, QMessageBox::No); + if (result == QMessageBox::No) + return 0; + } + } + d->m_connectMode = QmlProfilerToolPrivate::TcpConnection; if (Qt4ProjectManager::S60DeployConfiguration *deployConfig