本文整理汇总了C++中Qt4ProFileNode::targetInformation方法的典型用法代码示例。如果您正苦于以下问题:C++ Qt4ProFileNode::targetInformation方法的具体用法?C++ Qt4ProFileNode::targetInformation怎么用?C++ Qt4ProFileNode::targetInformation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Qt4ProFileNode
的用法示例。
在下文中一共展示了Qt4ProFileNode::targetInformation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: snippet
QString InternalLibraryDetailsController::snippet() const
{
const int currentIndex = libraryDetailsWidget()->libraryComboBox->currentIndex();
if (currentIndex < 0)
return QString();
if (m_rootProjectPath.isEmpty())
return QString();
// dir of the root project
QDir rootDir(m_rootProjectPath);
// relative path for the project for which we insert the snippet,
// it's relative to the root project
const QString proRelavitePath = rootDir.relativeFilePath(proFile());
// project for which we insert the snippet
const ProjectExplorer::Project *project =
ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projectForFile(proFile());
// the build directory of the active build configuration
QDir rootBuildDir(project->activeTarget()->activeBuildConfiguration()->buildDirectory());
// the project for which we insert the snippet inside build tree
QFileInfo pfi(rootBuildDir.filePath(proRelavitePath));
// the project dir for which we insert the snippet inside build tree
QDir projectBuildDir(pfi.absolutePath());
// current project node from combobox
QFileInfo fi(proFile());
QDir projectSrcDir(fi.absolutePath());
// project node which we want to link against
Qt4ProFileNode *proFileNode = m_proFileNodes.at(currentIndex);
TargetInformation targetInfo = proFileNode->targetInformation();
const QString targetRelativePath = appendSeparator(projectBuildDir.relativeFilePath(targetInfo.buildDir));
const QString includeRelativePath = projectSrcDir.relativeFilePath(libraryDetailsWidget()->includePathChooser->path());
const bool useSubfolders = libraryDetailsWidget()->useSubfoldersCheckBox->isChecked();
const bool addSuffix = libraryDetailsWidget()->addSuffixCheckBox->isChecked();
QString snippetMessage;
QTextStream str(&snippetMessage);
str << "\n";
// replace below to "PRI_OUT_PWD" when task QTBUG-13057 is done
// (end enable adding libraries into .pri files as well).
const QString outPwd = QLatin1String("OUT_PWD");
str << generateLibsSnippet(platforms(), macLibraryType(), targetInfo.target,
targetRelativePath, outPwd,
useSubfolders, addSuffix, true);
str << generateIncludePathSnippet(includeRelativePath);
str << generatePreTargetDepsSnippet(platforms(), linkageType(), targetInfo.target,
targetRelativePath, outPwd,
useSubfolders, addSuffix);
return snippetMessage;
}