diff --git a/lessonscreator/metadata.txt b/lessonscreator/metadata.txt index b50fd79..bb94819 100644 --- a/lessonscreator/metadata.txt +++ b/lessonscreator/metadata.txt @@ -2,9 +2,9 @@ name=LessonsCreator description=Tools to help create lessons for the Lessons plugin version=0.1 -qgisMinimumVersion=2.0 +qgisMinimumVersion=3.0 author=Victor Olaya email=volayaf@gmail.com website= icon=edit.png -class_name=LessonsCollection \ No newline at end of file +class_name=LessonsCollection diff --git a/lessonscreator/plugin.py b/lessonscreator/plugin.py index a69022d..a1e4422 100644 --- a/lessonscreator/plugin.py +++ b/lessonscreator/plugin.py @@ -13,7 +13,7 @@ from qgis.PyQt.QtCore import Qt, QTimer from qgis.PyQt.QtGui import (QIcon, QKeySequence, - QPixmap, + QScreen, QPainter, QPen, QBrush @@ -191,7 +191,8 @@ def processFocusChanged(self, old, new): timer = None def _createScreenshot(self, obj, rect): - pixmap = QPixmap.grabWindow(obj.winId()).copy() + screen = QgsApplication.instance().primaryScreen() + pixmap = screen.grabWindow(obj.winId()).copy() if rect is not None: painter = QPainter() painter.begin(pixmap)