Qt: Update features for Qt 5.5

* Add QtVersionNumber::matches to match against a Qt version to
  make the code setting the features easier to follow.
* Use versionedFeatures instead of adding new string constants for
  the latest and greatest Qt Quick and Qt Quick Controls.
* Fix Qt-version-to-features mapping as discussed in
  QTCREATORBUG-14575
* Simplify code in qmljsbundleprovider.cpp: It should do the same
  thing as the old one.

Change-Id: Iba24e9d299a2a2e5d6e4de7cd1e95707a574678e
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-06-24 16:09:07 +02:00
parent 705ac15342
commit 57d652743e
8 changed files with 61 additions and 53 deletions

View File

@@ -131,9 +131,7 @@ void BasicBundleProvider::mergeBundlesForKit(ProjectExplorer::Kit *kit
QString qtQmlPath = qtVersion->qmakeProperty("QT_INSTALL_QML");
Core::FeatureSet features = qtVersion->availableFeatures();
if (features.contains(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK))
|| features.contains(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1))
|| features.contains(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1_1))) {
if (features.contains(Core::Feature::versionedFeature(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX))) {
myReplacements.insert(QLatin1String("$(CURRENT_DIRECTORY)"), qtImportsPath);
QDir qtQuick1Bundles(qtImportsPath);
qtQuick1Bundles.setNameFilters(QStringList(QLatin1String("*-bundle.json")));
@@ -158,7 +156,7 @@ void BasicBundleProvider::mergeBundlesForKit(ProjectExplorer::Kit *kit
bundles.mergeBundleForLanguage(Dialect::Qml, qtQuick1Bundle);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick1, qtQuick1Bundle);
}
if (features.contains(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_2))) {
if (features.contains(Core::Feature::versionedFeature(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX, 2))) {
myReplacements.insert(QLatin1String("$(CURRENT_DIRECTORY)"), qtQmlPath);
QDir qtQuick2Bundles(qtQmlPath);
qtQuick2Bundles.setNameFilters(QStringList(QLatin1String("*-bundle.json")));