Changeset 8897 in ntrip for trunk/BNC/src/bncmain.cpp


Ignore:
Timestamp:
Mar 13, 2020, 9:52:09 AM (4 years ago)
Author:
stuerze
Message:

adaptation to qt5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmain.cpp

    r8896 r8897  
    367367
    368368  bool GUIenabled = interactive || displaySet;
    369   t_app app(argc, argv, GUIenabled);
    370 
    371   app.setApplicationName("BNC");
    372   app.setOrganizationName("BKG");
    373   app.setOrganizationDomain("www.bkg.bund.de");
    374 
    375   BNC_CORE->setGUIenabled(GUIenabled);
     369  QScopedPointer<QCoreApplication> app(createApplication(argc, argv, GUIenabled));
     370
     371  if (qobject_cast<QApplication *>(app.data())) { // start GUI version
     372    app->setApplicationName("BNC");
     373    app->setOrganizationName("BKG");
     374    app->setOrganizationDomain("www.bkg.bund.de");
     375
     376    BNC_CORE->setGUIenabled(GUIenabled);
     377  }
     378  else { // start non-gui Version
     379
     380  }
     381
    376382  BNC_CORE->setConfFileName( confFileName );
    377383
     
    418424    }
    419425
    420     app.setWindowIcon(QPixmap(":ntrip-logo.png"));
    421 
    422426    bncWin = new bncWindow();
    423427    BNC_CORE->setMainWindow(bncWin);
     
    475479    BNC_CORE->initCombination();
    476480
    477     BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), &app, SLOT(quit()));
    478 
     481    //BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), &app, SLOT(quit()));
     482    BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), app->instance(), SLOT(quit()));
    479483    BNC_CORE->slotMessage("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true);
    480484
     
    506510  // Start the application
    507511  // ---------------------
    508   app.exec();
     512  app->exec();
    509513  if (interactive) {
    510514    delete bncWin;
     
    523527    delete rawFile;
    524528  }
     529
    525530  return 0;
    526531}
Note: See TracChangeset for help on using the changeset viewer.