Ejemplo n.º 1
0
int main( int argc, char ** argv )
{   
	 hw = new HWSRV(1); 
	 int error = hw->ErrNum;
	 QApplication a (argc, argv);
	 QDesktopWidget * d = a.desktop();
	 int resolution_width = d->width();  
	 int resolution_heigth = d->height();
	 w = new Configurations; 
	 int wid = w->width(); 
	 int heig = w->height();
	 if ((wid>resolution_width)||(heig>resolution_heigth)){
		  w->setWindowState(Qt::WindowFullScreen);
		  w->setMinimumSize(QSize(resolution_width,resolution_heigth));
		  w->setMaximumSize(QSize(resolution_width,resolution_heigth));
		  w->adjustSize();
	 }
	 w -> show();
	 a. processEvents();
	 a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
	 sigset(SIGUSR1,catch_sig);
	 if (error>2){
		  QString er_str;
		  QString er_id;
		  HWSRVErrorText(error,er_str,er_id);
		  InterfaceErrorWin(er_str, er_id);
		  return error;
	 }
	 int ret = a.exec(); 
	 return ret;
}
Ejemplo n.º 2
0
int main( int argc, char ** argv )
{   
    QApplication a (argc, argv);  
    
    	 QDesktopWidget * d = a.desktop();
	 int resolution_width = d->width();     // returns desktop width
	 int resolution_heigth = d->height();    // returns desktop height
	 
	 hw = new HWSRV();    
	 get_setup_params();
	 if (sp.autoblock_flag) bt =new BlockTimer(sp.autoblock_time);
	
	 init_keyboard_device(&a);
	 w = new MainWareform;  
	 
	 a.setMainWidget(w);
	 
	 int wid = w->width(); 
	 int heig = w->height();
	 // printf("wid = %d heig = %d\n", wid, heig); 
	 if ((wid>resolution_width)||(heig>resolution_heigth)){
		  w->setWindowState(Qt::WindowFullScreen);
		  w->setMinimumSize(QSize(resolution_width,resolution_heigth));
		  w->setMaximumSize(QSize(resolution_width,resolution_heigth));
		  w->adjustSize();
	 }
	 
	 w->limit = 20;
	 w->FillTable("0");
	 w->show();
	 
	 int ret = a.exec();
	 //printf("ret = %d\n",ret);
	 if ( kbcode_scaner != NULL ) delete kbcode_scaner;
	 if ( kbcode_reader != NULL ) delete kbcode_reader;
	 
	 return ret;
}