Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
BlueBerryExampleLauncher.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include <mitkBaseApplication.h>
14 
16 
17 #include <QFileInfo>
18 #include <QVariant>
19 
20 int main(int argc, char **argv)
21 {
22  mitk::BaseApplication app(argc, argv);
23  app.setApplicationName("BlueBerryExampleLauncher");
24  app.setOrganizationName("DKFZ");
25  app.initializeQt();
26 
28  QString selectedConfiguration = demoDialog.getDemoConfiguration();
29 
30  if (selectedConfiguration.isEmpty())
31  return EXIT_SUCCESS;
32 
33  app.setProvisioningFilePath(selectedConfiguration);
34 
35  // We create the application id relying on a convention:
36  // org.mitk.example.<configuration-name>
37  QString appId = "org.mitk.example.";
38  QStringList appIdTokens = QFileInfo(selectedConfiguration).baseName().toLower().split('_', QString::SkipEmptyParts);
39  appId += appIdTokens.size() > 1 ? appIdTokens.at(1) : appIdTokens.at(0);
40 
41  // Special cases
42  if (appId == "org.mitk.example.exampleplugins")
43  {
44  appId = "org.mitk.qt.extapplication";
45  }
46 
48 
49  return app.run();
50 }
int main(int argc, char **argv)
static const QString PROP_APPLICATION
void setProperty(const QString &property, const QVariant &value)
void setOrganizationName(const QString &name)
void setProvisioningFilePath(const QString &filePath)
void setApplicationName(const QString &name)