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

Method drawBackground

src/frontend/worksheet/WorksheetView.cpp:774–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772}
773
774void WorksheetView::drawBackground(QPainter* painter, const QRectF& rect) {
775 painter->save();
776
777 // painter->setRenderHint(QPainter::Antialiasing);
778 QRectF scene_rect = sceneRect();
779
780 if (!m_worksheet->useViewSize()) {
781 // background
782 KColorScheme scheme(QPalette::Active, KColorScheme::Window);
783 const QColor color = scheme.background().color();
784 if (!scene_rect.contains(rect))
785 painter->fillRect(rect, color);
786
787 // shadow
788 // int shadowSize = scene_rect.width()*0.02;
789 // QRectF rightShadowRect(scene_rect.right(), scene_rect.top() + shadowSize, shadowSize, scene_rect.height());
790 // QRectF bottomShadowRect(scene_rect.left() + shadowSize, scene_rect.bottom(), scene_rect.width(), shadowSize);
791 //
792 // const QColor& shadeColor = scheme.shade(color, KColorScheme::MidShade);
793 // painter->fillRect(rightShadowRect.intersected(rect), shadeColor);
794 // painter->fillRect(bottomShadowRect.intersected(rect), shadeColor);
795 }
796
797 drawBackgroundItems(painter, scene_rect);
798
799 invalidateScene(rect, QGraphicsScene::BackgroundLayer);
800 painter->restore();
801}
802
803CartesianPlot* WorksheetView::plotAt(QPoint pos) const {
804 QGraphicsItem* item = itemAt(pos);

Callers

nothing calls this directly

Calls 4

saveMethod · 0.45
colorMethod · 0.45
backgroundMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected