Ejemplo n.º 1
0
int main(int argc, char ** argv)
{

	QApplication app( argc, argv );
	if ( !QGLFormat::hasOpenGL() ) 
		qFatal( "This system has no OpenGL support" ); 
		
		
		
		
	QString filename;
	
	for( int i = 1; i < argc; i ++ ) {
		if( ( QString( "-h" ) == argv[ i ] ) ||
			( QString( "--help" ) == argv[ i ] ) ) {
			printUsage( argv[0] );
			exit( 1 );
		}
		
		if( QString( argv[ i ] ).startsWith( "-" ) ) {
		qWarning( "ERROR: Invalid argument specified: %s",
		argv[ i ] );
		printUsage( argv[ 0 ] );
		exit( 1 );
        }

        filename = argv[ i ];
    }


	MainWindowImpl win;
	win.show(); 
	app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
	return app.exec();
}
Ejemplo n.º 2
0
int main(int argc, char ** argv)
{
	QApplication app( argc, argv );
	QCoreApplication::setApplicationName("qrdc");
	QCoreApplication::setApplicationVersion("0.0.1");
	QCoreApplication::setOrganizationName("TI_Eugene");
	QCoreApplication::setOrganizationDomain("eap.su");
	// <tr>
	QTranslator appTranslator;
	QString trpath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);	// /usr/share/qt4/translations
	QString trfile = QCoreApplication::applicationName() + "_" + QLocale::system().name().left(2);
	if (not QFile::exists(trpath + QDir::separator() + trfile + ".qm"))
		trpath = app.applicationDirPath() + QDir::separator() + "i18n";
	appTranslator.load(trpath + QDir::separator() + trfile);
	app.installTranslator(&appTranslator);
	// </tr>
	// <db>
	QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
	if (!createConnection(db))
		return 1;
	// </db>
	MainWindowImpl *win = new MainWindowImpl();
	win->setModels(&db);
	win->go(); 
	app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
	int retvalue = app.exec();
	delete win;
	db.close();
	return retvalue;
}
Ejemplo n.º 3
0
int main(int argc, char * argv[])
{
    QApplication a( argc, argv );
    MainWindowImpl win;
    win.showMaximized();

    return a.exec();
}
Ejemplo n.º 4
0
int main(int argc, char ** argv)
{
	QApplication app( argc, argv );
        MainWindowImpl win;
	win.show(); 
	app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
	return app.exec();
}
Ejemplo n.º 5
0
int main(int argc, char** argv)
{
    Application app(argc, argv);
    application = &app;

    if (!app.init(argc, argv))
        return 0;

    MainWindowImpl win;
    winMain = &win;
    win.init();
    win.show();
    win.initAfterShow();

    app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
    return app.exec();
}
Ejemplo n.º 6
0
int main(int argc, char ** argv)
{
        QApplication app( argc, argv );        
        MainWindowImpl win;
        QDesktopWidget *desktop = QApplication::desktop();

        int WIDTH = win.size().width();
        int HEIGHT = win.size().height();
        int screenWidth = desktop->width();
        int screenHeight = desktop->height();
        int x = (screenWidth - WIDTH) / 2;
        int y = (screenHeight - HEIGHT) / 2;
        win.move( x, y );
	win.show(); 
	app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
	return app.exec();
}
Ejemplo n.º 7
0
void DialogNew::on_buttonSetKey_clicked()
{
    MainWindowImpl* p = (MainWindowImpl*)(this->parent());
    p->on_actionSetKeyMatrix_triggered();
}
Ejemplo n.º 8
0
void DialogNew::on_buttonSetInput_clicked()
{
    MainWindowImpl* p = qobject_cast<MainWindowImpl*>(this->parent());
    p->on_actionSetInputMatrix_triggered();
}