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

Method drawForeground

src/frontend/worksheet/WorksheetView.cpp:708–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706}
707
708void WorksheetView::drawForeground(QPainter* painter, const QRectF& rect) {
709 // QDEBUG(Q_FUNC_INFO << ", painter = " << painter << ", rect = " << rect)
710 if (m_mouseMode == MouseMode::ZoomSelection && m_selectionBandIsShown) {
711 painter->save();
712 const QRectF& selRect = mapToScene(QRect(m_selectionStart, m_selectionEnd).normalized()).boundingRect();
713 // TODO: don't hardcode for black here, use a a different color depending on the theme of the worksheet/plot under the mouse cursor?
714 painter->setPen(QPen(Qt::black, 5 / transform().m11()));
715 painter->drawRect(selRect);
716 painter->setBrush(QApplication::palette().color(QPalette::Highlight));
717 painter->setOpacity(0.2);
718 painter->drawRect(selRect);
719 painter->restore();
720 }
721 // DEBUG(Q_FUNC_INFO << ", CALLING QGraphicsView::drawForeground. items = " << QGraphicsView::items().size()
722 // << ", scene items = " << scene()->items().count() )
723 QGraphicsView::drawForeground(painter, rect);
724}
725
726void WorksheetView::drawBackgroundItems(QPainter* painter, const QRectF& scene_rect) {
727 // canvas

Callers

nothing calls this directly

Calls 7

setPenMethod · 0.80
setBrushMethod · 0.80
QPenClass · 0.50
saveMethod · 0.45
boundingRectMethod · 0.45
colorMethod · 0.45
setOpacityMethod · 0.45

Tested by

no test coverage detected