MCPcopy Create free account
hub / github.com/KDE/labplot / draw

Method draw

src/backend/worksheet/plots/cartesian/Value.cpp:56–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void 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 ##################################

Callers 3

paintMethod · 0.45
paintMethod · 0.45
paintMethod · 0.45

Calls 5

setPenMethod · 0.80
QPenClass · 0.50
setOpacityMethod · 0.45
setFontMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected