From 153be6efc8129dc867f98d05fd1e84591591f019 Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Wed, 3 Apr 2019 20:04:02 -0400 Subject: [PATCH] Updated Plugin migration to QGIS 3 (markdown) --- Plugin-migration-to-QGIS-3.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Plugin-migration-to-QGIS-3.md b/Plugin-migration-to-QGIS-3.md index ad69a97..793e687 100644 --- a/Plugin-migration-to-QGIS-3.md +++ b/Plugin-migration-to-QGIS-3.md @@ -28,6 +28,14 @@ You should see your plugin in QGIS 2.99 and up (*note: if it does not appear, ma You can find Python API documentation at http://python.qgis.org/master/ **Please note**: QGIS3 compatibility module (so 3.x plugins will also work on 2.18) has been deprecated. +## Common migration issues + +* GUI widgets are now located in `QtWidgets` module. +`from qgis.PyQt.QtWidgets import QWidget` for instance. +* Use new style connect. In Qt4, it was still possible to use the old style connect, but deprecated. Now, in Qt5, you must update to the new style connect. +`your_object.your_signal.connect(your_function)` +Check https://gis.stackexchange.com/questions/274717/converting-qgis-2-plugin-to-qgis-3/274959#274959 + ## Debugging and finding problems You can use the [qgis2to3](http://www.opengis.ch/2018/04/13/porting-qgis-plugins-to-api-v3-strategy-and-tools/) tools and your IDEs (PyCharm or Eclipse) to step through your code and find and solve incompatibilities. Alternatively, you can install First Aid plugin and use it within QGIS. More info can be found here: https://www.lutraconsulting.co.uk/blog/2016/06/12/introducing-first-aid-plugin/