| 263 | |
| 264 | STD_SETTER_CMD_IMPL_S(DatapickerCurve, SetCurveErrorTypes, DatapickerCurve::Errors, curveErrorTypes) |
| 265 | void DatapickerCurve::setCurveErrorTypes(const DatapickerCurve::Errors errors) { |
| 266 | Q_D(DatapickerCurve); |
| 267 | if (d->curveErrorTypes.x != errors.x || d->curveErrorTypes.y != errors.y) { |
| 268 | beginMacro(i18n("%1: set xy-error type", name())); |
| 269 | exec(new DatapickerCurveSetCurveErrorTypesCmd(d, errors, ki18n("%1: set xy-error type"))); |
| 270 | |
| 271 | if (errors.x == ErrorType::AsymmetricError) { |
| 272 | if (!d->plusDeltaXColumn) |
| 273 | setPlusDeltaXColumn(appendColumn(QLatin1String("+delta_x"))); |
| 274 | else |
| 275 | d->plusDeltaXColumn->setName(QLatin1String("+delta_x")); // make sure we have the proper name when switching from Symmetric to Asymmetric |
| 276 | } else if (errors.x == ErrorType::SymmetricError) { |
| 277 | if (!d->plusDeltaXColumn) |
| 278 | setPlusDeltaXColumn(appendColumn(QLatin1String("+-delta_x"))); |
| 279 | else |
| 280 | d->plusDeltaXColumn->setName(QLatin1String("+-delta_x")); // make sure we have the proper name when switching from Asymmetric to Symmetric |
| 281 | } else if (d->plusDeltaXColumn && errors.x == ErrorType::NoError) { |
| 282 | d->plusDeltaXColumn->remove(); |
| 283 | d->plusDeltaXColumn = nullptr; |
| 284 | } |
| 285 | |
| 286 | if (errors.x == ErrorType::AsymmetricError && !d->minusDeltaXColumn) |
| 287 | setMinusDeltaXColumn(appendColumn(QLatin1String("-delta_x"))); |
| 288 | else if (d->minusDeltaXColumn && errors.x != ErrorType::AsymmetricError) { |
| 289 | d->minusDeltaXColumn->remove(); |
| 290 | d->minusDeltaXColumn = nullptr; |
| 291 | } |
| 292 | |
| 293 | if (errors.y == ErrorType::AsymmetricError) { |
| 294 | if (!d->plusDeltaYColumn) |
| 295 | setPlusDeltaYColumn(appendColumn(QLatin1String("+delta_y"))); |
| 296 | else |
| 297 | d->plusDeltaYColumn->setName(QLatin1String("+delta_y")); // make sure we have the proper name when switching from Symmetric to Asymmetric |
| 298 | } else if (errors.y == ErrorType::SymmetricError) { |
| 299 | if (!d->plusDeltaYColumn) |
| 300 | setPlusDeltaYColumn(appendColumn(QLatin1String("+-delta_y"))); |
| 301 | else |
| 302 | d->plusDeltaYColumn->setName(QLatin1String("+-delta_y")); // make sure we have the proper name when switching from Asymmetric to Symmetric |
| 303 | } else if (d->plusDeltaYColumn && errors.y == ErrorType::NoError) { |
| 304 | d->plusDeltaYColumn->remove(); |
| 305 | d->plusDeltaYColumn = nullptr; |
| 306 | } |
| 307 | |
| 308 | if (errors.y == ErrorType::AsymmetricError && !d->minusDeltaYColumn) |
| 309 | setMinusDeltaYColumn(appendColumn(QLatin1String("-delta_y"))); |
| 310 | else if (d->minusDeltaYColumn && errors.y != ErrorType::AsymmetricError) { |
| 311 | d->minusDeltaYColumn->remove(); |
| 312 | d->minusDeltaYColumn = nullptr; |
| 313 | } |
| 314 | |
| 315 | endMacro(); |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | STD_SETTER_CMD_IMPL_S(DatapickerCurve, SetPosXColumn, AbstractColumn*, posXColumn) |
| 320 | void DatapickerCurve::setPosXColumn(AbstractColumn* column) { |
no test coverage detected