Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include <mitkBaseApplication.h>
18 
20 
21 #include <QFileInfo>
22 #include <QVariant>
23 
24 int main(int argc, char **argv)
25 {
26  mitk::BaseApplication app(argc, argv);
27  app.setApplicationName("BlueBerryExampleLauncher");
28  app.setOrganizationName("DKFZ");
29  app.initializeQt();
30 
32  QString selectedConfiguration = demoDialog.getDemoConfiguration();
33 
34  if (selectedConfiguration.isEmpty())
35  return EXIT_SUCCESS;
36 
37  app.setProvisioningFilePath(selectedConfiguration);
38 
39  // We create the application id relying on a convention:
40  // org.mitk.example.<configuration-name>
41  QString appId = "org.mitk.example.";
42  QStringList appIdTokens = QFileInfo(selectedConfiguration).baseName().toLower().split('_', QString::SkipEmptyParts);
43  appId += appIdTokens.size() > 1 ? appIdTokens.at(1) : appIdTokens.at(0);
44 
45  // Special cases
46  if (appId == "org.mitk.example.exampleplugins")
47  {
48  appId = "org.mitk.qt.extapplication";
49  }
50 
52 
53  return app.run();
54 }
int main(int argc, char **argv)
void setProperty(const QString &property, const QVariant &value)
void setOrganizationName(const QString &name)
void setProvisioningFilePath(const QString &filePath)
void setApplicationName(const QString &name)
static QString PROP_APPLICATION