| 481 | } |
| 482 | |
| 483 | QColor BoxPlot::colorAt(int index) const { |
| 484 | Q_D(const BoxPlot); |
| 485 | if (index >= d->backgrounds.size()) |
| 486 | return QColor(); |
| 487 | |
| 488 | const auto* background = d->backgrounds.at(index); |
| 489 | if (background->enabled()) |
| 490 | return background->firstColor(); |
| 491 | else { |
| 492 | const auto* borderLine = d->borderLines.at(index); |
| 493 | if (borderLine->style() != Qt::PenStyle::NoPen) |
| 494 | return borderLine->pen().color(); |
| 495 | else |
| 496 | return QColor(); |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | /* ============================ setter methods and undo commands ================= */ |
| 501 | |