本文整理汇总了C++中Project::AddDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ Project::AddDocument方法的具体用法?C++ Project::AddDocument怎么用?C++ Project::AddDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::AddDocument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddDocument
void Workspace::AddDocument(string projectName, QString& imageFullPath, ProcessingOptions& options)
{
QFileInfo imageFileInfo(imageFullPath);
// Get project.
Project* project = m_Projects[projectName].get();
m_ProjectsPersistentState[projectName] = false;
QString projectDirPath = QString(project->GetDocumentsPath().c_str());
QDir projectDir(projectDirPath);
// Copy image to project dir.
QString dstImageFullPath = projectDir.absoluteFilePath(imageFileInfo.fileName());
QFile::copy(imageFullPath, dstImageFullPath);
// Get image name.
QString docNameQ = imageFileInfo.baseName();
std::string docName = Utils::StringQ2W(docNameQ);
// Add image to project.
Document* document = project->AddDocument(
docName,
Utils::StringQ2W(dstImageFullPath),
options);
// Add image to view model.
auto projRowItem = m_ProjectsModel.findItems(Utils::StringW2Q(projectName));
ProjectItem* projectItem = (ProjectItem*) projRowItem.first();
ProjectItem* docItem = new ProjectItem(docName, true);
QList<QStandardItem*> docRowItem;
docRowItem << docItem;
projectItem->appendRow(docItem);
SetCurrent(project, projectItem, document, docItem);
}
开发者ID:imilos,项目名称:Application-of-pattern-recognition-algorithms-in-neutron-dosimetry,代码行数:35,代码来源:workspace.cpp