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