Commit 5fb18dcc authored by Kai Koehne's avatar Kai Koehne Committed by Christiaan Janssen
Browse files

QmlProfiler: Warn user if Qt is too old

Check for the Qt version in teh active build configuration. If
it's too old warn the user that we require 4.7.4.

(The app running doesn't necessarily have to have the same Qt version,
so this is just an approximation).

Change-Id: Id1f31e4f0734448712dd48ecf6526ca89da45b8b

Reviewed-by: default avatarQt Sanity Bot <>
Reviewed-by: default avatarChristiaan Janssen <>
parent 17db97b6
......@@ -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)
connect(d->m_engine, SIGNAL(outputReceived(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();
// 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;
......@@ -127,6 +135,8 @@ bool AnalyzerRunControl::isRunning() const
QString AnalyzerRunControl::displayName() const
if (!d->m_engine)
return QString();
return d->m_engine->startParameters().displayName;
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment