Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port lessoncreator to QGIS3 #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lessonscreator/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 protected]
website=
icon=edit.png
class_name=LessonsCollection
class_name=LessonsCollection
5 changes: 3 additions & 2 deletions lessonscreator/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from qgis.PyQt.QtCore import Qt, QTimer
from qgis.PyQt.QtGui import (QIcon,
QKeySequence,
QPixmap,
QScreen,
QPainter,
QPen,
QBrush
Expand Down Expand Up @@ -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)
Expand Down