qgis2ç¨ã«ä½ã£ããã©ã°ã¤ã³ãqgis3ã«å¯¾å¿ãããããã®ã¡ã¢ã§ãã
qgis2to3ã®æºå
OSGeo4Wãã¤ã³ã¹ãã¼ã«
ï¼QGISã®ã¹ã¿ã³ãã¢ãã¼ã³ã¤ã³ã¹ãã¼ã©ã¼ã§ã¤ã³ã¹ãã¼ã«ããããã®ã ã¨py3_envã§ãã¹ããã¾ãæå®ãããªãã®ã§pipãC:\OSGeo4Wã®pythonãèªã¿è¾¼ããã¨ããã®ã§ãOSGeo4Wãããã¯ã¼ã¯ã¤ã³ã¹ãã¼ã©ã¼ã使ãã¾ããï¼
OSGeo4W shell ã管çè ã§å®è¡
py3_env
pip install qgis2to3
qgis2to3ã®å®è¡
OSGeo4W shellãæ®éã«å®è¡
py3_env
cd C:\Users\mizutani\.qgis2\python\plugins
mkdir myplugin_qgis3
python "c:\OSGeo4W64\apps\Python37\Scripts\qgis2to3" -w -n -o myplugin_qgis3 myplugin
importã®ä¿®æ£
importã以ä¸ã«å¤æ´
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtWidgets import *
from qgis.PyQt.QtGui import *
from qgis.core import *
from qgis.gui import *
metadata.txtã®ä¿®æ£
metadata.txtã®ãã©ã°ã¤ã³ã®å¯¾å¿ãã¼ã¸ã§ã³ã3.0ã«å¤æ´
qgisMinimumVersion=3.0
qgis3ã®ãã©ã°ã¤ã³ç½®ãå ´ã«ç§»å
mv myplugin_qgis3 %USERPROFILE%\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\myplugin
ãªã½ã¼ã¹ã®ã³ã³ãã¤ã«
cd %USERPROFILE%\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\myplugin
qt5_env
pyrcc5 -o resources.py resources.qrc
QGIS3ã®èµ·åã¨ã¨ã©ã¼ã®ä¿®æ£
qgis3ãèµ·åãã¦ãã©ã°ã¤ã³ã§ã¨ã©ã¼ã«ãªãç®æãä¿®æ£
å¤æ´ç®æ
QGIS API Documentation: Backwards Incompatible Changes