| 429 | } |
| 430 | |
| 431 | ErrorBar* BarPlotPrivate::addErrorBar(const KConfigGroup& group) { |
| 432 | auto* errorBar = new ErrorBar(QStringLiteral("errorBar"), ErrorBar::Dimension::Y); |
| 433 | errorBar->setHidden(true); |
| 434 | q->addChild(errorBar); |
| 435 | if (!q->isLoading()) |
| 436 | errorBar->init(group); |
| 437 | |
| 438 | q->connect(errorBar, &ErrorBar::updatePixmapRequested, [=] { |
| 439 | updatePixmap(); |
| 440 | }); |
| 441 | |
| 442 | q->connect(errorBar, &ErrorBar::updateRequested, [=] { |
| 443 | const int index = errorBars.indexOf(errorBar); |
| 444 | if (index != -1) |
| 445 | updateErrorBars(index); |
| 446 | }); |
| 447 | |
| 448 | errorBars << errorBar; |
| 449 | |
| 450 | return errorBar; |
| 451 | } |
| 452 | |
| 453 | /*! |
| 454 | called when the size of the plot or its data ranges (manual changes, zooming, etc.) were changed. |