本文整理汇总了C++中FolderNode::path方法的典型用法代码示例。如果您正苦于以下问题:C++ FolderNode::path方法的具体用法?C++ FolderNode::path怎么用?C++ FolderNode::path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FolderNode
的用法示例。
在下文中一共展示了FolderNode::path方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addToProject
void JsonSummaryPage::addToProject(const JsonWizard::GeneratorFiles &files)
{
QTC_CHECK(m_fileList.isEmpty()); // Happens after this page is done
QString generatedProject = generatedProjectFilePath(files);
IWizardFactory::WizardKind kind = wizardKind(m_wizard);
FolderNode *folder = currentNode();
if (!folder)
return;
if (kind == IWizardFactory::ProjectWizard) {
if (!static_cast<ProjectNode *>(folder)->addSubProjects(QStringList(generatedProject))) {
QMessageBox::critical(m_wizard, tr("Failed to Add to Project"),
tr("Failed to add subproject \"%1\"\nto project \"%2\".")
.arg(QDir::toNativeSeparators(generatedProject))
.arg(folder->path().toUserOutput()));
return;
}
m_wizard->removeAttributeFromAllFiles(GeneratedFile::OpenProjectAttribute);
} else {
QStringList filePaths = Utils::transform(files, [](const JsonWizard::GeneratorFile &f) {
return f.file.path();
});
if (!folder->addFiles(filePaths)) {
QStringList nativeFilePaths = Utils::transform(filePaths, &QDir::toNativeSeparators);
QMessageBox::critical(wizard(), tr("Failed to Add to Project"),
tr("Failed to add one or more files to project\n\"%1\" (%2).")
.arg(folder->path().toUserOutput(),
nativeFilePaths.join(QLatin1String(", "))));
return;
}
}
return;
}
示例2: processProject
// Add files to project && version control
bool ProjectFileWizardExtension::processProject(
const QList<GeneratedFile> &files,
bool *removeOpenProjectAttribute, QString *errorMessage)
{
*removeOpenProjectAttribute = false;
QString generatedProject = generatedProjectFilePath(files);
FolderNode *folder = m_context->page->currentNode();
if (!folder)
return true;
if (m_context->wizard->kind() == IWizardFactory::ProjectWizard) {
if (!static_cast<ProjectNode *>(folder)->addSubProjects(QStringList(generatedProject))) {
*errorMessage = tr("Failed to add subproject \"%1\"\nto project \"%2\".")
.arg(generatedProject).arg(folder->path());
return false;
}
*removeOpenProjectAttribute = true;
} else {
QStringList filePaths = Utils::transform(files, &GeneratedFile::path);
if (!folder->addFiles(filePaths)) {
*errorMessage = tr("Failed to add one or more files to project\n\"%1\" (%2).").
arg(folder->path(), filePaths.join(QLatin1Char(',')));
return false;
}
}
return true;
}