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


C++ QApplication::exec方法代码示例

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


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

示例1: main

int main(int argc, char **argv)
{
    // creating an application
    QApplication app (argc, argv);

    // create an instance of window class
    Window window;

    // show the window
    window.show();

    // clean exit
    return app.exec();
}
开发者ID:buntyke,项目名称:Qt,代码行数:14,代码来源:main.cpp

示例2: main

// pretty simple, huh?
int main (int argc, char** argv)
{
    QApplication* app = new QApplication (argc, argv);
    app->setApplicationName ("SpeechControl");
    app->setOrganizationDomain ("thesii.org");
    app->setOrganizationName ("Synthetic Intellect Institute");
    app->setWindowIcon (QIcon (":/logo/sc-large"));
    app->setApplicationVersion (SPCHCNTRL_BUILD_VERSION);
    app->setQuitOnLastWindowClosed (false);

    SpeechControl::Core appCore (argc, argv, app);
    appCore.start();
    return app->exec();
}
开发者ID:itnavigate,项目名称:speechcontrol,代码行数:15,代码来源:main.cpp

示例3: main

Q_DECL_EXPORT int main(int argc, char **argv)
{
    QApplication *app = MDeclarativeCache::qApplication(argc, argv);
    QDeclarativeView *window = MDeclarativeCache::qDeclarativeView();

    // Use MDeclarativeCache::applicationDirPath()
    // instead of QCoreApplication::applicationDirPath()
    // because the latter does not work with the booster.
    QDir::setCurrent(MDeclarativeCache::applicationDirPath());

    window->setSource(QUrl::fromLocalFile("main.qml"));
    window->showFullScreen();
    return app->exec();
}
开发者ID:dudochkin-victor,项目名称:touch-applauncherd,代码行数:14,代码来源:main.cpp

示例4: main

// ---------------------------------------------------------------------------
int main (int argc, char **argv)
{
  Set_Epoch  (DEFAULT_EPOCH);
  Set_Format (DEFAULT_FORMAT);

  Load_Arguments (argc, argv);
  QApplication app (argc, argv);

  Digital_Hexal_Clock *clock = new Digital_Hexal_Clock (epoch, output_format);
//  clock->resize (160, 64);
  app.setMainWidget (clock);
  clock->show();
  return app.exec();
}   // main
开发者ID:doug16rogers,项目名称:dr,代码行数:15,代码来源:main.cpp

示例5: main

int main (int argc,char *argv[])
{
    QApplication a (argc, argv);
    QString strStartID = "";
    // Set Encoding to Utf-8
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

    // using cmd line arguments
    if (argc > 1)
    {
        QString strArgs = QString(argv[1]);
        if(strArgs.left(2) == "-s" ) // auto start ID option
        {
            strStartID = strArgs.remove(0,2);
        }
    }
    Mainview w(0,strStartID);

    //check libueye_api Version if working with demo
    DWORD ver = is_GetDLLVersion ();
    bool bDllVersion = false;
    int nDllMajor = ver >> 24;
    int nDllMinor = ver >> 16 & 0xff;
    if (nDllMajor > DLL_VER_MAJOR)
        bDllVersion = true;
    else if (nDllMajor == DLL_VER_MAJOR)
    {
        if (nDllMinor >= DLL_VER_MINOR)
            bDllVersion = true;
    }

    // if DLL version is to old, show a user message and exit the demo
    if (!bDllVersion)
    {
        QMessageBox msgbox;
        msgbox.setText(QString("Demo Version %1 don't work with\n"
                               "libueye_api < %2.%3!\n"
                               "use a newer libueye!")
                               .arg(DEMO_VERSION_STR)
                               .arg(DLL_VER_MAJOR)
                               .arg(DLL_VER_MINOR));
        msgbox.setIcon(QMessageBox::Critical);
        msgbox.exec();
        return 0;
    }

    w.show ();
    return a.exec ();
}
开发者ID:speedyswimmer1000,项目名称:ueyeROS,代码行数:49,代码来源:main.cpp

示例6: visapp3

int visapp3( int argc, char** argv )
{
 	logger::need_to_log(/*true*/);

    QApplication app (argc, argv);
    app.setQuitOnLastWindowClosed(false);
    async_services_initializer init(true);
    
    __main_srvc__ = &init.get_service();

    logging::add_console_writer();
    logging::add_default_file_writer();


    //cmd_line::arg_map am;
    //if (!am.parse(cmd_line::naive_parser().add_arg("task_id", true), argc, argv))
    //{
    //    LogError("Invalid command line");
    //    return 1;
    //}

    //optional<binary::size_type> task_id;
    //if (am.contains("task_id")) 
    //    task_id = am.extract<binary::size_type>("task_id");

    try
    {
        endpoint peer(cfg().network.local_address);

        kernel::vis_sys_props props_;
        props_.base_point = ::get_base();

        visapp s(peer, props_ , argc, argv);

        //tray_icon tricon(":/resources/projector.png", &app);
        //app.connect(&tricon, SIGNAL(menu_exit()), &app, SLOT(quit()));    
        //tricon.show();

        return app.exec();
    }
    catch(const boost::filesystem::filesystem_error& e)
    {
        auto c = e.code().message();
        LogError(c);
    }

	return 0; 

}
开发者ID:wangfeilong321,项目名称:test_osg,代码行数:49,代码来源:visapp3.cpp

示例7: emscriptenQtSDLMain

int emscriptenQtSDLMain(int argc, char *argv[])
#endif
{
    Q_INIT_RESOURCE(sdi);
    QApplication *app = new QApplication(argc, argv);
    app->setApplicationName("SDI Example");
    app->setOrganizationName("Trolltech");
    MainWindow *mainWin = new MainWindow;
#if defined(Q_OS_SYMBIAN)
    mainWin->showMaximized();
#else
    mainWin->show();
#endif
    return app->exec();
}
开发者ID:tsuibin,项目名称:emscripten-qt,代码行数:15,代码来源:main.cpp

示例8: main

int main (int argc, char *argv[])
{
  int val = 0;
  QApplication app (argc, argv);
  ApplicationWindow window (&val);   // Necessary argument !

  Profiler *prof = new Profiler ();
  prof->setWindowTitle ("Profil");
  window.setProfiler (prof);
  if (argc == 2) window.setFile (QString (argv[1]));

  window.show ();
  return app.exec ();
  //  return EXIT_SUCCESS;
}
开发者ID:evenp,项目名称:LiveSegment,代码行数:15,代码来源:main.cpp

示例9: main

int main ( int argc, char ** argv )
{
  QApplication app ( argc, argv );
  
  PasswordImpl pwd;
  if ( pwd.exec() ==QDialog::Accepted ) {
    DialogImpl win;
    win.show();
    app.connect ( &app, SIGNAL ( lastWindowClosed() ), &app, SLOT ( quit() ) );
    return app.exec();
  }
  app.connect ( &app, SIGNAL ( lastWindowClosed() ), &app, SLOT ( quit() ) );
  
  return 1;
}
开发者ID:vdg1,项目名称:cs8-components,代码行数:15,代码来源:main.cpp

示例10: emscriptenQtSDLMain

int emscriptenQtSDLMain(int argc, char *argv[])
#endif
{
    QApplication *app = new QApplication(argc, argv);
    MainWindow *window = new MainWindow;
#if defined(Q_OS_SYMBIAN)
    window->showMaximized();
#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
    window->show();
#else
    window->resize(640, 512);
    window->show();
#endif
    return app->exec();
}
开发者ID:RobertoMalatesta,项目名称:emscripten-qt,代码行数:15,代码来源:main.cpp

示例11: a

int
main (int argc, char **argv)
{
    QApplication a (argc, argv);

    abe *ab = new abe (&argc, argv);

    ab->setWindowTitle (VERSION);

    a.setStyle (new QPlastiqueStyle);

    ab->show ();

    return a.exec ();
}
开发者ID:schwehr,项目名称:pfmabe,代码行数:15,代码来源:main.cpp

示例12: run

void* UIThread::run(void*)
{
    int argc = 1;
    QString appPath = UIThread::get()->getAppPath();
    const char* cPath = appPath.toStdString().c_str();
    const char** argv = &cPath;
    QApplication* app = UIThread::get()->app = new QApplication(argc, (char**)argv);
    app->setQuitOnLastWindowClosed(false);
    UITimer* timer = UIThread::get()->timer = new UITimer();
    timer->start(0);
    pthread_mutex_unlock(&UIThread::get()->baseReady);
    app->exec();
    pthread_exit(NULL);
    return NULL;
}
开发者ID:alex4321,项目名称:GameGuruUi,代码行数:15,代码来源:uithread.cpp

示例13: main

int main(int f_argc_i, char *f_argv_p[])
{
    if ( f_argc_i < 3 || ( std::string(f_argv_p[1]) != "--left" && std::string(f_argv_p[1]) != "--right" ) )
    {
        printf("Usage %s --left imgl1 imgl2 ... imglN --right imgr1 imgr2 ... imgrN\n", f_argv_p[0]);
        printf("Example: %s --left imgs/*c0*.png --right imgs/*c1*.jpg\n", f_argv_p[0]);
        exit(1);        
    }
    
    QApplication app (f_argc_i, f_argv_p);
    
    /// Initialize application
    initialize("Top Level Drawing Lists");

    /// Load image filename data in vectors
    g_counter_i = 0;

    int idx_i = 0;
    for (int i = 1; i < f_argc_i; ++i)
    {
        if (std::string(f_argv_p[i]) == std::string("--left"))
            idx_i = 0;
        else if (std::string(f_argv_p[i]) == std::string("--right"))
            idx_i = 1;
        else
        {
            g_maxImages_i = std::max((int)g_files_v[idx_i].size(), g_maxImages_i);    
            g_files_v[idx_i].push_back ( f_argv_p[i] );
        }        
    }
    
    g_maxImages_i = std::max((int)g_files_v[idx_i].size(), g_maxImages_i);

    /// Set screen count.
    setScreenCount ( cv::Size(1,1) );    
  
    /// Load first image
    loadAndShowFrame ( );
    
    /// Set callback functions
    setKeyPressedEventCBF ( &callBackKeyboard );

    int retval_i = app.exec();

    terminate();

    return retval_i;
}
开发者ID:MichaelSprague,项目名称:qcv-code,代码行数:48,代码来源:anaglyphStereo.cpp

示例14: main

int main(int ac, char** av)
{
    int r;
    QApplication *QPxTool;
    QPxToolMW	*mainwin;
    QTranslator *translator;
	QSplashScreen *splash;
	QString locale = QLocale::system().name();
	QPixmap *pix;
    QPxTool = new QApplication(ac,av);
#ifndef QT_NO_DEBUG
	qDebug("Creating splash screen...");
#endif
	pix = new QPixmap (":images/splash.png");
	splash = new QSplashScreen( *pix );
	splash->show();

	translator = new QTranslator;

#ifndef QT_NO_DEBUG
	qDebug("* Loading translator...");
#endif
#ifdef _WIN32
	if (!translator->load("qpxtool."+locale, "locale")) {
#else
	if (!translator->load("qpxtool."+locale, INSTALL_PREFIX"/share/qpxtool/locale")) {
#endif
		qDebug() << "** Can't load translation for current locale: " << locale;
	} else {
		QPxTool->installTranslator(translator);
	}

	QPxTool->setWindowIcon( QIcon(":images/q.png") );

    mainwin = new QPxToolMW(ac,av);

	splash->finish(mainwin);
    mainwin->show();
    r = QPxTool->exec();

    delete mainwin;
	delete translator;
	delete splash;
	delete pix;
	delete QPxTool;

    return r;
}
开发者ID:touchao123,项目名称:qpxtool,代码行数:48,代码来源:main.cpp

示例15: main

int main(int argc, char *argv[])
{

	QApplication app ( argc , argv );
	if ( !QGLFormat::hasOpenGL ( ) )
	{
		std::cerr << "This system has no OpenGL support" << std::endl;
		return 1;
	}

	MainWindow * form = new MainWindow;

	form->show ( );

	return app.exec ( );
}
开发者ID:felipeCeler,项目名称:celer-demos,代码行数:16,代码来源:main.cpp


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