示例#1
0
int main(int argc, char** argv)
{
   QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);

   // The QApplication will strip its args from argc/argv, so we want to do 
   // this before putting the command-line args into our ArgumentList, or we
   // will try to open the Qt args as data files.
   QApplication app(argc, argv);
   SystemServicesImp::instance()->WriteLogInfo(QString("%1 Startup").arg(APP_NAME).toStdString());

   // Register the command line options
   ArgumentList* pArgumentList = ArgumentList::instance();
   if (pArgumentList == NULL)
   {
      SystemServicesImp::instance()->WriteLogInfo(QString("%1 Shutdown").arg(APP_NAME).toStdString());
      return -1;
   }

   pArgumentList->registerOption("input");
   pArgumentList->registerOption("deployment");
   pArgumentList->registerOption("debugDeployment");
   pArgumentList->registerOption("exitAfterWizards");
   pArgumentList->registerOption("generate");
   pArgumentList->registerOption("processors");
   pArgumentList->registerOption("");
   pArgumentList->set(argc, argv);

   // Run the application
   InteractiveApplication interactiveApp(app);
   int success = interactiveApp.run(argc, argv);

   SystemServicesImp::instance()->WriteLogInfo(QString("%1 Shutdown").arg(APP_NAME).toStdString());
   return success;
}