1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: XGUI_DeflectionDialog.cpp
4 // Created: 27 Jul 2016
5 // Author: Natalia ERMOLAEVA
7 #include <XGUI_DeflectionDialog.h>
9 #include <ModelAPI_Tools.h>
11 #include <ModuleBase_DoubleSpinBox.h>
14 #include <QButtonGroup>
15 #include <QGridLayout>
16 #include <QRadioButton>
17 #include <QDialogButtonBox>
19 XGUI_DeflectionDialog::XGUI_DeflectionDialog(QWidget* theParent)
22 setWindowTitle("Deflection");
23 QGridLayout* aLay = new QGridLayout(this);
25 myDeflection = new ModuleBase_DoubleSpinBox(this);
26 myDeflection->setDecimals(12);
27 myDeflection->setRange(0, 1);
28 myDeflection->setSingleStep(0.001);
29 aLay->addWidget(new QLabel("Deviation", this), 0, 0);
30 aLay->addWidget(myDeflection, 0, 1);
32 QDialogButtonBox* aButtons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
33 Qt::Horizontal, this);
34 connect(aButtons, SIGNAL(accepted()), this, SLOT(accept()));
35 connect(aButtons, SIGNAL(rejected()), this, SLOT(reject()));
36 aLay->addWidget(aButtons, 1, 0, 1, 2);
39 void XGUI_DeflectionDialog::setDeflection(const double& theValue)
41 myDeflection->setValue(theValue);
44 double XGUI_DeflectionDialog::getDeflection() const
46 return myDeflection->value();