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

Method paint

src/backend/worksheet/plots/cartesian/ReferenceLine.cpp:310–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310void ReferenceLinePrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget*) {
311 if (!insidePlot)
312 return;
313
314 painter->setOpacity(line->opacity());
315 painter->setPen(line->pen());
316 if (orientation == ReferenceLine::Orientation::Horizontal)
317 painter->drawLine(-length / 2, 0, length / 2, 0);
318 else
319 painter->drawLine(0, length / 2, 0, -length / 2);
320
321 if (m_hovered && !isSelected() && !q->isPrinting()) {
322 painter->setPen(QPen(QApplication::palette().color(QPalette::Shadow), 2, Qt::SolidLine));
323 painter->drawPath(m_shape);
324 }
325
326 if (isSelected() && !q->isPrinting()) {
327 painter->setPen(QPen(QApplication::palette().color(QPalette::Highlight), 2, Qt::SolidLine));
328 painter->drawPath(m_shape);
329 }
330}
331
332// ##############################################################################
333// ################## Serialization/Deserialization ###########################

Callers

nothing calls this directly

Calls 5

setPenMethod · 0.80
isPrintingMethod · 0.80
QPenClass · 0.50
setOpacityMethod · 0.45
colorMethod · 0.45

Tested by

no test coverage detected