本文整理汇总了C++中LibraryLoader::newLibrary方法的典型用法代码示例。如果您正苦于以下问题:C++ LibraryLoader::newLibrary方法的具体用法?C++ LibraryLoader::newLibrary怎么用?C++ LibraryLoader::newLibrary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibraryLoader
的用法示例。
在下文中一共展示了LibraryLoader::newLibrary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotNewProject
void Project::slotNewProject()
{
QString fileName = QFileDialog::getSaveFileName(this, tr("New Project"),
"", tr("Qucs Projects (*.xpro)"));
if(!fileName.isEmpty()) {
if(QString(QFileInfo(fileName).suffix()).isEmpty()) {
fileName = fileName + ".xpro";
}
//First we create the folder structure where files are to be placed
QFileInfo fileInfo = QFileInfo(fileName);
QDir filePath = QDir(fileInfo.absolutePath() + "/" + fileInfo.baseName());
if(!filePath.exists()) {
filePath.setPath(fileInfo.absolutePath());
filePath.mkdir(fileInfo.baseName());
}
fileName = fileInfo.absolutePath() + "/" + fileInfo.baseName() + "/" + fileInfo.fileName();
//Then we create the library/project
LibraryLoader *library = LibraryLoader::instance();
if(library->newLibrary(fileName)) {
slotCloseProject();
setCurrentLibrary(fileName);
projectLibrary = library->library(m_libraryName);
projectLibrary->saveLibrary();
qDebug() << "Succesfully created library!";
m_projectsSidebar->plugLibrary(m_libraryName, "root");
}
}
}