int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindowView w; w.show(); if(argc > 1) w.OpenXmlFile(argv[1], true); //For fast test //w.OpenXmlFile("C:/Users/maurizio.biancucci/Desktop/prova - Copy.xml", true); //w.OpenXmlFile("E:/workspaces/motogp14/build/DebugGame/Data/Graphic/Bike/BikeBehaviourConfig.xml", true); return a.exec(); }
/*! * \fn int main(int argc, char **argv) * Fonction principale * \return Le code de fin d'execution de la main loop. */ int main (int argc,char **argv) { QApplication app(argc,argv); MainWindow *fen = new MainWindow(NULL); IIrcEngine *engine = NonNativeIrcEngine::engine(); QObject::connect(fen, SIGNAL(connectMe(const QString&, int, const QString&)), engine, SLOT(initiateConnection(const QString&, int, const QString&))); QObject::connect(engine, SIGNAL(lineReceived(QString)), fen, SLOT(readServer(QString))); QObject::connect(fen, SIGNAL(sendASCIIMessage(const QString&)), engine, SLOT(sendASCIIMessage(const QString&))); /* La QMainWindow */ MainWindowView *mW = new MainWindowView(fen,NULL); mW->show(); XmlConfManager *confMan = XmlConfManager::confManager(); /*confMan->addServer("test"); confMan->addNetwork("test", confMan->createNetwork("irc.fansub-irc.eu", "6667")); confMan->changeUser("test", confMan->createUser("pierre", "pierreghost", "user", "real")); confMan->changeFavChan("test", "#fsf,#Kyubi-Wolf"); confMan->changeCommand("test", "/ns identify albachat"); confMan->save();*/ confMan->read(); ServerList *serverList = new ServerList(); QObject::connect(serverList, SIGNAL(connectSignal(QString&, int, QString&)), fen, SLOT(connexion(QString&, int, QString&))); QObject::connect(engine, SIGNAL(connectError()), serverList, SLOT(reconnect())); serverList->show(); return app.exec(); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(resources); qInstallMessageHandler(messageOutput); QApplication app(argc, argv); app.setStyleSheet(loadStyleSheet(":/qss/main.qss")); // Вызываем поддержку перевода QTranslator * qt_translator = new QTranslator(); QString file_translate = QApplication::applicationDirPath() + "/ru.qm"; if ( !qt_translator->load(file_translate)) { delete qt_translator; } else qApp->installTranslator( qt_translator ); //initialize file of settings if(!Setting::init()) { QMessageBox::information(0, "Error", "Can not create file of setting: uploader.ini"); qDebug() << "Can not create file of setting: uploader.ini"; exit(0); } else qDebug() << "Create uploader.ini"; qDebug() << "Project started"; try { MainWindowView* viewMain = MainWindowView::instance(); //MainWindowView viewMain; if(!viewMain->initControls()) throw(QString("Don't create MainWindowView!")); AddFilesPanelView viewAddPanel(viewMain); if(!viewAddPanel.initControls()) throw(QString("Don't create AddFilePanel!")); UploadProgressView viewUploadPanel(viewMain); if(!viewUploadPanel.initControls()) throw(QString("Don't create UploadProgressView!")); AddFilesPresenter presenterAdd(&viewAddPanel); UploadProgressPresenter presenterUpload(&viewUploadPanel); viewMain->setPanel(&viewAddPanel, &viewUploadPanel); MainWindowPresenter presenterMain(viewMain); presenterMain.addPresenter(&presenterAdd, &presenterUpload); viewMain->show(); return app.exec(); } catch(QString ex_str) { QMessageBox::information(0, "Error!", ex_str); qDebug() << "Error: " << ex_str; exit(0); } catch(...) { QMessageBox::information(0, "Error!", "Unknown error!"); qDebug() << "Unknown error!"; exit(0); } return 0;//app.exec(); }
void ApplicationController::handleAuthenticationSuccess() { MainWindowView *applicationWindow = new MainWindowView(); connect(applicationWindow, SIGNAL(quitApplication()), this, SLOT(quitApplication())); applicationWindow->show(); }