mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-03 00:04:47 -04:00
Add some more info for Windows users
parent
2a9693779c
commit
9afa1fc54f
@ -26,16 +26,28 @@ It's possible to make a plugin for both Qt5 and Qt6.
|
|||||||
This will get you in the right direction but might not do all necessary changes. Make sure to test your plugin thoroughly. Consider using an IDE with inspection that can notify you about broken imports, bad usage or non-existent references.
|
This will get you in the right direction but might not do all necessary changes. Make sure to test your plugin thoroughly. Consider using an IDE with inspection that can notify you about broken imports, bad usage or non-existent references.
|
||||||
|
|
||||||
### Use OSGeo4W shell
|
### Use OSGeo4W shell
|
||||||
|
|
||||||
|
1. Install a QGIS Qt6(!) build first, see for example "Latest Version for Windows (3.44) with Qt6 (experimental)" on https://qgis.org/download
|
||||||
|
2. Download the script from: https://github.com/qgis/QGIS/blob/master/scripts/pyqt5_to_pyqt6/pyqt5_to_pyqt6.py
|
||||||
|
3. Then given you installed your QGISQT6 in `C:\Program Files\QGISQT6 x.xx.x`
|
||||||
|
4. First make sure you are in the 'osgeo4w' environment by running the `C:\Program Files\QGISQT6 x.xx.x\OSGeo4W.bat`. From THAT command window, run the following:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
call "C:\Program Files\QGISQT6 x.xx.x\bin\o4w_env.bat"
|
# all from within the OSGeo4W command terminal!
|
||||||
call "C:\Program Files\QGISQT6 x.xx.x\bin\qt6_env.bat"
|
|
||||||
call "C:\Program Files\QGISQT6 x.xx.x\bin\qgis-qt6-bin.env"
|
|
||||||
|
|
||||||
|
cd "C:\Program Files\QGISQT6 x.xx.x"
|
||||||
|
".\bin\qt6_env.bat"
|
||||||
|
".\bin\qgis-qt6-bin.env"
|
||||||
set PYTHONPATH=C:\Program Files\QGISQT6 x.xx.x\apps\qgis-qt6\python;%PYTHONPATH%
|
set PYTHONPATH=C:\Program Files\QGISQT6 x.xx.x\apps\qgis-qt6\python;%PYTHONPATH%
|
||||||
|
pip install astpretty tokenize-rt
|
||||||
"C:\Program Files\QGISQT6 x.xx.x\apps\Python312\python3.exe" "path/to/pyqt5_to_pyqt6.py" "path/to/plugin"
|
python "path/to/pyqt5_to_pyqt6.py" "path/to/plugin"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you see: `WARNING:root:QGIS classes not available for introspection, only a partial upgrade will be performed` you misspelled the step with the PYTHONPATH...
|
||||||
|
|
||||||
|
If all went well the script silently ends and you will have `QgsMapLayer.VectorLayer -> QgsMapLayer.LayerType.VectorLayer` and `QMessageBox.Ok -> QMessageBox.StandardButton.Ok` which will work both in Qt5/QGIS3 and Qt6/QGIS4
|
||||||
|
|
||||||
|
|
||||||
### Use Docker image
|
### Use Docker image
|
||||||
|
|
||||||
A bundled image with QGIS based on Qt6, including Oracle client and PDAL and the migration script is available: <https://gitlab.com/Oslandia/qgis/pyqgis-4-checker>. It can be used like this:
|
A bundled image with QGIS based on Qt6, including Oracle client and PDAL and the migration script is available: <https://gitlab.com/Oslandia/qgis/pyqgis-4-checker>. It can be used like this:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user