本文整理汇总了C++中qtsupport::BaseQtVersion::supportsShadowBuilds方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseQtVersion::supportsShadowBuilds方法的具体用法?C++ BaseQtVersion::supportsShadowBuilds怎么用?C++ BaseQtVersion::supportsShadowBuilds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtsupport::BaseQtVersion
的用法示例。
在下文中一共展示了BaseQtVersion::supportsShadowBuilds方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QmakeBuildInfo
QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
const QString &projectPath,
BuildConfiguration::BuildType type) const
{
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
QmakeBuildInfo *info = new QmakeBuildInfo(this);
QString suffix;
if (type == BuildConfiguration::Release) {
//: The name of the release build configuration created by default for a qmake project.
info->displayName = tr("Release");
//: Non-ASCII characters in directory suffix may cause build issues.
suffix = tr("Release", "Shadow build directory suffix");
} else {
//: The name of the debug build configuration created by default for a qmake project.
info->displayName = tr("Debug");
//: Non-ASCII characters in directory suffix may cause build issues.
suffix = tr("Debug", "Shadow build directory suffix");
}
info->typeName = tr("Build");
// Leave info->buildDirectory unset;
info->kitId = k->id();
info->supportsShadowBuild = (version && version->supportsShadowBuilds());
info->buildDirectory
= defaultBuildDirectory(info->supportsShadowBuild, projectPath, k, suffix);
info->type = type;
return info;
}
示例2: selectedToggled
void Qt4TargetSetupWidget::addBuildConfigurationInfo(const BuildConfigurationInfo &info, bool importing)
{
if (importing) {
if (!m_haveImported) {
// disable everything on first import
for (int i = 0; i < m_enabled.count(); ++i) {
m_enabled[i] = false;
m_checkboxes[i]->setChecked(false);
}
m_selected = 0;
}
m_haveImported = true;
}
int pos = m_pathChoosers.count();
m_enabled.append(true);
++m_selected;
m_infoList.append(info);
QCheckBox *checkbox = new QCheckBox;
checkbox->setText(Qt4BuildConfigurationFactory::buildConfigurationDisplayName(info));
checkbox->setChecked(m_enabled.at(pos));
checkbox->setAttribute(Qt::WA_LayoutUsesWidgetRect);
m_newBuildsLayout->addWidget(checkbox, pos * 2, 0);
Utils::PathChooser *pathChooser = new Utils::PathChooser();
pathChooser->setExpectedKind(Utils::PathChooser::Directory);
pathChooser->setPath(info.directory);
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(m_profile);
if (!version)
return;
pathChooser->setReadOnly(!version->supportsShadowBuilds() || importing);
m_newBuildsLayout->addWidget(pathChooser, pos * 2, 1);
QLabel *reportIssuesLabel = new QLabel;
reportIssuesLabel->setIndent(32);
m_newBuildsLayout->addWidget(reportIssuesLabel, pos * 2 + 1, 0, 1, 2);
reportIssuesLabel->setVisible(false);
connect(checkbox, SIGNAL(toggled(bool)),
this, SLOT(checkBoxToggled(bool)));
connect(pathChooser, SIGNAL(changed(QString)),
this, SLOT(pathChanged()));
m_checkboxes.append(checkbox);
m_pathChoosers.append(pathChooser);
m_reportIssuesLabels.append(reportIssuesLabel);
m_issues.append(false);
reportIssues(pos);
emit selectedToggled();
}
示例3: deducedArgumentsAfter
/// -after OBJECTS_DIR, MOC_DIR, UI_DIR, RCC_DIR
QStringList QMakeStep::deducedArgumentsAfter()
{
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (version && !version->supportsShadowBuilds()) {
// We have a target which does not allow shadow building.
// But we really don't want to have the build artefacts in the source dir
// so we try to hack around it, to make the common cases work.
// This is a HACK, remove once all make generators support
// shadow building
return QStringList() << QLatin1String("-after")
<< QLatin1String("OBJECTS_DIR=obj")
<< QLatin1String("MOC_DIR=moc")
<< QLatin1String("UI_DIR=ui")
<< QLatin1String("RCC_DIR=rcc");
}
return QStringList();
}
示例4: QmakeBuildInfo
QmakeBuildInfo *Qt4BuildConfigurationFactory::createBuildInfo(const Kit *k,
const QString &projectPath,
BuildConfiguration::BuildType type) const
{
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
QmakeBuildInfo *info = new QmakeBuildInfo(this);
if (type == BuildConfiguration::Release)
//: The name of the release build configuration created by default for a qmake project.
info->displayName = tr("Release");
else
//: The name of the debug build configuration created by default for a qmake project.
info->displayName = tr("Debug");
info->typeName = tr("Build");
// Leave info->buildDirectory unset;
info->kitId = k->id();
info->supportsShadowBuild = (version && version->supportsShadowBuilds());
info->buildDirectory
= defaultBuildDirectory(info->supportsShadowBuild, projectPath, k, info->displayName);
info->type = type;
return info;
}
示例5: 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;
}