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


C++ QC_ApplicationWindow::slotFileOpen方法代码示例

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


在下文中一共展示了QC_ApplicationWindow::slotFileOpen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........

    RS_DEBUG->print("main: init fontlist..");
    RS_FONTLIST->init();
    RS_DEBUG->print("main: init fontlist: OK");

    RS_DEBUG->print("main: init patternlist..");
    RS_PATTERNLIST->init();
    RS_DEBUG->print("main: init patternlist: OK");

    RS_DEBUG->print("main: loading translation..");

    settings.beginGroup("Appearance");
    QString lang = settings.value("Language", "en").toString();
    QString langCmd = settings.value("LanguageCmd", "en").toString();
    settings.endGroup();

    RS_SYSTEM->loadTranslation(lang, langCmd);
    RS_DEBUG->print("main: loading translation: OK");

    RS_DEBUG->print("main: creating main window..");
    QC_ApplicationWindow appWin;
    RS_DEBUG->print("main: setting caption");
    appWin.setWindowTitle(app.applicationName());

    RS_DEBUG->print("main: show main window");

    settings.beginGroup("Geometry");
    int windowWidth = settings.value("WindowWidth", 1024).toInt();
    int windowHeight = settings.value("WindowHeight", 1024).toInt();
    int windowX = settings.value("WindowX", 32).toInt();
    int windowY = settings.value("WindowY", 32).toInt();
    settings.endGroup();

    if (!first_load)
        appWin.resize(windowWidth, windowHeight);

    appWin.move(windowX, windowY);

    bool maximize = settings.value("Startup/Maximize", 0).toBool();

    if (maximize || first_load)
        appWin.showMaximized();
    else
        appWin.show();

    RS_DEBUG->print("main: set focus");
    appWin.setFocus();
    RS_DEBUG->print("main: creating main window: OK");

    if (show_splash)
    {
        RS_DEBUG->print("main: updating splash");
        splash->raise();
        splash->showMessage(QObject::tr("Loading..."),
                Qt::AlignRight|Qt::AlignBottom, Qt::black);
        RS_DEBUG->print("main: processing events");
        qApp->processEvents();
        RS_DEBUG->print("main: updating splash: OK");
    }

    // Set LC_NUMERIC so that entering numeric values uses . as the decimal seperator
    setlocale(LC_NUMERIC, "C");

    RS_DEBUG->print("main: loading files..");
    bool files_loaded = false;
    for (QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it )
    {
        if (show_splash)
        {
            splash->showMessage(QObject::tr("Loading File %1..")
                    .arg(QDir::toNativeSeparators(*it)),
            Qt::AlignRight|Qt::AlignBottom, Qt::black);
            qApp->processEvents();
        }
        appWin.slotFileOpen(*it, RS2::FormatUnknown);
        files_loaded = true;
    }
    RS_DEBUG->print("main: loading files: OK");

    if (!files_loaded)
    {
        appWin.slotFileNewNew();
    }

    if (show_splash)
        splash->finish(&appWin);
    else
        delete splash;

    if (first_load)
        settings.setValue("Startup/FirstLoad", 0);

    RS_DEBUG->print("main: entering Qt event loop");

    int return_code = app.exec();

    RS_DEBUG->print("main: exited Qt event loop");

    return return_code;
}
开发者ID:r-a-v-a-s,项目名称:LibreCAD,代码行数:101,代码来源:main.cpp

示例2: main


//.........这里部分代码省略.........
                        langCmd=QC_PREDEFINED_LOCALE;
                        RS_SETTINGS->writeEntry("/LanguageCmd", langCmd);
                }
#else
    lang = RS_SETTINGS->readEntry("/Language", "en");
    langCmd = RS_SETTINGS->readEntry("/LanguageCmd", "en");
#endif
        RS_SETTINGS->endGroup();

        RS_SYSTEM->loadTranslation(lang, langCmd);
        RS_DEBUG->print("main: loading translation: OK");

#ifdef QSPLASHSCREEN_H
        splash = new QSplashScreen(*pixmap);
        splash->show();
        splash->showMessage(QObject::tr("Loading.."),
                Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL);
        RS_DEBUG->print("main: splashscreen: OK");
#endif

    //QApplication::setStyle(new QWindowsStyle());
    //QApplication::setStyle(new QPlatinumStyle());

#ifdef QC_BUILTIN_STYLE //js:
        RS_DEBUG->print("main: applying built in style..");
        applyBuiltinStyle();
#endif

        RS_DEBUG->print("main: creating main window..");
    QC_ApplicationWindow * appWin = new QC_ApplicationWindow();
        RS_DEBUG->print("main: setting caption");
    appWin->setWindowTitle(XSTR(QC_APPNAME));
        RS_DEBUG->print("main: show main window");
    appWin->show();
        RS_DEBUG->print("main: set focus");
        appWin->setFocus();
        RS_DEBUG->print("main: creating main window: OK");

#ifdef QSPLASHSCREEN_H
        if (splash) {
                RS_DEBUG->print("main: updating splash..");
                splash->showMessage(QObject::tr("Loading..."),
                        Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL);
                RS_DEBUG->print("main: processing events");
                qApp->processEvents();
                RS_DEBUG->print("main: updating splash: OK");
        }
#endif

        // Set LC_NUMERIC so that enetring numeric values uses . as teh decimal seperator
        setlocale(LC_NUMERIC, "C");

        RS_DEBUG->print("main: loading files..");
        bool files_loaded = false;
        for (QStringList::Iterator it = fileList.begin(); it != fileList.end();
                ++it ) {

#ifdef QSPLASHSCREEN_H
                        if (splash) {
                                splash->showMessage(QObject::tr("Loading File %1..")
                                        .arg(QDir::toNativeSeparators(*it)),
                                Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL);
                                qApp->processEvents();
                        }
#endif
                        appWin->slotFileOpen(*it, RS2::FormatUnknown);
                        files_loaded = true;
        }
        RS_DEBUG->print("main: loading files: OK");

#ifdef QSPLASHSCREEN_H
# ifndef QC_DELAYED_SPLASH_SCREEN
        if (splash) {
                splash->finish(appWin);
                delete splash;
                splash = 0;
        }
# endif
        delete pixmap;
#endif

    //app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));

        RS_DEBUG->print("main: app.exec()");

        if (!files_loaded) {
                appWin->slotFileNewNew();
        }

        appWin->slotRunStartScript();

        int r = app.exec();

        RS_DEBUG->print("main: Temporary disabled  delete appWin");
        // delete appWin;

        RS_DEBUG->print("main: finished");

        return r;
}
开发者ID:tianqizi,项目名称:LibreCAD,代码行数:101,代码来源:main.cpp

示例3: main


//.........这里部分代码省略.........
        RS_SETTINGS->endGroup();

        RS_SYSTEM->loadTranslation(lang, langCmd);
        RS_DEBUG->print("main: loading translation: OK");

#ifdef QSPLASHSCREEN_H
        RS_SETTINGS->beginGroup("Appearance");
        {
            bool showSplash=RS_SETTINGS->readNumEntry("/ShowSplash",1)==1;
            if(showSplash){
                splash = new QSplashScreen(*pixmap);
                splash->show();
                splash->showMessage(QObject::tr("Loading.."),
                                    Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL);
                RS_DEBUG->print("main: splashscreen: OK");
            }
        }
        RS_SETTINGS->endGroup();
#endif

    //QApplication::setStyle(new QWindowsStyle());
    //QApplication::setStyle(new QPlatinumStyle());

#ifdef QC_BUILTIN_STYLE //js:
        RS_DEBUG->print("main: applying built in style..");
        applyBuiltinStyle();
#endif

        RS_DEBUG->print("main: creating main window..");
    QC_ApplicationWindow * appWin = new QC_ApplicationWindow();
        RS_DEBUG->print("main: setting caption");
    appWin->setWindowTitle(XSTR(QC_APPNAME));
        RS_DEBUG->print("main: show main window");
    appWin->show();
        RS_DEBUG->print("main: set focus");
        appWin->setFocus();
        RS_DEBUG->print("main: creating main window: OK");

#ifdef QSPLASHSCREEN_H
        if (splash) {
                RS_DEBUG->print("main: updating splash..");
                splash->showMessage(QObject::tr("Loading..."),
                        Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL);
                RS_DEBUG->print("main: processing events");
                qApp->processEvents();
                RS_DEBUG->print("main: updating splash: OK");
        }
#endif

        // Set LC_NUMERIC so that enetring numeric values uses . as teh decimal seperator
        setlocale(LC_NUMERIC, "C");

        RS_DEBUG->print("main: loading files..");
        bool files_loaded = false;
        for (QStringList::Iterator it = fileList.begin(); it != fileList.end();
                ++it ) {

#ifdef QSPLASHSCREEN_H
                        if (splash) {
                                splash->showMessage(QObject::tr("Loading File %1..")
                                        .arg(QDir::toNativeSeparators(*it)),
                                Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL);
                                qApp->processEvents();
                        }
#endif
                        appWin->slotFileOpen(*it, RS2::FormatUnknown);
                        files_loaded = true;
        }
        RS_DEBUG->print("main: loading files: OK");

#ifdef QSPLASHSCREEN_H
# ifndef QC_DELAYED_SPLASH_SCREEN
        if (splash) {
                splash->finish(appWin);
                delete splash;
                splash = nullptr;
        }
# endif
        delete pixmap;
#endif

    //app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));

        RS_DEBUG->print("main: app.exec()");

        if (!files_loaded) {
                appWin->slotFileNewNew();
        }

        appWin->slotRunStartScript();

        int r = app.exec();

        RS_DEBUG->print("main: Temporary disabled  delete appWin");
        // delete appWin;

        RS_DEBUG->print("main: finished");

        return r;
}
开发者ID:rmamba,项目名称:LibreCAD,代码行数:101,代码来源:main.cpp


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