22 #include <ctkXnatExperiment.h> 23 #include <ctkXnatSubject.h> 27 #include <QMessageBox> 28 #include <QPushButton> 35 : QDialog(parent), m_Type(type)
44 m_Object =
new ctkXnatSubject();
49 m_Object =
new ctkXnatExperiment();
57 QList<QLineEdit *> children = m_Widget->findChildren<QLineEdit *>();
58 foreach (QLineEdit *child, children)
60 child->setReadOnly(
false);
63 QGridLayout *grid =
dynamic_cast<QGridLayout *
>(m_Widget->layout());
65 QPushButton *btnOk =
new QPushButton(
"Create");
66 QPushButton *btnCancel =
new QPushButton(
"Cancel");
68 QHBoxLayout *hLayout =
new QHBoxLayout();
69 hLayout->addWidget(btnOk);
70 hLayout->addWidget(btnCancel);
75 grid->addLayout(hLayout, grid->rowCount() + 1, 1);
94 ctkXnatSubject *subject;
95 ctkXnatExperiment *experiment;
119 if (subject->property(
"label").isEmpty())
122 msgBox.setIcon(QMessageBox::Warning);
123 msgBox.setText(
"Please fill in an ID to create a new subject!");
135 if (experiment->property(
"label").isEmpty())
138 msgBox.setIcon(QMessageBox::Warning);
139 msgBox.setText(
"Please fill in an ID to create a new experiment!");
143 else if (experiment->property(
"xsiType").isEmpty() || experiment->property(
"xsiType") ==
"xnat:experimentData")
146 msgBox.setIcon(QMessageBox::Warning);
147 msgBox.setText(
"Please fill in an XSI Type to create a new experiment!");
152 m_Object = experiment;
ctkXnatObject * GetXnatObject()
QmitkXnatCreateObjectDialog(SpecificType type, QWidget *parent=nullptr)
~QmitkXnatCreateObjectDialog() override