本文整理汇总了C++中qtsupport::BaseQtVersion::displayName方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseQtVersion::displayName方法的具体用法?C++ BaseQtVersion::displayName怎么用?C++ BaseQtVersion::displayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtsupport::BaseQtVersion
的用法示例。
在下文中一共展示了BaseQtVersion::displayName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setProblemLabel
void Qt4ProjectConfigWidget::updateProblemLabel()
{
m_ui->shadowBuildDirEdit->triggerChanged();
ProjectExplorer::Kit *k = m_buildConfiguration->target()->kit();
const QString proFileName = m_buildConfiguration->target()->project()->document()->fileName();
// Check for Qt version:
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
if (!version) {
setProblemLabel(tr("This kit cannot build this project since it does not define a Qt version."));
return;
}
Qt4Project *p = static_cast<Qt4Project *>(m_buildConfiguration->target()->project());
if (p->rootQt4ProjectNode()->parseInProgress() || !p->rootQt4ProjectNode()->validParse()) {
setProblemLabel(QString());
return;
}
bool targetMismatch = false;
bool incompatibleBuild = false;
bool allGood = false;
// we only show if we actually have a qmake and makestep
if (m_buildConfiguration->qmakeStep() && m_buildConfiguration->makeStep()) {
QString makefile = m_buildConfiguration->buildDirectory() + QLatin1Char('/');
if (m_buildConfiguration->makefile().isEmpty())
makefile.append(QLatin1String("Makefile"));
else
makefile.append(m_buildConfiguration->makefile());
switch (m_buildConfiguration->compareToImportFrom(makefile)) {
case Qt4BuildConfiguration::MakefileMatches:
allGood = true;
break;
case Qt4BuildConfiguration::MakefileMissing:
allGood = true;
break;
case Qt4BuildConfiguration::MakefileIncompatible:
incompatibleBuild = true;
break;
case Qt4BuildConfiguration::MakefileForWrongProject:
targetMismatch = true;
break;
}
}
QString shadowBuildWarning;
if (!version->supportsShadowBuilds() && m_buildConfiguration->shadowBuild()) {
shadowBuildWarning = tr("The Qt version %1 does not support shadow builds, building might fail.")
.arg(version->displayName())
+ QLatin1String("<br>");
}
if (allGood) {
QString buildDirectory = m_buildConfiguration->target()->project()->projectDirectory();;
if (m_buildConfiguration->shadowBuild())
buildDirectory = m_buildConfiguration->buildDirectory();
QList<ProjectExplorer::Task> issues;
issues = version->reportIssues(proFileName, buildDirectory);
qSort(issues);
if (!issues.isEmpty() || !shadowBuildWarning.isEmpty()) {
QString text = QLatin1String("<nobr>") + shadowBuildWarning;
foreach (const ProjectExplorer::Task &task, issues) {
QString type;
switch (task.type) {
case ProjectExplorer::Task::Error:
type = tr("Error:");
type += QLatin1Char(' ');
break;
case ProjectExplorer::Task::Warning:
type = tr("Warning:");
type += QLatin1Char(' ');
break;
case ProjectExplorer::Task::Unknown:
default:
break;
}
if (!text.endsWith(QLatin1String("br>")))
text.append(QLatin1String("<br>"));
text.append(type + task.description);
}
setProblemLabel(text);
return;
}