46 Commits

Author SHA1 Message Date
Jorge Tornero
9195dbd057
Support for serial port sensor baudrate selection (#55848) 2024-02-06 13:53:11 +07:00
Nyall Dawson
59bd0befb5 Handle extended enum values for QNetworkReqest.setAttribute in PyQt6
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.
2024-01-28 13:33:10 +10:00
Nyall Dawson
c950d978dc Update python/PyQt/PyQt/QtWidgets.py.in
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
2024-01-27 20:39:48 +10:00
Nyall Dawson
601854a790 Patch back in flags removed in PyQt6
PyQt6 explicitly removes QFlag types from Qt c++ classes whereas
these were exposed in PyQt5. Patch them back in for compatibility.
2024-01-27 20:39:48 +10:00
Nyall Dawson
ac2df03436
Monkey patch in QVariant::Type values for Qt6 builds
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)
2024-01-24 09:49:43 +10:00
Nyall Dawson
62206e318e Fix QColor repr 2024-01-23 14:44:51 +10:00
Julien Cabieces
ed93538196 [PyQt6] Fix QAction & QShortcut which live in a different module
Make them available in both QtGui and QtWidgets so it could work both way
2023-12-20 04:23:31 +10:00
Julien Cabieces
6d044df35d Fix NULL QVariant 2023-12-19 04:43:45 +10:00
Julien Cabieces
52420c323b Replace QVariant.Int with QMetaType.Type.Int 2023-12-19 04:43:45 +10:00
Julien Cabieces
a6bd9d9b35 [PyQt6] Make PyQtcompat compatible with any Qt version 2023-12-19 04:43:45 +10:00
Julien Cabieces
0e457b8b47 [PyQt6] Rename pyqt mock files 2023-12-19 04:43:45 +10:00
Nyall Dawson
dcf7a98e0c Apply suggestions from code review 2023-04-05 11:17:19 +10:00
Nyall Dawson
7e0e421af7 PyQt doesn't provide repr for QColor, but it's highly desirable!
So monkey patch one in ourselves
2023-04-05 11:17:19 +10:00
Denis Rouzaud
da08c8a435
[cmake] generalize Python output directory in UseTest macro (#43191)
* [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
2021-05-13 07:32:03 +02:00
Denis Rouzaud
555f516925
use cmake native FindPython (#42497) 2021-03-28 21:49:40 +02:00
Loïc Bartoletti
eaa0642bab indent QtCore.py 2020-11-28 05:24:54 +10:00
Denis Rouzaud
eddf6feb45 modernize CMakeLists.txt files 2020-11-12 07:14:46 +10:00
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Nyall Dawson
b53d64bfb0
Silence annoying PyQt5.uic.loadUiType deprecation warnings
These aren't our fault -- they come from the PyQt library itself,
so we may as well hide them and avoid the noise.
2019-03-02 12:07:46 +10:00
Alessandro Pasotti
6c218b8032 Fix import sip on python 3.5 2018-10-24 11:13:54 +02:00
Nyall Dawson
0fad3e5731 Fix build with newer sip versions
Fixes #19476
2018-10-24 08:10:50 +10:00
Juergen E. Fischer
2c53630747 add missing copyright headers 2018-02-18 20:53:40 +01:00
Matthias Kuhn
b010b2a7a9 Remove PyQt4 compatibility layer 2017-10-16 22:34:37 +02:00
Juergen E. Fischer
c77172ed3d fix more flake8 warnings 2017-03-05 10:21:24 +01:00
Alexander Bruy
93206a2bee add missed Qt package to QGIS PyQt compatibility layer 2017-01-05 12:56:23 +02:00
Nyall Dawson
88e4410af1 Require Qt >= 5.5 2016-09-21 09:12:54 +10:00
Marco Bernasocchi
359063f545 Add qgis.PyQt.Qt compat files (#3491)
* added PyQt.Qt

* fix matthias comments
2016-09-16 08:09:47 +02:00
Webmaster
9d22440c56 fix to support PyQt5 5.7 2016-09-04 16:30:23 +07:00
Matthias Kuhn
ae3db0a1bf Fix single process build
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
2016-07-12 11:40:00 +02:00
Matthias Kuhn
ced7c27dcf [py3] Use __bool__ instead of __nonzero__ 2016-05-22 21:52:55 +02:00
Matthias Kuhn
7dfc69657f Migrate provider test to python 3 2016-05-13 22:23:03 +02:00
Matthias Kuhn
89b7a4aaa2 Introduce NULL QVariant to PyQt5 2016-05-13 22:23:03 +02:00
Denis Rouzaud
8071acd064 move PyQt compat folder to python/qgis 2016-04-29 14:10:26 +02:00
Juergen E. Fischer
5fb64bd4a6 fix installation of PyQt.uic wrapper 2016-03-22 09:47:14 +01:00
Juergen E. Fischer
a22e9d462a fix PyQt.uic for use in processing 2016-03-19 02:14:38 +01:00
Juergen E. Fischer
09f6b918a5 * fix pyuic wrapper on windows
* fix PyQt wrapper installation on precise
2016-03-17 02:23:16 +01:00
Juergen E. Fischer
4089ed8f01 fix pyuic wrapper 2016-03-16 00:34:24 +01:00
Juergen E. Fischer
c6d921729e python fixes:
* issues identified by pyflakes (star and unused imports)
* pyqtwrapper: add QtSvg
* some exceptions e.message => unicode(e)
* some translations tr("..." % foo) => tr("...") % foo
* TODO:
  python/console/console_sci.py:547 QsciScintillaCompat?
  python/plugins/db_manager/dlg_query_builder.py:304 pop_up_error?
2016-03-15 17:25:23 +01:00
Juergen E. Fischer
01c2cfbe87 pyqtwrapper: set sip api to 2 for PyQt.QtCore for Qt4
(followup fb3fcfa3)
2016-03-15 10:31:04 +01:00
Juergen E. Fischer
fb3fcfa3a0 Python3/Qt5/2to3 updates:
* 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
2016-03-14 20:38:20 +01:00
Juergen E. Fischer
7e2caa679c fix some more signals for pyqtwrapper 2016-02-27 01:07:41 +01:00
Juergen E. Fischer
4e1cf3c081 add missing copyright headers 2016-01-08 21:32:11 +01:00
Matthias Kuhn
7b0815b682 Fix python errors 2015-11-18 19:21:12 +01:00
Matthias Kuhn
ac44a307c7 Fix PyQt compat lib INSTALL path 2015-11-17 09:20:18 +01:00
Juergen E. Fischer
1675703ddb qt5 fixes 2015-11-17 01:00:08 +01:00
Matthias Kuhn
47543d940e [py3] Add PyQt5/PyQt4 compatibility layer 2015-11-16 07:42:48 +01:00