|
80 | 80 | pcl::modeler::IntParameter::setEditorData(QWidget* editor) |
81 | 81 | { |
82 | 82 | auto* spinBox = dynamic_cast<QSpinBox*>(editor); |
| 83 | + if (!spinBox) |
| 84 | + return; |
83 | 85 | spinBox->setAlignment(Qt::AlignHCenter); |
84 | 86 |
|
85 | 87 | int value = int(*this); |
|
91 | 93 | pcl::modeler::IntParameter::getEditorData(QWidget* editor) |
92 | 94 | { |
93 | 95 | auto* spinBox = dynamic_cast<QSpinBox*>(editor); |
| 96 | + if (!spinBox) |
| 97 | + return; |
94 | 98 | int value = spinBox->text().toInt(); |
95 | 99 | current_value_ = value; |
96 | 100 | } |
|
126 | 130 | pcl::modeler::BoolParameter::setEditorData(QWidget* editor) |
127 | 131 | { |
128 | 132 | auto* checkBox = dynamic_cast<QCheckBox*>(editor); |
| 133 | + if (!checkBox) |
| 134 | + return; |
129 | 135 |
|
130 | 136 | bool value = bool(*this); |
131 | 137 | checkBox->setCheckState(value ? (Qt::Checked) : (Qt::Unchecked)); |
|
136 | 142 | pcl::modeler::BoolParameter::getEditorData(QWidget* editor) |
137 | 143 | { |
138 | 144 | auto* checkBox = dynamic_cast<QCheckBox*>(editor); |
| 145 | + if (!checkBox) |
| 146 | + return; |
139 | 147 | bool value = (checkBox->checkState() == Qt::Checked); |
140 | 148 | current_value_ = value; |
141 | 149 | } |
|
175 | 183 | pcl::modeler::DoubleParameter::setEditorData(QWidget* editor) |
176 | 184 | { |
177 | 185 | auto* spinBox = dynamic_cast<QDoubleSpinBox*>(editor); |
| 186 | + if (!spinBox) |
| 187 | + return; |
178 | 188 | spinBox->setAlignment(Qt::AlignHCenter); |
179 | 189 |
|
180 | 190 | double value = double(*this); |
|
186 | 196 | pcl::modeler::DoubleParameter::getEditorData(QWidget* editor) |
187 | 197 | { |
188 | 198 | auto* spinBox = dynamic_cast<QDoubleSpinBox*>(editor); |
| 199 | + if (!spinBox) |
| 200 | + return; |
189 | 201 | double value = spinBox->text().toDouble(); |
190 | 202 | current_value_ = value; |
191 | 203 | } |
|
221 | 233 | pcl::modeler::ColorParameter::setEditorData(QWidget* editor) |
222 | 234 | { |
223 | 235 | auto* color_dialog = dynamic_cast<QColorDialog*>(editor); |
| 236 | + if (!color_dialog) |
| 237 | + return; |
224 | 238 |
|
225 | 239 | QColor value = QColor(*this); |
226 | 240 | color_dialog->setCurrentColor(value); |
|
231 | 245 | pcl::modeler::ColorParameter::getEditorData(QWidget* editor) |
232 | 246 | { |
233 | 247 | auto* color_dialog = dynamic_cast<QColorDialog*>(editor); |
| 248 | + if (!color_dialog) |
| 249 | + return; |
234 | 250 |
|
235 | 251 | QColor value = color_dialog->currentColor(); |
236 | 252 | current_value_ = value; |
|
0 commit comments