Exemplo 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();
}
Exemplo n.º 2
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();
}
Exemplo n.º 3
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();
}
Exemplo n.º 4
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();
}