| 706 | } |
| 707 | |
| 708 | void 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 | |
| 726 | void WorksheetView::drawBackgroundItems(QPainter* painter, const QRectF& scene_rect) { |
| 727 | // canvas |
nothing calls this directly
no test coverage detected