From 0b5f2fa53eddd6b9b6d9518a77ed4fcf976a7401 Mon Sep 17 00:00:00 2001 From: "benjamin.jakimow" <benjamin.jakimow@geo.hu-berlin.de> Date: Tue, 12 Jun 2018 13:38:31 +0200 Subject: [PATCH] fixed error when exporting map canvas image to clipboard --- timeseriesviewer/mapcanvas.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/timeseriesviewer/mapcanvas.py b/timeseriesviewer/mapcanvas.py index 251463c1..edaa7c1d 100644 --- a/timeseriesviewer/mapcanvas.py +++ b/timeseriesviewer/mapcanvas.py @@ -680,7 +680,11 @@ class MapCanvas(QgsMapCanvas): :return: QPixmap """ #return QPixmap(self.map().contentImage().copy()) - return QPixmap.grabWidget(self) + + pixmap = QPixmap(self.rect().size()) + painter = QPainter(pixmap) + self.render(painter) + return pixmap -- GitLab