Updated Plugin migration to QGIS 3 (markdown)

Etienne Trimaille 2019-04-03 20:04:02 -04:00
parent a0d83cc027
commit 153be6efc8

@ -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/