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-on: http://codereview.qt.nokia.com/460
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
Kai Koehne
2011-06-10 17:09:45 +02:00
committed by Christiaan Janssen
parent 17db97b698
commit 5fb18dcc83
2 changed files with 30 additions and 1 deletions

View File

@@ -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