QXRD  0.11.16
Public Member Functions | Private Attributes | List of all members
QxrdCalibrantPropertiesDialog Class Reference

#include <qxrdcalibrantpropertiesdialog.h>

Inheritance diagram for QxrdCalibrantPropertiesDialog:
Inheritance graph
[legend]
Collaboration diagram for QxrdCalibrantPropertiesDialog:
Collaboration graph
[legend]

Public Member Functions

 QxrdCalibrantPropertiesDialog (QWidget *parent, QxrdCalibrantPtr cal)
 
 ~QxrdCalibrantPropertiesDialog ()
 
void accept ()
 

Private Attributes

QxrdCalibrantPtr m_Calibrant
 

Detailed Description

Definition at line 8 of file qxrdcalibrantpropertiesdialog.h.

Constructor & Destructor Documentation

QxrdCalibrantPropertiesDialog::QxrdCalibrantPropertiesDialog ( QWidget *  parent,
QxrdCalibrantPtr  cal 
)
explicit

Definition at line 5 of file qxrdcalibrantpropertiesdialog.cpp.

References m_Calibrant.

5  :
6  QDialog(parent),
7  m_Calibrant(cal)
8 {
9  setupUi(this);
10 
11  if (m_Calibrant) {
12  if (m_Calibrant->isLocked()) {
13  setWindowTitle(tr("Calibrant %1 Properties (Locked)").arg(m_Calibrant->get_Name()));
14 
15  m_Name -> setEnabled(false);
16  m_Description -> setEnabled(false);
17  m_Symmetry -> setEnabled(false);
18  m_Symmetry -> setEditable(false);
19  m_A -> setEnabled(false);
20  m_B -> setEnabled(false);
21  m_C -> setEnabled(false);
22  m_Alpha -> setEnabled(false);
23  m_Beta -> setEnabled(false);
24  m_Gamma -> setEnabled(false);
25  } else {
26  setWindowTitle(tr("Calibrant %1 Properties").arg(m_Calibrant->get_Name()));
27  }
28 
29  m_Symmetry -> addItem("Hexagonal");
30  m_Symmetry -> addItem("R Hexagonal");
31  m_Symmetry -> addItem("Simple Cubic");
32  m_Symmetry -> addItem("BCC");
33  m_Symmetry -> addItem("FCC");
34  m_Symmetry -> addItem("Diamond");
35 
36  m_IsUsed -> setChecked(m_Calibrant->get_IsUsed());
37  m_Name -> setText(m_Calibrant->get_Name());
38  m_Description -> setText(m_Calibrant->get_Description());
39  m_Symmetry -> setCurrentIndex(m_Calibrant->get_Symmetry());
40  m_A -> setValue(m_Calibrant->get_A());
41  m_B -> setValue(m_Calibrant->get_B());
42  m_C -> setValue(m_Calibrant->get_C());
43  m_Alpha -> setValue(m_Calibrant->get_Alpha());
44  m_Beta -> setValue(m_Calibrant->get_Beta());
45  m_Gamma -> setValue(m_Calibrant->get_Gamma());
46  }
47 }
QxrdCalibrantPropertiesDialog::~QxrdCalibrantPropertiesDialog ( )

Definition at line 49 of file qxrdcalibrantpropertiesdialog.cpp.

50 {
51 }

Member Function Documentation

void QxrdCalibrantPropertiesDialog::accept ( )

Definition at line 53 of file qxrdcalibrantpropertiesdialog.cpp.

References m_Calibrant.

54 {
55  if (m_Calibrant) {
56  m_Calibrant -> set_IsUsed(m_IsUsed->isChecked());
57 
58  if (!m_Calibrant->isLocked()) {
59  m_Calibrant -> set_Name (m_Name -> text());
60  m_Calibrant -> set_Description(m_Description -> text());
61  m_Calibrant -> set_Symmetry (m_Symmetry -> currentIndex());
62  m_Calibrant -> set_A (m_A -> value());
63  m_Calibrant -> set_B (m_B -> value());
64  m_Calibrant -> set_C (m_C -> value());
65  m_Calibrant -> set_Alpha (m_Alpha -> value());
66  m_Calibrant -> set_Beta (m_Beta -> value());
67  m_Calibrant -> set_Gamma (m_Gamma -> value());
68  }
69  }
70 
71  QDialog::accept();
72 }

Member Data Documentation

QxrdCalibrantPtr QxrdCalibrantPropertiesDialog::m_Calibrant
private

Definition at line 19 of file qxrdcalibrantpropertiesdialog.h.

Referenced by accept(), and QxrdCalibrantPropertiesDialog().


The documentation for this class was generated from the following files: