Example #1
0
File: main.cpp Project: buntyke/Qt
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();
}
Example #2
0
// 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();
}
Example #3
0
void startKinect(int argc, char **argv){
	// Parse command line options.
    arg_base::set_help_option("-h");
    arg_parse(argc, argv);

    // Set debug level to 1.
    ntk::ntk_debug_level = 1;

	QApplication app (argc, argv);
	expQt *dialog = new expQt(argc,argv);
 
    dialog->show();
    app.exec();
}
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();
}
Example #5
0
// ---------------------------------------------------------------------------
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
Example #6
0
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 ();
}
Example #7
0
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; 

}
Example #8
0
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();
}
Example #9
0
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;
}
Example #10
0
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;
}
Example #11
0
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();
}
Example #12
0
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 ();
}
Example #13
0
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;
}
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;
}
Example #15
0
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;
}
Example #16
0
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 ( );
}
int main( int argc, char** argv ) {
	QApplication *qapp = new QApplication( argc, argv );

	JackMix::GUI::MidiControlChannelAssigner *mw
		= new JackMix::GUI::MidiControlChannelAssigner( "Test",
							        "Test Channel Allocation",
							        QStringList()<<"Channel 1"<<"Channel 2",
							        QList<int>() << 32 << 33
							      );
	
	ResultPrinter rp(mw);
	mw->show();

	int ret = qapp->exec();
	return ret;
}
Example #18
0
int main(int argc, char *argv[]){
    QApplication *app = new QApplication(argc, argv);

    QString locale = QLocale::system().name();
    QTranslator translate;
        translate.load(QString("translation_" + locale.mid(0,2)));
    app->installTranslator(&translate);

    //qDebug() << "Translation:";
    //qDebug() << "Locale:"           << locale.mid( 0, 2 );
    //qDebug() << "File existance:"   << translate.isEmpty();

    MainWindow *win = new MainWindow();
    CoreObject *core = new CoreObject(0, win);
    return app->exec();
}
Example #19
0
int main(int argc, char **argv)
{
    QApplication app (argc, argv);
    app.setOrganizationName("SfietKonstantin");
    app.setApplicationName("qfb-demo");

    Bridge bridge;

    QDeclarativeView view;
    view.engine()->addImportPath(IMPORT_PATH);
    view.rootContext()->setContextProperty("BRIDGE", &bridge);
    view.setSource(QUrl(MAIN_QML_FILE));
    view.show();

    return app.exec();
}
Example #20
0
NV_INT32
main (NV_INT32 argc, NV_CHAR **argv)
{
  QApplication a (argc, argv);


  mosaicView *mv = new mosaicView (argc, argv);

  a.setStyle (new QPlastiqueStyle);

  mv->show ();

  mv->redrawMap ();

  return a.exec ();
}
Example #21
0
int
main (int argc, char *argv[])
{
	char hostname[1024];
	hostname[1023] = '\0';
	gethostname(hostname, 1023);
    
	QApplication app (argc, argv);
	
	char str_display[1050];
	snprintf(str_display, 1050, "i7z @ %s", hostname);
        MyWidget i7z_widget;
	i7z_widget.setWindowTitle(str_display);
	i7z_widget.show ();
	return app.exec ();
}
Example #22
0
int main(int argc, char *argv[]){

		if(!QFile::exists(QDir::homePath() + QDir::separator() + ".Sayonara")){
			QDir().mkdir(QDir::homePath() + QDir::separator() +  "/.Sayonara");
		}

		QApplication app (argc, argv);
			app.setApplicationName("Sayonara");
			app.setWindowIcon(QIcon(Helper::getIconPath() + "play.png"));

            Application application(&app);

        app.exec();

        return 0;
}
Example #23
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    qDebug() << "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
    QApplication *app = MDeclarativeCache::qApplication(argc, argv);
    app->setOrganizationName("frals");
    app->setOrganizationDomain("frals.se");
    app->setApplicationName("lpmcustomizer");

    QFont font = QFont("Nokia Pure Text Light");
    app->setFont(font);

    QDeclarativeView *view = MDeclarativeCache::qDeclarativeView();
    QDeclarativeContext *ctx = view->rootContext();

    view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
    view->setInputMethodHints(Qt::ImhNoPredictiveText);

    qmlRegisterType<GalleryItem>("LPM", 1, 0, "GalleryItem");

    PlatformIntegration *p = new PlatformIntegration(ctx);
    ImageGenerator *ig = new ImageGenerator();
    ImageSaver *is = new ImageSaver(ig);

    QObject::connect(is, SIGNAL(imageSaved(QString)), p, SLOT(onImageSaved(QString)));

    view->engine()->addImageProvider(QString("logocreator"), ig);

    ctx->setContextProperty("platform", p);
    ctx->setContextProperty("imageSaver", is);

    p->updateGallery();

    QObject::connect(view->engine(), SIGNAL(quit()), app, SLOT(quit()));

//    QString pathInInstallDir = QCoreApplication::applicationDirPath()
//            + QLatin1String("/../") + "qml/lpmcustomizer";

    view->setSource(QUrl("qrc:/qml/main.qml"));
    view->showFullScreen();

//    QmlApplicationViewer viewer;
//    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
//    viewer.setMainQmlFile(QLatin1String("qml/LPMCustomizer/main.qml"));
//    viewer.showExpanded();

    return app->exec();
}
Example #24
0
int main(int argc, char *argv[]) {
    srand(time(NULL));

    QApplication *a = new QApplication(argc, argv);
    window win(a);

    QDesktopWidget *d = QApplication::desktop();

    int wid = (d->width() - S_WID)/2;
    int hgt = (d->height() - S_HGT)/2;

    win.setGeometry(wid, hgt, S_WID, S_HGT);
    win.setFixedSize(S_WID, S_HGT);

    win.show();
    return a->exec();
}
Example #25
0
int main(int argc, char *argv[])
{
    //Q_INIT_RESOURCE(application);

	QApplication *app = new QApplication(argc, argv);
	app->setStyle("gtk");
	app->setAttribute(Qt::AA_NativeWindows, true);

	MainWindow *mainWin = new MainWindow();

    int ret = app->exec();

    delete mainWin;
    delete app;

	return ret;
}
Example #26
0
int
main (int argc, char *argv[])
{
  QApplication app (argc, argv);

  StandaloneMenu  menu;
  menu.setWindowFlags (Qt::Window | Qt::FramelessWindowHint);
  menu.move (0,0);
  menu.run();

  QObject::connect (&menu, SIGNAL(exiting()), &app, SLOT(quit()));

  menu.run ();

  return app.exec ();
  
}
Example #27
0
void qtTest(QApplication &app) {
    Render render = createRender();
    render.m_maxDepth = 20;
    render.m_renderSize = ImageSize(300, 200);
    render.m_processedSize = ImageSize(1200, 800);

    ImageWidget *oiw = new ImageWidget(render);

    QHBoxLayout *imgs = new QHBoxLayout();
        imgs->addWidget(oiw);

    QWidget *topWidget = new QWidget();
    topWidget->setLayout(imgs);
    topWidget->show();

    app.exec();
}
Example #28
0
int main(int argc, char *argv[]){
	QApplication app (argc, argv);
	QMainWindow window;
	GuiMainWindow gui;
	gui.setupUi(&window);
/*
	Vision v = Vision();	
	QImage img = v.cvMatToQImage(v.getFrame());

	QGraphicsScene * scene = new QGraphicsScene();
	scene->addPixmap(QPixmap::fromImage(img));
	gui.graphicsView->setScene(scene);*/

	window.show();

	return app.exec();
}
int main ( int argc, char*argv[] )
{
	int i;
	char projectM_data[1024];

	QApplication app ( argc, argv );

	setlocale(LC_NUMERIC, "C");  // Fix
	std::string config_file;
	config_file = read_config();

	
	QMutex audioMutex;
	
	QProjectM_MainWindow * mainWindow = new QProjectM_MainWindow ( config_file, &audioMutex);
	
	QAction pulseAction("Pulse audio settings...", mainWindow);
	
	
      	mainWindow->registerSettingsAction(&pulseAction);
	mainWindow->show();
	
	QPulseAudioThread * pulseThread = new QPulseAudioThread(argc, argv, mainWindow);

	pulseThread->start();
		
	//QApplication::connect
	//		(mainWindow->qprojectMWidget(), SIGNAL(projectM_Initialized(QProjectM *)), pulseThread, SLOT(setQrojectMWidget(QProjectMWidget*)));
	
	QPulseAudioDeviceChooser devChooser(pulseThread, mainWindow);	
	QApplication::connect(&pulseAction, SIGNAL(triggered()), &devChooser, SLOT(open())); 
	//QApplication::connect(pulseThread, SIGNAL(threadCleanedUp()), mainWindow, SLOT(close()));
	
	//QApplication::connect(mainWindow, SIGNAL(shuttingDown()), pulseThread, SLOT(cleanup()), Qt::DirectConnection);
 	int ret = app.exec();
	devChooser.writeSettings();
	
	if (mainWindow)
        	mainWindow->unregisterSettingsAction(&pulseAction);

	pulseThread->cleanup();
	
	delete(pulseThread);
	return ret;
}
Example #30
0
int main ( int argc, char *argv[] )
{
    // Some checks here..
    {
        //
        // Check if the Script Editor isn't running twice.
        //
        if ( TerminateIfRunning () )
        {
            MessageBoxA ( NULL, "The MTA Script Editor is already running!", "ERROR", MB_ICONEXCLAMATION | MB_OK );
            TerminateProcess ( GetCurrentProcess (), 1 );
        }

        //
        // Check the OS version.
        //
        if ( IsWindowsXPSP2OrLater () == FALSE )
        {
            // Outdated Windows version.
            MessageBoxA ( NULL, "Sorry, but to run the MTA Script Editor you need at least Windows XP SP2!\n\nIf you have Windows XP SP2 or higher, please submit a bugreport at: bugs.mtasa.com", "ERROR", MB_ICONEXCLAMATION | MB_OK );
            TerminateProcess ( GetCurrentProcess (), 1 );
        }
    }

    QApplication a ( argc, argv );

    //
    // Init crash handler.
    //
    new CCrashHandler;

    g_pWindow = new CEditor;
    SetEditorVisible ( true );

    //
    // Is this our first run ?
    //
    //if ( CRegistry::GetBool ( "firstRun" ) == true )
    {
        CFirstRun* pFirstWindow = new CFirstRun;
        pFirstWindow->SetVisible ( true );
    }

    return a.exec ();
}