1574 Commits

Author SHA1 Message Date
Nyall Dawson
280cd84652 Add more HoldGIL annotations to cheap methods 2024-05-24 16:34:33 +10:00
Nyall Dawson
d9232bdbf1 pyqt5_to_pyqt6: Handle QPainter.HighQualityAntialiasing
This is obsolete even in Qt5, should be QPainter.RenderHint.Antialiasing
2024-05-22 09:35:11 +02:00
Nyall Dawson
aa52e4b392 [pyqt5_to_pyqt6] More exhaustive searching for deprecated QFontMetrics methods 2024-05-22 14:30:23 +10:00
Nyall Dawson
d2a173fdcf Fix pyqt5_to_pqt6 script when src_to_tokens returns duplicate tokens
Sometimes src_to_tokens returns multiple tokens at the same offset.
This is likely a bug in some versions of tokenize_rt, but this
workaround avoids an exception occurring in the QGIS script.
2024-05-16 12:41:21 +02:00
Nyall Dawson
ecfcf6ced1 Use a more flexible API for handling SensorThings expansions
This allows us to control the sort order and limit for each expansion,
and gives us more flexibility in future to eg handle per expansion
filter strings
2024-05-16 15:14:49 +10:00
Werner Macho
6b4ddc873a Adding Translator on request 2024-05-15 15:50:23 +02:00
Nyall Dawson
ef89c1f213 [feature] Add "Run Selected Steps" option to model designer
This action will run only the selected steps in a model, allowing
the user to run a subset of the model.

The initial state will be taken from any previous executions of the
model through the designer, so results from previous steps in the
model are available for the selected steps.

This makes it possible for a user to fix parts of a large model,
without having to constantly run the entire model to test. Especially
useful when earlier steps in the model are time consuming!
2024-05-04 06:30:43 +10:00
Matthias Kuhn
867f39dc34 Fix using astyle on wsl 2024-05-01 06:19:53 +02:00
Nyall Dawson
5e85f29512 Add Google Fonts processing script 2024-04-18 11:31:55 +10:00
Mathieu Pellerin
6709debbac Fix sipify.pl script not handling Q_INVOKABLE inline 2024-04-17 18:07:43 +07:00
bdm-oslandia
565b0b9002 chore(code_layout): use env var and pipe to bypass the "Argument list too long" error 2024-03-22 05:22:51 +10:00
Nyall Dawson
967cc5b6de [pyqt5toqt6] Add warning for activated[str] signal connections 2024-03-04 12:26:20 +10:00
Nyall Dawson
c4342425eb [pyqt5toqt6] Warn on compiled resource usage 2024-02-28 11:23:47 +10:00
Juergen E. Fischer
e75286a7e9 release.pl: fix ltr splash check 2024-02-23 13:00:29 +01:00
Juergen E. Fischer
76d2d7a36a fix rename of ltr splash
(cherry picked from commit cc9d733e5f12c78fc752b32bd487fe0098f630c7)
2024-02-22 21:37:54 +01:00
Aleix Pol
c63d33e12c appdata: Provide new ordering for the description tag
We should mark as translated the paragraph, not the root element
2024-02-20 08:56:38 +10:00
Nyall Dawson
256f2826f3 [pyqt5toqt6] Replace invalid QVariant() constructor with NULL
This approach works for both Qt5 and Qt6 builds
2024-02-14 13:17:34 +10: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
12c62dc9cd [pyqt5toqt6] Warn on removed QDesktopWidget use 2024-02-13 08:13:43 +10:00
Werner Macho
46eb94e01a update Name on user request 2024-02-12 13:06:04 +01:00
Nyall Dawson
4b35ad67ad [pyqt5toqt6] Raise warning on QFontMetrics.width()
This is removed in Qt6. Use QFontMetrics.horizontalAdvance()
if plugin can safely require Qt >= 5.11, or
QFontMetrics.boundingRect().width() otherwise
2024-02-12 14:22:37 +10:00
Nyall Dawson
ad91789f9e Fix pyqt5_to_pyqt6 double unnesting some enums 2024-02-12 12:19:10 +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
Even Rouault
8cd3363137
Merge pull request #56226 from nyalldawson/null_value
Don't use QVariant(QVariant.Type) for NULL values in Python
2024-02-07 18:42:15 +01:00
Nyall Dawson
eb81a07732 Correctly tag Qgis.WkbType as IntEnum 2024-02-07 19:46:16 +10:00
Nyall Dawson
8f3944dabd Don't use QVariant(QVariant.Type) for NULL values in Python
Instead use qgis.core.NULL, so that the correct logic applies
for Qt6.
2024-02-07 19:35:28 +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
68a7ce0eb5 pyqt5toqt6: replace from PyQt.Qt imports with PyQt.QtCore import Qt 2024-02-01 17:22:00 +10:00
Nyall Dawson
0acf51e8e5 pyqt5toqt6: Catch QDateTime(QDate) constructor and replace with
QDateTime(QDate, QTime)
2024-01-31 09:07:06 +01: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
310b9172fb pyqt5to6: raise warnings on fragile addAction calls
The object.addAction variants with multiple arguments have changed
signature in Qt 6. It's safer to explicitly create a QAction first
and then add to an object using:

    my_action=QAction(...)
    obj.addAction(my_action)

It's a considerably less fragile syntax to use in any case!

Fixes errors when trying to show context menu in Python console
on Qt 6 builds
2024-01-31 10:55:33 +10:00
Nyall Dawson
8c3ac3f3a3 pyqt5to6: Catch QVariant.Type.XX and replace with QVariant.XX
QVariant.Type doesn't exist, the values should be referenced
directly
2024-01-31 10:55:33 +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
0bc45a4c90 pyqt5_to_pyqt6: Fix qApp, warn on QRegExp
Auto replace qApp with QApplication.instance()
Raise warnings if script imports QRegExp. We can't auto replace
with QRegularExpression here, the API is just way too different.
2024-01-29 09:17:02 +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
7ab6c68bb5 Add warning when required import not automatically addable 2024-01-26 14:46:39 +10:00
Nyall Dawson
0c6b5b70bc pyqt5_to_pyqt6: Handle QDateTime constructor variant
The QDateTime (yyyy, mm, dd, hh, MM, ss, ms, ts) constructor
doesn't work anymore, so port to the more reliable QDateTime(QDate,
QTime) format
2024-01-26 14:46:39 +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
a5487de9f3 Handle enums referenced using subclass too 2024-01-22 19:02:40 +10:00
Nyall Dawson
3e802ee42a Replace deprecated item roles 2024-01-22 19:02:40 +10:00
Nyall Dawson
02cbea36a8 pyqt5 to 6: rename exec_ to exec
This is compatible with both qt5 and qt 6
2024-01-22 05:46:15 +10:00
Nyall Dawson
23cef9f554 Partially make script utils Qt6 compatible 2024-01-22 05:46:15 +10:00