本文整理汇总了C++中BaseQtVersion::qtAbis方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseQtVersion::qtAbis方法的具体用法?C++ BaseQtVersion::qtAbis怎么用?C++ BaseQtVersion::qtAbis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseQtVersion
的用法示例。
在下文中一共展示了BaseQtVersion::qtAbis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: foreach
QList<ProjectExplorer::Task> BaseQtVersion::validateKit(const ProjectExplorer::Kit *k)
{
QList<ProjectExplorer::Task> result;
BaseQtVersion *version = QtKitInformation::qtVersion(k);
Q_ASSERT(version == this);
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
const QList<ProjectExplorer::Abi> qtAbis = version->qtAbis();
if (tc && !qtAbis.contains(tc->targetAbi())) {
QString qtAbiString;
foreach (const ProjectExplorer::Abi &qtAbi, qtAbis) {
if (!qtAbiString.isEmpty())
qtAbiString.append(QLatin1Char(' '));
qtAbiString.append(qtAbi.toString());
}
const QString message = QCoreApplication::translate("BaseQtVersion",
"The compiler '%1' (%2) cannot produce code for the Qt version '%3' (%4).").
arg(tc->displayName(),
tc->targetAbi().toString(),
version->displayName(),
qtAbiString);
result << ProjectExplorer::Task(ProjectExplorer::Task::Error,
message, FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
} // Abi mismatch
示例2: foreach
QList<Task> BaseQtVersion::validateKit(const Kit *k)
{
QList<Task> result;
BaseQtVersion *version = QtKitInformation::qtVersion(k);
Q_ASSERT(version == this);
const QList<Abi> qtAbis = version->qtAbis();
if (qtAbis.isEmpty()) // No need to test if Qt does not know anyway...
return result;
ToolChain *tc = ToolChainKitInformation::toolChain(k);
if (tc) {
Abi targetAbi = tc->targetAbi();
bool fuzzyMatch = false;
bool fullMatch = false;
QString qtAbiString;
foreach (const Abi &qtAbi, qtAbis) {
if (!qtAbiString.isEmpty())
qtAbiString.append(QLatin1Char(' '));
qtAbiString.append(qtAbi.toString());
if (!fullMatch)
fullMatch = (targetAbi == qtAbi);
if (!fuzzyMatch)
fuzzyMatch = targetAbi.isCompatibleWith(qtAbi);
}
QString message;
if (!fullMatch) {
if (!fuzzyMatch)
message = QCoreApplication::translate("BaseQtVersion",
"The compiler '%1' (%2) cannot produce code for the Qt version '%3' (%4).");
else
message = QCoreApplication::translate("BaseQtVersion",
"The compiler '%1' (%2) may not produce code compatible with the Qt version '%3' (%4).");
message = message.arg(tc->displayName(), targetAbi.toString(),
version->displayName(), qtAbiString);
result << Task(fuzzyMatch ? Task::Warning : Task::Error, message, FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
}
}
return result;
}