当前位置: 首页>>代码示例>>C++>>正文


C++ LibraryLoader::library方法代码示例

本文整理汇总了C++中LibraryLoader::library方法的典型用法代码示例。如果您正苦于以下问题:C++ LibraryLoader::library方法的具体用法?C++ LibraryLoader::library怎么用?C++ LibraryLoader::library使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LibraryLoader的用法示例。


在下文中一共展示了LibraryLoader::library方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
        }
    }
}
开发者ID:damiansimanuk,项目名称:qucs-qt4,代码行数:31,代码来源:project.cpp

示例2: slotOpenProject

void Project::slotOpenProject(QString fileName)
{
    if(fileName == 0) {
        fileName = QFileDialog::getOpenFileName(this, tr("Open Project"),
                                                "", tr("Qucs Projects (*.xpro)"));
    }

    if(!fileName.isEmpty()) {

        LibraryLoader *library = LibraryLoader::instance();

        if(library->load(fileName)) {
            slotCloseProject();
            setCurrentLibrary(fileName);
            projectLibrary = library->library(m_libraryName);
            qDebug() << "Succesfully loaded library!";
            m_projectsSidebar->plugLibrary(m_libraryName, "root");
        }
    }
}
开发者ID:damiansimanuk,项目名称:qucs-qt4,代码行数:20,代码来源:project.cpp


注:本文中的LibraryLoader::library方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。