本文整理汇总了C++中BaseQtVersion类的典型用法代码示例。如果您正苦于以下问题:C++ BaseQtVersion类的具体用法?C++ BaseQtVersion怎么用?C++ BaseQtVersion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseQtVersion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QLatin1Char
MerQtVersion* MerTarget::createQtVersion() const
{
const FileName qmake = FileName::fromString(targetPath() + QLatin1Char('/') +
QLatin1String(Constants::MER_WRAPPER_QMAKE));
// Is there a qtversion present for this qmake?
BaseQtVersion *qtv = QtVersionManager::qtVersionForQMakeBinary(qmake);
if (qtv && !qtv->isValid()) {
QtVersionManager::removeVersion(qtv);
qtv = 0;
}
if (!qtv)
qtv = new MerQtVersion(qmake, true, targetPath());
//QtVersionFactory::createQtVersionFromQMakePath(qmake, true, targetPath());
QTC_ASSERT(qtv && qtv->type() == QLatin1String(Constants::MER_QT), return 0);
MerQtVersion *merqtv = static_cast<MerQtVersion *>(qtv);
const QString vmName = m_sdk->virtualMachineName();
merqtv->setVirtualMachineName(vmName);
merqtv->setTargetName(m_name);
merqtv->setUnexpandedDisplayName(
QString::fromLatin1("Qt %1 in %2 %3").arg(qtv->qtVersionString(),
vmName, m_name));
return merqtv;
}
示例2: Q_ASSERT
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
示例3: target
QMakeStepConfig QMakeStep::deducedArguments() const
{
ProjectExplorer::Kit *kit = target()->kit();
QMakeStepConfig config;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainKitInformation::toolChain(kit);
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit());
config.archConfig = QMakeStepConfig::targetArchFor(targetAbi, version);
config.osType = QMakeStepConfig::osTypeFor(targetAbi, version);
if (linkQmlDebuggingLibrary() && version && version->qtVersion().majorVersion >= 5)
config.linkQmlDebuggingQQ2 = true;
if (useQtQuickCompiler() && version)
config.useQtQuickCompiler = true;
if (separateDebugInfo())
config.separateDebugInfo = true;
return config;
}
示例4: findVersionById
// Update with results of terminated helper build
void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools)
{
const int index = findVersionById(m_versions, qtVersionId);
if (index == -1)
return; // Oops, somebody managed to delete the version
BaseQtVersion *version = m_versions.at(index);
// Update item view
QTreeWidgetItem *item = treeItemForIndex(index);
QTC_ASSERT(item, return);
DebuggingHelperBuildTask::Tools buildFlags
= item->data(0, BuildRunningRole).value<DebuggingHelperBuildTask::Tools>();
buildFlags &= ~tools;
item->setData(0, BuildRunningRole, QVariant::fromValue(buildFlags));
item->setData(0, BuildLogRole, output);
bool success = true;
if (tools & DebuggingHelperBuildTask::GdbDebugging)
success &= version->hasGdbDebuggingHelper();
if (tools & DebuggingHelperBuildTask::QmlDebugging)
success &= version->hasQmlDebuggingLibrary();
if (tools & DebuggingHelperBuildTask::QmlDump)
success &= version->hasQmlDump();
if (tools & DebuggingHelperBuildTask::QmlObserver)
success &= version->hasQmlObserver();
if (!success)
showDebuggingBuildLog(item);
updateDebuggingHelperUi();
}
示例5: Q_UNUSED
QVariant QtKitInformation::defaultValue(ProjectExplorer::Kit *k) const
{
Q_UNUSED(k);
// find "Qt in PATH":
QList<BaseQtVersion *> versionList = QtVersionManager::unsortedVersions();
BaseQtVersion *result = findOrDefault(versionList, equal(&BaseQtVersion::autodetectionSource,
QString::fromLatin1("PATH")));
if (result)
return result->uniqueId();
// Legacy: Check for system qmake path: Remove in 3.5 (or later):
// This check is expensive as it will potentially run binaries (qmake --version)!
const FileName qmakePath
= BuildableHelperLibrary::findSystemQt(Utils::Environment::systemEnvironment());
if (!qmakePath.isEmpty()) {
result = findOrDefault(versionList, equal(&BaseQtVersion::qmakeCommand, qmakePath));
if (result)
return result->uniqueId();
}
// Use *any* desktop Qt:
result = findOrDefault(versionList, equal(&BaseQtVersion::type,
QString::fromLatin1(QtSupport::Constants::DESKTOPQT)));
return result ? result->uniqueId() : -1;
}
示例6: 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;
}
示例7: QTC_ASSERT
QList<ProjectExplorer::Task> QtKitInformation::validate(const ProjectExplorer::Kit *k) const
{
QList<ProjectExplorer::Task> result;
QTC_ASSERT(QtVersionManager::instance()->isLoaded(), return result);
BaseQtVersion *version = qtVersion(k);
if (!version)
return result;
return version->validateKit(k);
}
示例8: createQtVersionFromQMakePath
BaseQtVersion *QtVersionFactory::createQtVersionFromLegacySettings(const QString &qmakePath, int id, QSettings *s)
{
BaseQtVersion *v = createQtVersionFromQMakePath(qmakePath);
if (!v)
return 0;
v->setId(id);
v->setDisplayName(s->value("Name").toString());
v->restoreLegacySettings(s);
return v;
}
示例9: 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);
}
示例10: emitBuildDirectoryChanged
void Qt4BuildConfiguration::setShadowBuildAndDirectory(bool shadowBuild, const QString &buildDirectory)
{
BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit());
QString directoryToSet = buildDirectory;
bool toSet = (shadowBuild && version && version->isValid() && version->supportsShadowBuilds());
if (m_shadowBuild == toSet && m_buildDirectory == directoryToSet)
return;
m_shadowBuild = toSet;
m_buildDirectory = directoryToSet;
emitBuildDirectoryChanged();
emitProFileEvaluateNeeded();
}
示例11: FileNameList
std::unique_ptr<QmakeProFileNode> QmakeNodeTreeBuilder::buildTree(QmakeProject *project)
{
// Remove qmake implementation details that litter up the project data:
Target *t = project->activeTarget();
Kit *k = t ? t->kit() : KitManager::defaultKit();
BaseQtVersion *qt = k ? QtKitInformation::qtVersion(k) : nullptr;
const FileNameList toExclude = qt ? qt->directoriesToIgnoreInProjectTree() : FileNameList();
auto root = std::make_unique<QmakeProFileNode>(project, project->projectFilePath(),
project->rootProFile());
createTree(project->rootProFile(), root.get(), toExclude);
return root;
}
示例12: configureBuildConfiguration
void QmakeBuildConfigurationFactory::configureBuildConfiguration(Target *parent,
QmakeBuildConfiguration *bc,
const QmakeBuildInfo *qmakeInfo) const
{
BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(parent->kit());
BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
if (qmakeInfo->buildType == BuildConfiguration::Debug)
config |= QtSupport::BaseQtVersion::DebugBuild;
else
config &= ~QtSupport::BaseQtVersion::DebugBuild;
bc->setDefaultDisplayName(qmakeInfo->displayName);
bc->setDisplayName(qmakeInfo->displayName);
BuildStepList *buildSteps = bc->stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
BuildStepList *cleanSteps = bc->stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
Q_ASSERT(buildSteps);
Q_ASSERT(cleanSteps);
QMakeStep *qmakeStep = new QMakeStep(buildSteps);
buildSteps->insertStep(0, qmakeStep);
MakeStep *makeStep = new MakeStep(buildSteps);
buildSteps->insertStep(1, makeStep);
MakeStep *cleanStep = new MakeStep(cleanSteps);
cleanStep->setClean(true);
cleanStep->setUserArguments(QLatin1String("clean"));
cleanSteps->insertStep(0, cleanStep);
QString additionalArguments = qmakeInfo->additionalArguments;
if (!additionalArguments.isEmpty())
qmakeStep->setUserArguments(additionalArguments);
qmakeStep->setLinkQmlDebuggingLibrary(qmakeInfo->config.linkQmlDebuggingQQ2);
qmakeStep->setSeparateDebugInfo(qmakeInfo->config.separateDebugInfo);
qmakeStep->setUseQtQuickCompiler(qmakeInfo->config.useQtQuickCompiler);
bc->setQMakeBuildConfiguration(config);
Utils::FileName directory = qmakeInfo->buildDirectory;
if (directory.isEmpty()) {
directory = defaultBuildDirectory(parent->project()->projectFilePath().toString(),
parent->kit(), qmakeInfo->displayName, bc->buildType());
}
bc->setBuildDirectory(directory);
}
示例13: Q_ASSERT
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;
}
示例14: QLatin1String
QStringList QmakeBuildConfiguration::configCommandLineArguments() const
{
QStringList result;
BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit());
BaseQtVersion::QmakeBuildConfigs defaultBuildConfiguration =
version ? version->defaultBuildConfig() : BaseQtVersion::QmakeBuildConfigs(BaseQtVersion::DebugBuild | BaseQtVersion::BuildAll);
BaseQtVersion::QmakeBuildConfigs userBuildConfiguration = m_qmakeBuildConfiguration;
if ((defaultBuildConfiguration & BaseQtVersion::BuildAll) && !(userBuildConfiguration & BaseQtVersion::BuildAll))
result << QLatin1String("CONFIG-=debug_and_release");
if (!(defaultBuildConfiguration & BaseQtVersion::BuildAll) && (userBuildConfiguration & BaseQtVersion::BuildAll))
result << QLatin1String("CONFIG+=debug_and_release");
if ((defaultBuildConfiguration & BaseQtVersion::DebugBuild) && !(userBuildConfiguration & BaseQtVersion::DebugBuild))
result << QLatin1String("CONFIG+=release");
if (!(defaultBuildConfiguration & BaseQtVersion::DebugBuild) && (userBuildConfiguration & BaseQtVersion::DebugBuild))
result << QLatin1String("CONFIG+=debug");
return result;
}
示例15: BuildConfigurationInfo
QList<BuildConfigurationInfo> Qt4BuildConfigurationFactory::availableBuildConfigurations(const Kit *k,
const QString &proFilePath)
{
QList<BuildConfigurationInfo> infoList;
BaseQtVersion *version = QtKitInformation::qtVersion(k);
if (!version || !version->isValid())
return infoList;
BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig() | QtSupport::BaseQtVersion::DebugBuild;
BuildConfigurationInfo info = BuildConfigurationInfo(config, QString(), QString(), false);
info.directory = Qt4Project::shadowBuildDirectory(proFilePath, k, buildConfigurationDisplayName(info));
infoList.append(info);
info.buildConfig = config ^ BaseQtVersion::DebugBuild;
info.directory = Qt4Project::shadowBuildDirectory(proFilePath, k, buildConfigurationDisplayName(info));
infoList.append(info);
return infoList;
}