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

Method paint

src/backend/worksheet/plots/cartesian/ReferenceRange.cpp:483–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483void ReferenceRangePrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget*) {
484 if (!m_visible)
485 return;
486
487 if (rect.width() == 0 || rect.height() == 0)
488 return;
489
490 // draw the background filling
491 if (background->enabled())
492 background->draw(painter, QPolygonF(rect));
493
494 // draw the border
495 if (line->style() != Qt::NoPen) {
496 painter->setPen(line->pen());
497 painter->setBrush(Qt::NoBrush);
498 painter->setOpacity(line->opacity());
499 }
500
501 painter->drawPath(m_shape);
502
503 if (m_hovered && !isSelected() && !q->isPrinting()) {
504 painter->setPen(QPen(QApplication::palette().color(QPalette::Shadow), 2, Qt::SolidLine));
505 painter->drawPath(m_shape);
506 }
507
508 if (isSelected() && !q->isPrinting()) {
509 painter->setPen(QPen(QApplication::palette().color(QPalette::Highlight), 2, Qt::SolidLine));
510 painter->drawPath(m_shape);
511 }
512}
513
514// ##############################################################################
515// ################## Serialization/Deserialization ###########################

Callers

nothing calls this directly

Calls 10

heightMethod · 0.80
enabledMethod · 0.80
setPenMethod · 0.80
setBrushMethod · 0.80
isPrintingMethod · 0.80
QPenClass · 0.50
widthMethod · 0.45
drawMethod · 0.45
setOpacityMethod · 0.45
colorMethod · 0.45

Tested by

no test coverage detected