本文整理汇总了C++中BaseQtVersion::displayName方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseQtVersion::displayName方法的具体用法?C++ BaseQtVersion::displayName怎么用?C++ BaseQtVersion::displayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseQtVersion
的用法示例。
在下文中一共展示了BaseQtVersion::displayName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Task
QList<Task> MerQtVersion::validateKit(const Kit *kit)
{
QList<Task> result = BaseQtVersion::validateKit(kit);
if (!result.isEmpty())
return result;
BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
QTC_ASSERT(version == this, return result);
ToolChain *tc = ToolChainKitInformation::toolChain(kit);
if (!tc) {
const QString message =
QCoreApplication::translate("QtVersion", "No available toolchains found to build "
"for Qt version '%1'.").arg(version->displayName());
result << Task(Task::Error, message, Utils::FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
} else if (!MerSdkManager::validateKit(kit)) {
const QString message =
QCoreApplication::translate("QtVersion", "This Qt version '%1' does not match Mer SDK or toolchain.").
arg(version->displayName());
result << Task(Task::Error, message, Utils::FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
return result;
}
示例2: foreach
// Add changed/added items:
foreach (int a, toAdd) {
BaseQtVersion *version = QtVersionManager::version(a)->clone();
m_versions.append(version);
QTreeWidgetItem *item = new QTreeWidgetItem;
item->setText(0, version->displayName());
item->setText(1, version->qmakeCommand().toUserOutput());
item->setData(0, VersionIdRole, version->uniqueId());
item->setData(0, ToolChainIdRole, defaultToolChainId(version));
const ValidityInfo info = validInformation(version);
item->setIcon(0, info.icon);
// Insert in the right place:
QTreeWidgetItem *parent = version->isAutodetected()? m_autoItem : m_manualItem;
for (int i = 0; i < parent->childCount(); ++i) {
BaseQtVersion *currentVersion = m_versions.at(indexForTreeItem(parent->child(i)));
if (currentVersion->qtVersion() > version->qtVersion())
continue;
parent->insertChild(i, item);
parent = 0;
break;
}
if (parent)
parent->addChild(item);
}
示例3: 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
示例4: tr
BuildConfiguration *Qt4BuildConfigurationFactory::create(Target *parent, const Core::Id id, const QString &name)
{
if (!canCreate(parent, id))
return 0;
BaseQtVersion *version = QtKitInformation::qtVersion(parent->kit());
Q_ASSERT(version);
bool ok = true;
QString buildConfigurationName = name;
if (buildConfigurationName.isNull())
buildConfigurationName = QInputDialog::getText(0,
tr("New Configuration"),
tr("New configuration name:"),
QLineEdit::Normal,
version->displayName(), &ok);
buildConfigurationName = buildConfigurationName.trimmed();
if (!ok || buildConfigurationName.isEmpty())
return 0;
//: Debug build configuration. We recommend not translating it.
QString defaultFirstName = tr("%1 Debug").arg(version->displayName()).trimmed();
QString customFirstName;
if (buildConfigurationName != version->displayName())
customFirstName = tr("%1 Debug").arg(buildConfigurationName).trimmed();
//: Release build configuration. We recommend not translating it.
QString defaultSecondName = tr("%1 Release").arg(version->displayName()).trimmed();
QString customSecondName;
if (buildConfigurationName != version->displayName())
customSecondName = tr("%1 Release").arg(buildConfigurationName).trimmed();
BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig() | QtSupport::BaseQtVersion::DebugBuild;
BuildConfiguration *bc
= Qt4BuildConfiguration::setup(parent, defaultFirstName, customFirstName,
config, QString(), QString(), false);
config = config ^ BaseQtVersion::DebugBuild;
parent->addBuildConfiguration(
Qt4BuildConfiguration::setup(parent, defaultSecondName, customSecondName,
config,
QString(), QString(), false));
return bc;
}
示例5: 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;
}
示例6: foreach
foreach (const int id, changed) {
BaseQtVersion *v = mgr->version(id);
int pos = findQtVersion(id);
QTC_CHECK(pos >= 0);
m_combo->setItemText(pos, v->displayName());
}