321 Commits

Author SHA1 Message Date
Nyall Dawson
280cd84652 Add more HoldGIL annotations to cheap methods 2024-05-24 16:34:33 +10:00
Mathieu Pellerin
6709debbac Fix sipify.pl script not handling Q_INVOKABLE inline 2024-04-17 18:07:43 +07:00
Nyall Dawson
e31946f831 On qt6 builds, even non-class enums should be IntEnum types
This fixes compatiblity with existing code, where enums may be compared
against integers directly
2024-02-13 20:51:03 +10:00
Nyall Dawson
814e6db3b4 Don't map non-list of QVariantMaps to QMap<QString,QVariant>
The original workaround was only supposed to apply to QList/
QVector of QVariantMaps. By replacing them all in sip we
break mapping of signals defined in c++ which are emitted
by Python code.

Fixes exceptions after running processing algorithms in Qt6
builds.
2024-02-12 12:16:14 +10:00
Nyall Dawson
87f117f47b [sipify] Avoid leading and trailing newlines in enum value docstrings 2024-02-11 13:37:29 +10:00
Nyall Dawson
2b710b2617 [sipify] Don't write invalid escaped \d character to docstring
Instead correctly translate to ..deprecated python docstrings
2024-02-11 13:37:29 +10:00
Nyall Dawson
eb81a07732 Correctly tag Qgis.WkbType as IntEnum 2024-02-07 19:46:16 +10:00
Nyall Dawson
19efe1439b Fix sipify check 2024-02-07 14:16:42 +10:00
Nyall Dawson
ea6e74c80a [sipify] Block any new non-class enums from being exposed to Python
These don't work well with Qt6 -- by blocking any new ones we
avoid having to monkey patch in compatibility code in order to avoid
breaking existing API when we later have to upgrade them to enum
classes
2024-02-07 14:16:42 +10:00
Nyall Dawson
503a95a1a1 Move enums to Qgis namespace for consistency 2024-02-02 04:59:04 +10:00
Nyall Dawson
078fd4f2ea Make IntFlag enum type opt-in, rather than opt-out
And make sipify handle this nicely. This means that all our non-flag
style enums correctly map across to IntFlag python enums on Qt 6,
fixing issues with negative enum values for these and providing
a better match for the original c++ enum.
2024-01-31 17:16:18 +10:00
Nyall Dawson
12f4ce5978 Use correct enum type for enum with negative values 2024-01-31 17:16:18 +10:00
Nyall Dawson
0aafdbfb77 Handle flags compatibility with older code when porting enums to enum
class on PyQt5 builds
2024-01-30 19:10:43 +10:00
Nyall Dawson
1e67b81d5e Don't write _force_int multiple times 2024-01-30 19:10:43 +10:00
Nyall Dawson
38cff47c9e Fix flags bool operator on qt6 2024-01-30 14:49:54 +10:00
Nyall Dawson
2bef88b031 Correctly add int types to flag style enum classes 2024-01-29 09:44:41 +01:00
Nyall Dawson
85b7a2c411 [sipify] Patch support for int based enum operations on non-enum class ints
sip6 converts all enums to python Enums, but ONLY creates
Enums with IntFlags types when the c++ type is an enum class : int.
Accordingly we need to patch back in all the operations which treat
enum values as ints, like |, &, bool, etc.

The long term solution here is to move all our c++ enums to enum
class, but that's not always straightforward and can break API
for plugins if it involves the signature of virtual methods.
2024-01-29 04:23:44 +10:00
Nyall Dawson
dbeb6d5f6a sip for Qt6 chokes on QList/QVector<QVariantMap>, but is happy if you expand out the map explicitly 2024-01-23 08:32:38 +01:00
Nyall Dawson
f55812b517 Remove deprecated smartmatch from sipify
This spams the terminal with deprecation warnings whenever sipify
is run on newer perl versions
2024-01-16 07:24:31 +10:00
Julien Cabieces
0e644d1889 [PyQt6] remove QTextCodec arg instead of removing the method 2024-01-11 04:52:01 +10:00
Julien Cabieces
54fd608304 [PyQt6] s/SIP_PYQT5_ONLY/SIP_PYQT5_RUN 2024-01-11 04:52:01 +10:00
Julien Cabieces
062ce03b6d [PyQt6] remove QTextCodec and rename pyqt5_from_qvariant_by_type
QTextCodec is no longer existing in PyQt6 (only in QtCoreCompat in C++)
2024-01-11 04:52:01 +10:00
Julien Cabieces
e57a13639e fix useless new line 2023-12-13 05:36:44 +10:00
Julien Cabieces
e8093a8ce5 Only mock non class enums 2023-12-13 05:36:44 +10:00
Julien Cabieces
9f833af55c Modify sipify script to generate PyQt6 bindings 2023-12-13 05:36:44 +10:00
Nyall Dawson
a1f9039f12 Fix invalid escape sequences in docstrings for enums with since
annotation
2023-10-24 06:44:46 +10:00
Nyall Dawson
95dc22f6b5 Fix handling of ' in enum docstrings in sipify 2023-07-09 22:48:59 +10:00
Nyall Dawson
b290179951 Fix monkey patching when comment contains " 2023-04-27 03:58:30 +10:00
Denis Rouzaud
8ce4718335
[sipify] support multiple classes template definition (#52838) 2023-04-22 18:18:14 +02:00
Nyall Dawson
a7f12a504d Ignore cppcheck suppression in sipify 2023-04-17 16:29:44 +10:00
Nyall Dawson
50c76929e1
Followup 30700f1, ensure links to Qgis members are set in docstrings 2023-03-31 10:46:24 +10:00
Nyall Dawson
ad16817fba Fix enum compatibility with python full enum use of old values 2023-02-19 13:29:06 +10:00
Denis Rouzaud
dfd776aa90 [sipify] support forward declaration of template classes 2023-02-03 09:05:37 +01:00
Alessandro Pasotti
eb76172122 Raise proper exceptions from search 2022-09-01 11:32:13 +02:00
Nyall Dawson
5e40c9529f [sipify] Correctly handle " in enum member docstrings 2022-06-03 12:02:13 +10:00
Denis Rouzaud
f5bd1f2165 [sipify] support argument renaming + fix dosctring reset when cpp code is commented 2022-04-29 07:57:25 +10:00
Nyall Dawson
d83fd31815 [sipify] Correctly handle :: in enum comments 2022-04-28 13:54:47 +10:00
Denis Rouzaud
9671c90b41
[sipify] fix more complex member assignment removal (#48198) 2022-04-13 10:22:32 +02:00
Nyall Dawson
28bb05b0d5 Add method to retrieve axis order for a QgsCoordinateReferenceSystem 2022-04-06 11:45:32 +10:00
Denis Rouzaud
a923b339d2 qHash implementation for scoped enum type 2022-03-11 07:47:46 +01:00
Denis Rouzaud
1879f51781 [sipify] fix do not export template classes 2022-03-10 19:32:09 +01:00
Denis Rouzaud
b7c5d259c6 [sipify] add SIP_MAKE_PRIVATE macro
also handle std::numeric_limits<qlonglong>::min/max
2022-03-02 14:58:56 +01:00
Denis Rouzaud
08ada3aadf sipify + move sipify config file to ./python 2022-03-01 12:09:47 +01:00
Juergen E. Fischer
c6008b7ee1 fix MSVC build: reverts fee62e4, dff05dd and e3a77b9484c effectivly
reverting 3fb0f66 (followup #45348)

Using --no-public-is-protected (default on Windows) also works on Linux
and fixes #45331 too
2021-10-21 23:03:48 +02:00
nirvn
ce873d30e8 protected -> public 2021-10-12 16:34:05 +10:00
Denis Rouzaud
e3a77b9484 fix enum in protected section 2021-10-12 16:34:05 +10:00
Denis Rouzaud
070a3e97da [sipify] make all protected methods slots 2021-10-12 16:34:05 +10:00
Nyall Dawson
2fc60fcd7f Fix compatibility of moved QFLAGS 2021-09-26 11:24:51 +10:00
Nyall Dawson
4bb7f82f2e [sipify] Add check that doxygen //!< command is only used for enum
documentation

sipify can't handle it in other contexts
2021-07-19 16:05:53 +10:00
Nyall Dawson
711a615be3 Fix raises sphinx format 2021-06-25 10:50:04 +10:00