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
QmitkAboutDialog.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 "QmitkAboutDialog.h"
18 #include "QmitkModulesDialog.h"
19 #include <QPushButton>
20 #include <itkConfigure.h>
21 #include <mitkVersion.h>
22 #include <vtkConfigure.h>
23 #include <vtkVersionMacros.h>
24 
25 QmitkAboutDialog::QmitkAboutDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
26 {
27  m_GUI.setupUi(this);
28 
29  QString mitkRevision(MITK_REVISION);
30  QString mitkRevisionDescription(MITK_REVISION_DESC);
31  QString itkVersion = QString("%1.%2.%3").arg(ITK_VERSION_MAJOR).arg(ITK_VERSION_MINOR).arg(ITK_VERSION_PATCH);
32  QString vtkVersion = QString("%1.%2.%3").arg(VTK_MAJOR_VERSION).arg(VTK_MINOR_VERSION).arg(VTK_BUILD_VERSION);
33 
34  QString revisionText = QString("Revision: %1").arg(MITK_REVISION);
35 
36  if (!QString(MITK_REVISION_DESC).isEmpty())
37  revisionText += QString("\nDescription: %1").arg(MITK_REVISION_DESC);
38 
39  m_GUI.m_RevisionLabel->setText(revisionText);
40  m_GUI.m_ToolkitVersionsLabel->setText(QString("ITK %1, VTK %2, Qt %3").arg(itkVersion, vtkVersion, QT_VERSION_STR));
41 
42  QPushButton *btnModules = new QPushButton(QIcon(":/QtWidgetsExt/ModuleView.png"), "Modules");
43  m_GUI.m_ButtonBox->addButton(btnModules, QDialogButtonBox::ActionRole);
44 
45  connect(btnModules, SIGNAL(clicked()), this, SLOT(ShowModules()));
46  connect(m_GUI.m_ButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
47 }
48 
50 {
51 }
52 
54 {
55  QmitkModulesDialog dialog(this);
56  dialog.exec();
57 }
58 
60 {
61  return m_GUI.m_AboutLabel->text();
62 }
63 
65 {
66  return m_GUI.m_CaptionLabel->text();
67 }
68 
70 {
71  return m_GUI.m_RevisionLabel->text();
72 }
73 
74 void QmitkAboutDialog::SetAboutText(const QString &text)
75 {
76  m_GUI.m_AboutLabel->setText(text);
77 }
78 
79 void QmitkAboutDialog::SetCaptionText(const QString &text)
80 {
81  m_GUI.m_CaptionLabel->setText(text);
82 }
83 
84 void QmitkAboutDialog::SetRevisionText(const QString &text)
85 {
86  m_GUI.m_RevisionLabel->setText(text);
87 }
void SetRevisionText(const QString &text)
QmitkAboutDialog(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::CustomizeWindowHint|Qt::WindowCloseButtonHint)
void SetCaptionText(const QString &text)
#define MITK_REVISION
Definition: mitkVersion.h:11
#define MITK_REVISION_DESC
Definition: mitkVersion.h:13
virtual ~QmitkAboutDialog()
QString GetRevisionText() const
QString GetAboutText() const
void SetAboutText(const QString &text)
QString GetCaptionText() const