refs #883, application class extended

* allow to register application as running (needed for launcher)
* getExecutableForApplication
* swift launcher can be started
This commit is contained in:
Klaus Basan
2017-02-15 03:39:11 +01:00
committed by Mathew Sutcliffe
parent c8c18b0b21
commit 24a9b332b0
3 changed files with 64 additions and 9 deletions

View File

@@ -30,7 +30,8 @@ int main(int argc, char *argv[])
{
//! [SwiftApplicationDemo]
CGuiApplication::highDpiScreenSupport();
QApplication qa(argc, argv);
QApplication qa(argc, argv); // needed
Q_UNUSED(qa);
CGuiApplication a("swift launcher", CApplicationInfo::Laucher, CIcons::swiftLauncher1024());
a.addParserOption({{"i", "installer"}, QCoreApplication::translate("main", "Installer setup."), "installer"});
if (!a.parse()) { return EXIT_FAILURE; }
@@ -44,6 +45,7 @@ int main(int argc, char *argv[])
// Dialog to decide external or internal core
CSwiftLauncher launcher;
CGuiApplication::registerAsRunning(); // needed because own exec is called
if (launcher.exec() == QDialog::Rejected) { return EXIT_SUCCESS; }
launcher.close();