Since this is an enum designed to be extended in c++ (eg by adding
values after Qt's user role), we have to do some fancy wrapping
in order to make these extended roles look like the types
acceptable to the PyQt function.
This has been designed to allow other functions to be wrapped
which rely on custom enum values.
Since QVariant.Type doesn't exist in PyQt6, we patch it back
in by setting them to their QMetaType.Type equivalents.
This means that code which calls eg:
field = QgsField('my_field', QVariant.Int)
will work as usual under Qt5, while on Qt6 builds it will work
without change. (Since QVariant.Int is QMetaType.Type.Int, and
the PyQGIS6 sip conversion code will kick in and transparently
convert the QMetaType.Type.Int value to QVariant::Int when
calling the underlying c++ method)
* [cmake] generalize Python output directory in UseTest macro
this is helpful in case we set up another python output directory (eg PySide2)
* define python output directories to the parent scope
* try with target_include_directories
* define vars on top level
* Update UsePythonTest.cmake
* some cleanup
* more cleanup
* fix uic
* fix path for all platforms
* fix var
A race condition triggered that sometimes the file
output/python/qgis/__init__.py was not created before a python uic
compiler started and therefore the required module could not be
imported.
This leads to errors like
[ 82%] Generating ui_dialogAbout.py
Traceback (most recent call last):
File "../../../../../scripts/pyuic-wrapper.py", line 26, in <module>
import qgis.PyQt.uic.pyuic
ImportError: No module named qgis.PyQt.uic.pyuic
python/plugins/GdalTools/tools/CMakeFiles/zzz-GdalTools-2-depend.dir/build.make:117:
recipe for target 'python/plugins/GdalTools/tools/ui_dialogAbout.py'
failed
make[2]: *** [python/plugins/GdalTools/tools/ui_dialogAbout.py] Error 1
CMakeFiles/Makefile2:5074: recipe for target
'python/plugins/GdalTools/tools/CMakeFiles/zzz-GdalTools-2-depend.dir/all'
failed
make[1]: ***
[python/plugins/GdalTools/tools/CMakeFiles/zzz-GdalTools-2-depend.dir/all]
Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
* pyqtwrappers update (add QtNetwork, QtXml, QtSql, QtTest, uic)
* 2to3 updates
* move QPyNullVariant/NULL to PyQt.QtCore
* add global unicode/basestring/long for Python3
* expand QtGui, QtCore module and star exports
* Qscintilla2
* replace Set import with set builtin