diff options
author | Daniel Teske <daniel.teske@nokia.com> | 2011-10-17 14:18:40 +0200 |
---|---|---|
committer | Daniel Teske <daniel.teske@nokia.com> | 2011-10-20 11:58:37 +0200 |
commit | d2243c9765b2c7d917ab2d078e412d72f53bd959 (patch) | |
tree | 32c6f1860bd6ed27860ce7c412d5fe3717a0b95e /src/plugins/qt4projectmanager | |
parent | 4565c12f2bc9476858f53f2595647265bd43c5ee (diff) | |
download | qt-creator-d2243c9765b2c7d917ab2d078e412d72f53bd959.tar.gz |
Add a maximum Qt Version to the wizards
All existing wizards derived from AbstractMobileWizard do not support qt
5. So they won't offer them, nor default to them.
Task-number: QTCREATORBUG-6321
Change-Id: I999e2565cec5b0d7da04c10e38ac2cb101352e5b
Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
Diffstat (limited to 'src/plugins/qt4projectmanager')
14 files changed, 60 insertions, 22 deletions
diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp index aedab9d645..8f09417a7f 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp @@ -125,15 +125,18 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::restore(ProjectExplorer::Proj return 0; } -Qt4TargetSetupWidget *Qt4DesktopTargetFactory::createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &number, bool importEnabled, QList<BuildConfigurationInfo> importInfos) +Qt4TargetSetupWidget *Qt4DesktopTargetFactory::createTargetSetupWidget(const QString &id, const QString &proFilePath, + const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion, + bool importEnabled, QList<BuildConfigurationInfo> importInfos) { - QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, proFilePath, number); + QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, proFilePath, minimumQtVersion, maximumQtVersion); if (infos.isEmpty()) return 0; Qt4DefaultTargetSetupWidget *widget = new Qt4DefaultTargetSetupWidget(this, id, proFilePath, infos, - number, importEnabled, - importInfos, + minimumQtVersion, maximumQtVersion, + importEnabled, importInfos, Qt4DefaultTargetSetupWidget::USER); widget->setBuildConfiguraionComboBoxVisible(true); return widget; diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h index 55e784c3e0..42d5d88c95 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h @@ -54,7 +54,10 @@ public: virtual bool supportsTargetId(const QString &id) const; - Qt4TargetSetupWidget *createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, bool importEnabled, QList<BuildConfigurationInfo> importInfos); + Qt4TargetSetupWidget *createTargetSetupWidget(const QString &id, const QString &proFilePath, + const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion, + bool importEnabled, QList<BuildConfigurationInfo> importInfos); QString buildNameForId(const QString &id) const; QSet<QString> targetFeatures(const QString &id) const; ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id); diff --git a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp index 262adefa8d..74ba7764b6 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp @@ -164,9 +164,12 @@ QList<ProjectExplorer::Task> Qt4SymbianTargetFactory::reportIssues(const QString return results; } -QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion) +QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, + const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion) { - QList<BuildConfigurationInfo> infos = Qt4BaseTargetFactory::availableBuildConfigurations(id, proFilePath, minimumQtVersion); + QList<BuildConfigurationInfo> infos + = Qt4BaseTargetFactory::availableBuildConfigurations(id, proFilePath, minimumQtVersion, maximumQtVersion); if (id != Constants::S60_EMULATOR_TARGET_ID) return infos; // For emulator filter out all non debug builds diff --git a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.h b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.h index 2f5723bfc8..4afa6790a7 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.h +++ b/src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.h @@ -59,7 +59,9 @@ public: QString shadowBuildDirectory(const QString &profilePath, const QString &id, const QString &suffix); QList<ProjectExplorer::Task> reportIssues(const QString &proFile); - QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion); + QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, + const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion); bool selectByDefault(const QString &id) const; QSet<QString> targetFeatures(const QString &id) const; diff --git a/src/plugins/qt4projectmanager/qt4basetargetfactory.h b/src/plugins/qt4projectmanager/qt4basetargetfactory.h index 633613854b..af258569ba 100644 --- a/src/plugins/qt4projectmanager/qt4basetargetfactory.h +++ b/src/plugins/qt4projectmanager/qt4basetargetfactory.h @@ -58,6 +58,7 @@ public: virtual Qt4TargetSetupWidget *createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion, bool importEnabled, QList<BuildConfigurationInfo> importInfos); @@ -69,7 +70,9 @@ public: /// used by the default implementation of createTargetSetupWidget /// not needed otherwise /// by default creates one debug + one release buildconfiguration per qtversion - virtual QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion); + virtual QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, + const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion); virtual QList<ProjectExplorer::Task> reportIssues(const QString &proFile); /// only used in the TargetSetupPage diff --git a/src/plugins/qt4projectmanager/qt4target.cpp b/src/plugins/qt4projectmanager/qt4target.cpp index 014887462d..dcc9246ac8 100644 --- a/src/plugins/qt4projectmanager/qt4target.cpp +++ b/src/plugins/qt4projectmanager/qt4target.cpp @@ -90,17 +90,18 @@ Qt4BaseTargetFactory::~Qt4BaseTargetFactory() Qt4TargetSetupWidget *Qt4BaseTargetFactory::createTargetSetupWidget(const QString &id, const QString &proFilePath, - const QtSupport::QtVersionNumber &number, + const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion, bool importEnabled, QList<BuildConfigurationInfo> importInfos) { - QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, proFilePath, number); + QList<BuildConfigurationInfo> infos = this->availableBuildConfigurations(id, proFilePath, minimumQtVersion, maximumQtVersion); if (infos.isEmpty()) return 0; const bool supportsShadowBuilds = targetFeatures(id).contains(Constants::SHADOWBUILD_TARGETFEATURE_ID); Qt4DefaultTargetSetupWidget *widget - = new Qt4DefaultTargetSetupWidget(this, id, proFilePath, infos, number, + = new Qt4DefaultTargetSetupWidget(this, id, proFilePath, infos, minimumQtVersion, maximumQtVersion, importEnabled && supportsShadowBuilds, importInfos, (supportsShadowBuilds ? Qt4DefaultTargetSetupWidget::ENABLE @@ -118,10 +119,13 @@ ProjectExplorer::Target *Qt4BaseTargetFactory::create(ProjectExplorer::Project * return create(parent, id, w->buildConfigurationInfos()); } -QList<BuildConfigurationInfo> Qt4BaseTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtSupport::QtVersionNumber &minimumQtVersion) +QList<BuildConfigurationInfo> Qt4BaseTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, + const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion) { QList<BuildConfigurationInfo> infoList; - QList<QtSupport::BaseQtVersion *> knownVersions = QtSupport::QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion); + QList<QtSupport::BaseQtVersion *> knownVersions + = QtSupport::QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion, maximumQtVersion); foreach (QtSupport::BaseQtVersion *version, knownVersions) { if (!version->isValid() || !version->toolChainAvailable(id)) @@ -422,6 +426,7 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f const QString &proFilePath, const QList<BuildConfigurationInfo> &infos, const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion, bool importEnabled, const QList<BuildConfigurationInfo> &importInfos, ShadowBuildOption shadowBuild) @@ -430,6 +435,7 @@ Qt4DefaultTargetSetupWidget::Qt4DefaultTargetSetupWidget(Qt4BaseTargetFactory *f m_factory(factory), m_proFilePath(proFilePath), m_minimumQtVersion(minimumQtVersion), + m_maximumQtVersion(maximumQtVersion), m_importInfos(importInfos), m_directoriesEnabled(true), m_hasInSourceBuild(false), @@ -652,7 +658,7 @@ void Qt4DefaultTargetSetupWidget::setProFilePath(const QString &proFilePath) { m_proFilePath = proFilePath; m_detailsWidget->setAdditionalSummaryText(issuesListToString(m_factory->reportIssues(m_proFilePath))); - setBuildConfigurationInfos(m_factory->availableBuildConfigurations(m_id, proFilePath, m_minimumQtVersion), false); + setBuildConfigurationInfos(m_factory->availableBuildConfigurations(m_id, proFilePath, m_minimumQtVersion, m_maximumQtVersion), false); } void Qt4DefaultTargetSetupWidget::setBuildConfiguraionComboBoxVisible(bool b) diff --git a/src/plugins/qt4projectmanager/qt4target.h b/src/plugins/qt4projectmanager/qt4target.h index f9325e2230..f3053fbc47 100644 --- a/src/plugins/qt4projectmanager/qt4target.h +++ b/src/plugins/qt4projectmanager/qt4target.h @@ -116,6 +116,7 @@ public: const QString &proFilePath, const QList<BuildConfigurationInfo> &info, const QtSupport::QtVersionNumber &minimumQtVersion, + const QtSupport::QtVersionNumber &maximumQtVersion, bool importEnabled, const QList<BuildConfigurationInfo> &importInfos, ShadowBuildOption shadowBuild); @@ -158,6 +159,7 @@ private: Qt4BaseTargetFactory *m_factory; QString m_proFilePath; QtSupport::QtVersionNumber m_minimumQtVersion; + QtSupport::QtVersionNumber m_maximumQtVersion; Utils::DetailsWidget *m_detailsWidget; QGridLayout *m_importLayout; QGridLayout *m_newBuildsLayout; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp index b1c6f12187..3e2913a911 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp @@ -49,7 +49,9 @@ namespace Qt4ProjectManager { -AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, const QtSupport::QtVersionNumber &minimumQtVersionNumber) +AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, + const QtSupport::QtVersionNumber &minimumQtVersionNumber, + const QtSupport::QtVersionNumber &maximumQtVersionNumber) : ProjectExplorer::BaseProjectWizardDialog(parent) , m_genericOptionsPageId(-1) , m_symbianOptionsPageId(-1) @@ -66,6 +68,7 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, co m_targetsPage = new TargetSetupPage; m_targetsPage->setPreferredFeatures(QSet<QString>() << Constants::MOBILE_TARGETFEATURE_ID); m_targetsPage->setMinimumQtVersion(minimumQtVersionNumber); + m_targetsPage->setMaximumQtVersion(maximumQtVersionNumber); resize(900, 450); m_genericOptionsPage = new Internal::MobileAppWizardGenericOptionsPage; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h index f4aff8058d..2439cf3950 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h @@ -57,7 +57,7 @@ class QT4PROJECTMANAGER_EXPORT AbstractMobileAppWizardDialog : public ProjectExp Q_OBJECT protected: - explicit AbstractMobileAppWizardDialog(QWidget *parent, const QtSupport::QtVersionNumber &minimumQtVersionNumber); + explicit AbstractMobileAppWizardDialog(QWidget *parent, const QtSupport::QtVersionNumber &minimumQtVersionNumber, const QtSupport::QtVersionNumber &maximumQtVersionNumber); void addMobilePages(); public: diff --git a/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp b/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp index 178dc934c1..1b1100f40f 100644 --- a/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp @@ -38,6 +38,7 @@ #include "targetsetuppage.h" #include "qt4projectmanagerconstants.h" +#include <limits> #include <QtCore/QCoreApplication> #include <QtGui/QIcon> @@ -58,7 +59,7 @@ private: }; Html5AppWizardDialog::Html5AppWizardDialog(QWidget *parent) - : AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber()) + : AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(), QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX)) , m_htmlOptionsPage(0) { setWindowTitle(tr("New HTML5 Application")); diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp b/src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp index 533ba09e38..78081df8a8 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp @@ -60,7 +60,7 @@ class MobileAppWizardDialog : public AbstractMobileAppWizardDialog Q_OBJECT public: explicit MobileAppWizardDialog(QWidget *parent = 0) - : AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber()) + : AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(), QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX)) { setWindowTitle(DisplayName); setIntroDescription(Description); diff --git a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp index 8a7cc42539..86d98ebe56 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp @@ -66,7 +66,7 @@ private: }; QtQuickAppWizardDialog::QtQuickAppWizardDialog(QWidget *parent) - : AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(4, 7, 0)) + : AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(4, 7, 0), QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX)) { setWindowTitle(tr("New Qt Quick Application")); setIntroDescription(tr("This wizard generates a Qt Quick application project.")); diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp index 9c15946f28..e692aa464b 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp @@ -55,7 +55,8 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : QWizardPage(parent), m_importSearch(false), m_spacer(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)), - m_ui(new Internal::Ui::TargetSetupPage) + m_ui(new Internal::Ui::TargetSetupPage), + m_maximumQtVersionNumber(INT_MAX, INT_MAX, INT_MAX) { m_ui->setupUi(this); QWidget *centralWidget = new QWidget(this); @@ -112,6 +113,11 @@ void TargetSetupPage::setMinimumQtVersion(const QtSupport::QtVersionNumber &numb m_minimumQtVersionNumber = number; } +void TargetSetupPage::setMaximumQtVersion(const QtSupport::QtVersionNumber &number) +{ + m_maximumQtVersionNumber = number; +} + void TargetSetupPage::setImportSearch(bool b) { m_importSearch = b; @@ -129,7 +135,9 @@ void TargetSetupPage::setupWidgets() QList<BuildConfigurationInfo> infos = BuildConfigurationInfo::filterBuildConfigurationInfos(m_importInfos, id); Qt4TargetSetupWidget *widget = - factory->createTargetSetupWidget(id, m_proFilePath, m_minimumQtVersionNumber, m_importSearch, infos); + factory->createTargetSetupWidget(id, m_proFilePath, + m_minimumQtVersionNumber, m_maximumQtVersionNumber, + m_importSearch, infos); if (widget) { bool selectTarget = false; if (!m_importInfos.isEmpty()) { diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h index 066f796a76..197c4911a9 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h @@ -81,6 +81,9 @@ public: /// Sets the minimum qt version /// calls this before \sa initializePage() void setMinimumQtVersion(const QtSupport::QtVersionNumber &number); + /// Sets the maximum qt version + /// calls this before \sa initializePage() + void setMaximumQtVersion(const QtSupport::QtVersionNumber &number); /// Sets whether the TargetSetupPage looks on disk for builds of this project /// call this before \sa initializePage() void setImportSearch(bool b); @@ -102,6 +105,7 @@ private: QSet<QString> m_requiredFeatures; bool m_importSearch; QtSupport::QtVersionNumber m_minimumQtVersionNumber; + QtSupport::QtVersionNumber m_maximumQtVersionNumber; QString m_proFilePath; QString m_defaultShadowBuildLocation; QMap<QString, Qt4TargetSetupWidget *> m_widgets; |