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