本文整理汇总了C++中qtsupport::BaseQtVersion::availableFeatures方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseQtVersion::availableFeatures方法的具体用法?C++ BaseQtVersion::availableFeatures怎么用?C++ BaseQtVersion::availableFeatures使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtsupport::BaseQtVersion
的用法示例。
在下文中一共展示了BaseQtVersion::availableFeatures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mergeBundlesForKit
void BasicBundleProvider::mergeBundlesForKit(ProjectExplorer::Kit *kit
, QmlLanguageBundles &bundles
, const QHash<QString,QString> &replacements)
{
QHash<QString,QString> myReplacements = replacements;
bundles.mergeBundleForLanguage(Dialect::QmlQbs, defaultQbsBundle());
bundles.mergeBundleForLanguage(Dialect::QmlTypeInfo, defaultQmltypesBundle());
bundles.mergeBundleForLanguage(Dialect::QmlProject, defaultQmlprojectBundle());
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(kit);
if (!qtVersion) {
QmlBundle b1(defaultQt4QtQuick1Bundle());
bundles.mergeBundleForLanguage(Dialect::Qml, b1);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick1, b1);
QmlBundle b11(defaultQt5QtQuick1Bundle());
bundles.mergeBundleForLanguage(Dialect::Qml, b11);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick1, b11);
QmlBundle b2(defaultQt5QtQuick2Bundle());
bundles.mergeBundleForLanguage(Dialect::Qml, b2);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2, b2);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2Ui, b2);
return;
}
QString qtImportsPath = qtVersion->qmakeProperty("QT_INSTALL_IMPORTS");
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))) {
myReplacements.insert(QLatin1String("$(CURRENT_DIRECTORY)"), qtImportsPath);
QDir qtQuick1Bundles(qtImportsPath);
qtQuick1Bundles.setNameFilters(QStringList(QLatin1String("*-bundle.json")));
QmlBundle qtQuick1Bundle;
QFileInfoList list = qtQuick1Bundles.entryInfoList();
for (int i = 0; i < list.size(); ++i) {
QmlBundle bAtt;
QStringList errors;
if (!bAtt.readFrom(list.value(i).filePath(), &errors))
qWarning() << "BasicBundleProvider: ERROR reading " << list[i].filePath() << " : "
<< errors;
qtQuick1Bundle.merge(bAtt);
}
if (!qtQuick1Bundle.supportedImports().contains(QLatin1String("QtQuick 1."),
PersistentTrie::Partial)) {
if (qtVersion->qtVersion().majorVersion == 4)
qtQuick1Bundle.merge(defaultQt4QtQuick1Bundle());
else if (qtVersion->qtVersion().majorVersion > 4)
qtQuick1Bundle.merge(defaultQt5QtQuick1Bundle());
}
qtQuick1Bundle.replaceVars(myReplacements);
bundles.mergeBundleForLanguage(Dialect::Qml, qtQuick1Bundle);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick1, qtQuick1Bundle);
}
if (features.contains(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_2))) {
myReplacements.insert(QLatin1String("$(CURRENT_DIRECTORY)"), qtQmlPath);
QDir qtQuick2Bundles(qtQmlPath);
qtQuick2Bundles.setNameFilters(QStringList(QLatin1String("*-bundle.json")));
QmlBundle qtQuick2Bundle;
QFileInfoList list = qtQuick2Bundles.entryInfoList();
for (int i = 0; i < list.size(); ++i) {
QmlBundle bAtt;
QStringList errors;
if (!bAtt.readFrom(list.value(i).filePath(), &errors))
qWarning() << "BasicBundleProvider: ERROR reading " << list[i].filePath() << " : "
<< errors;
qtQuick2Bundle.merge(bAtt);
}
if (!qtQuick2Bundle.supportedImports().contains(QLatin1String("QtQuick 2."),
PersistentTrie::Partial)) {
qtQuick2Bundle.merge(defaultQt5QtQuick2Bundle());
}
qtQuick2Bundle.replaceVars(myReplacements);
bundles.mergeBundleForLanguage(Dialect::Qml, qtQuick2Bundle);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2, qtQuick2Bundle);
bundles.mergeBundleForLanguage(Dialect::QmlQtQuick2Ui, qtQuick2Bundle);
}
}