Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkLevelWindowRangeChangeDialog.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 
18 
19 #include <QMessageBox>
20 
22  : QDialog(parent, f)
23 {
24  this->setupUi(this);
25 
26  QObject::connect(okButton, SIGNAL(clicked()), this, SLOT(inputValidator()));
27 }
28 
30 {
31  return rangeMinDoubleSpinBox->value();
32 }
33 
35 {
36  return rangeMaxDoubleSpinBox->value();
37 }
38 
40 {
41  rangeMinDoubleSpinBox->setValue(rangeMin);
42 }
43 
45 {
46  rangeMaxDoubleSpinBox->setValue(rangeMax);
47 }
48 
50 {
51  if (!(rangeMinDoubleSpinBox->value() < rangeMaxDoubleSpinBox->value()))
52  {
53  QMessageBox::critical(this,
54  "Change Range",
55  "Upper limit has to be greater than lower limit.\n"
56  "Please enter limits again.");
57  }
58  else
59  this->accept();
60 }
QmitkLevelWindowRangeChangeDialog(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)