| 54 | } |
| 55 | |
| 56 | void Value::draw(QPainter* painter, const QVector<QPointF>& points, const QVector<QString>& strings) { |
| 57 | Q_D(Value); |
| 58 | |
| 59 | if (d->type == Value::NoValues) |
| 60 | return; |
| 61 | |
| 62 | painter->setOpacity(d->opacity); |
| 63 | painter->setPen(QPen(d->color)); |
| 64 | painter->setFont(d->font); |
| 65 | |
| 66 | int i = 0; |
| 67 | for (const auto& point : points) { |
| 68 | painter->translate(point); |
| 69 | if (d->rotationAngle != 0.) |
| 70 | painter->rotate(-d->rotationAngle); |
| 71 | |
| 72 | painter->drawText(QPoint(0, 0), strings.at(i++)); |
| 73 | |
| 74 | if (d->rotationAngle != 0.) |
| 75 | painter->rotate(d->rotationAngle); |
| 76 | painter->translate(-point); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | // ############################################################################## |
| 81 | // ########################## getter methods ################################## |