MCPcopy Create free account
hub / github.com/MITK/MITK / CreateWidgets

Method CreateWidgets

Modules/FormsUI/src/QmitkCheckboxesQuestionWidget.cpp:80–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void QmitkCheckboxesQuestionWidget::CreateWidgets()
81{
82 this->RemoveWidgets();
83
84 int row = 0;
85
86 for (const auto& option : m_Question->GetOptions())
87 {
88 auto checkBox = new QCheckBox(QString::fromStdString(option));
89 m_Layout->addWidget(checkBox, row, 0, 1, 2);
90 m_ButtonGroup->addButton(checkBox, row++);
91 }
92
93 if (m_Question->HasOtherOption())
94 {
95 auto checkBox = new QCheckBox("Other:");
96 m_Layout->addWidget(checkBox, row, 0);
97 m_ButtonGroup->addButton(checkBox, row);
98 m_OtherId = row;
99
100 m_OtherLineEdit = new QLineEdit;
101 m_Layout->addWidget(m_OtherLineEdit, row++, 1);
102
103 connect(m_OtherLineEdit, &QLineEdit::textEdited, this, &Self::OnTextEdited);
104 connect(m_OtherLineEdit, &QLineEdit::editingFinished, this, &Self::OnEditingFinished);
105 }
106 else
107 {
108 m_OtherId = -1;
109 }
110}
111
112void QmitkCheckboxesQuestionWidget::RemoveWidgets()
113{

Callers 1

SetQuestionMethod · 0.95

Calls 3

RemoveWidgetsMethod · 0.95
HasOtherOptionMethod · 0.80
GetOptionsMethod · 0.45

Tested by

no test coverage detected