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

Method paint

src/backend/worksheet/InfoElement.cpp:1042–1062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1040}
1041
1042void InfoElementPrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) {
1043 if (!insidePlot || !valid)
1044 return;
1045
1046 if (q->markerpoints.isEmpty())
1047 return;
1048
1049 // do not draw connection line when the label is not visible
1050 if (connectionLine->style() != Qt::NoPen && q->m_title->isVisible() && !m_connectionLine.isNull()) {
1051 painter->setOpacity(connectionLine->opacity());
1052 painter->setPen(connectionLine->pen());
1053 painter->drawLine(m_connectionLine);
1054 }
1055
1056 // draw vertical line, which connects all points together
1057 if (verticalLine->style() != Qt::NoPen && !xposLine.isNull()) {
1058 painter->setOpacity(verticalLine->opacity());
1059 painter->setPen(verticalLine->pen());
1060 painter->drawLine(xposLine);
1061 }
1062}
1063
1064void InfoElementPrivate::mousePressEvent(QGraphicsSceneMouseEvent* event) {
1065 if (event->button() == Qt::MouseButton::LeftButton) {

Callers

nothing calls this directly

Calls 5

isNullMethod · 0.80
setPenMethod · 0.80
isEmptyMethod · 0.45
isVisibleMethod · 0.45
setOpacityMethod · 0.45

Tested by

no test coverage detected