| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Set it directly instead of looking it up via converters, which
is a step towards decoupling the converters from the per-interpreter
types and saves dict lookups.
Task-number: PYSIDE-3155
Change-Id: I31a71d1a9d02f1247e04c57de2c2901746221b4f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the Limited API, PyTypeObject is an opaque struct, for which
libshiboken provides a dummy definition.
PyType_GetFullyQualifiedName() (stable API since 3.13) can be used as
a replacement, but it returns a PyObject.
Add a convenience function PepType_GetFullyQualifiedNameStr() similar
to the existing PepType_GetNameStr() to return a C-string.
Leave the 3.13 code commented out for the moment since it causes a
crash.
This does not cover occurrences of tp_name passed as strings
to Python formatting functions using the %s placeholder since that
can be replaced by the new %N/%T placeholder starting from 3.13.
Task-number: PYSIDE-3171
Change-Id: I4a073872cd0d138b8d8c6aafb08ccb33451812ca
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
PyModule_AddObject() is deprecated in 3.13. For adding types to a
module, PyModule_AddType() can be used instead (added to stable ABI in
3.10). Add a Pep function for it.
This requires adapting some type names in QML.
Pick-to: 6.9 6.8
Task-number: PYSIDE-3147
Change-Id: I169a6b7071c780dd3c3ec2ddd0762dca6cacf067
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Some macros (Py_INCREF/Py_TYPE) were reimplemented as functions,
unearthing some type incompatibilities.
Pick-to: 6.9 6.8
Task-number: PYSIDE-3147
Change-Id: If10bc5941d718d8845c7bbd5facf6021539aad34
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Complements 5608c60f47f6c39a6c1dee5fb165c6d70bd1ee3f.
Task-number: PYSIDE-3171
Pick-to: 6.9 6.8
Change-Id: I57f0d8bbd8d0f82367f03d0f55297e74361c44da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
| |
It encapsulates fetching/restoring errors and uses the old or new
exception API depending on version.
Task-number: PYSIDE-3067
Change-Id: I6e39d92c7e79fed864b364a90c5bd5b474a41ed6
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
| |
Make sure to store QtEnums in QVariant when the enum has a metatype.
Fixes: PYSIDE-3084
Change-Id: I94b89f89e6fb3c58560325f2a6843a5260d86557
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Replace the Qt forwarding headers by the .h files. This brings down
the dependency list by approx 6%.
Pick-to: 6.9
Change-Id: Iae7640ccbdf6a8be68137922d4191522d914d790
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Remove the global header <shiboken.h> in favor of the respective
headers.
Pick-to: 6.9
Change-Id: I08ee39fbd5abb15741fa5746bb82f9ddcd32ed7f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
| |
Pick-to: 6.9
Task-number: PYSIDE-2916
Change-Id: I6e72977bfcf95c3c28cc160e07febb84220fa505
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
| |
- Remove superfluous casts
Pick-to: 6.8
Change-Id: I8dd7cdd1e9d3f30103fc6d87bf04d7f0d0182603
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change dc7acd1f2dc750c3c8602203ae1558b0e60a3c17 added a reference
to signal senders not created in Python to fix a crash when doing
something like:
QAbstractItemView.selectionModel().currentChanged.connect(...)
In addition, the code kept a weakref on the sender and tracked its
deletion.
To simplify this, keep a tracking QPointer on the sender QObject and
its PyTypeObject * instead of a PyObject * . This also allows for
calling QObject::connect() and other helpers directly instead of using
PyObject_CallObject() on the PyObject * to forward the calls.
Fixes: PYSIDE-2793
Fixes: PYSIDE-1057
Task-number: PYSIDE-79
Change-Id: I1ce6f4c35c819f3e815161788cdef964ffc6fd96
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a struct shared by shared_ptr in all instances of
PySideSignalInstancePrivate that is tracked by the weak reference.
Amends db40e3e07932576bc54cd922eecd423c0f675613
Task-number: PYSIDE-2201
Task-number: PYSIDE-79
Pick-to: 6.8
Change-Id: Ic7bb836422f3843a02474f2bb92641b8a9ebc824
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
PyCFunction_GET_FLAGS
Removing old compatibility macros from the initial limited api
implementation.
Change-Id: I3044609ade36b5b378de05934eab8a098450f42f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
macros
Removing old macros for compatibility with the limited api,
and refactoring some of their usages
Change-Id: I33954199d2ef9884c64b963863b97aed851c440f
Pick-to: 6.8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PySequence_Fast_GET_SIZE is defined as:
(PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o))
and when using the Limited API we re-define the _GET_SIZE macro
to be the _Size function, and considering this is our standard
use case, the macro could be replaced directly by the function.
Replacing also some cases were int was used instead of Py_ssize_t
when using PySequence_Size.
Pick-to: 6.8
Change-Id: I31aecd571a1d8ea82a3441f0b9e16ee19f026b05
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Split the Enum check function to have an overload for a
PyTypeObject * and add a helper function checking whether
an enumeration is registered in the Qt meta type system.
If so, use its name for the property type.
Fixes: PYSIDE-2840
Change-Id: I8253e28d9020dcda9b23d6ad5ddd4e60cd2086d7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Extract a helper for matching the signal instance and use it from
signalInstanceConnect() and signalInstanceDisconnect(). This currently
only matters for signal QObject::destroyed(QObject*) and
QObject::destroyed().
Task-number: PYSIDE-2810
Change-Id: I8ebb8487c7b6953cbfff2179c3b5081a3674bf16
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Instead of parsing the signature from the string, pass
the signal QMetaMethod into getReceiver(), which has the parameter
types.
The helper getArgsFromSignature() can then be removed.
Task-number: PYSIDE-2810
Change-Id: I506e058d3fbe1cb0d6db599742a0ffc35db634d4
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
| |
Task-number: PYSIDE-2810
Change-Id: I54601a5a3f1f7cd648e5e382850ee10fbe240dac
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Initialize variables
- Use auto *
- Remove repeated return types
- Fix else after return
- Fix some invocations of static methods
- Make functions const/static where appropriate
- Fix some int types to avoid lossy conversions
- Use Py_RETURN_NONE where appropriate
- Minor cleanups
- Remove some macros
Change-Id: I7fa7a29e7b3dc47037027978001824e0709d001f
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This problem is new shown in Python 3.13 although this
was not correct before.
We need to remove the error before issuing a warning.
Task-number: PYSIDE-2751
Change-Id: Ie4572e043388ca3f87092ea886e935b583f871b4
Pick-to: 6.7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
There was a "Short circuit" code path triggering
on QMetaMethod signal signatures without parentheses,
which is apparently dead.
Task-number: PYSIDE-2667
Change-Id: I68c4c636ea224a7691e76286ed43f5aaaa6d4bd7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Use the PY_RETURN_* macros for returning them.
Pick-to: 6.7 6.5
Task-number: PYSIDE-2747
Change-Id: I48db8b958925e6ae39ce8ae8fb926429d0e4cd02
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function PyErr_SetString is used quite often, which has
no return value. The bracketed sequence
PyErr_SetString(...);
return nullptr;
can in most cases be replaced by a single call to
return PyErr_Format(...);
To simplify matters, PyErr_Format is now used everywhere.
Task-number: PYSIDE-2404
Change-Id: I5988fcd2430be700415d14d7a5cc740211e61d08
Pick-to: 6.7
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Use PyExc_RuntimeWarning instead of PyExc_RuntimeError.
Amends d7aa15abe25bd71ea19180743ce9b41e0b788520.
Fixes: PYSIDE-2705
Pick-to: 6.7
Change-Id: I04de3eb92468b996e50270b2268e08b3b819e802
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Do not use the %S-formatting directive when an error is already set,
since that will invoke str() and thus cause an error.
Amends d7aa15abe25bd71ea19180743ce9b41e0b788520.
Task-number: PYSIDE-1275
Change-Id: I1125ca254efdeeb3652d6171d71f3e22fb686a7a
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
[ChangeLog][PySide6] QObject.disconnect() now returns False instead
of raising an exception for non-fatal cases.
Fixes: PYSIDE-1275
Change-Id: I860b69e1a7055c38f903ffafd7f816575c0d1f7a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
Using PepType_GetSlot() as is requires adding ugly casts. To work
around, add a new file with convenience helper functions in C++
linkage. This also allows for using templates for tp_alloc.
Task-number: PYSIDE-560
Change-Id: Ia50a226f5b545861f885d600445b91b4e11713c5
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Find the number of default parameters using PyFunction_GetDefaults()
and change the argCount() helper to return the min/max argument count.
With that, try to match the slot using the most argument.
[ChangeLog][PySide6] It is now possible to connect signals to
slots/lambdas with more arguments provided they have default
parameters.
Fixes: PYSIDE-2524
Change-Id: I134d33e3ee78b62689fa36887a9acd41951c02e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Replace it by a list.
Task-number: PYSIDE-2524
Change-Id: I16089a2f53f10726377f4ed66bc466549f4f6474
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Store the argument count as obtained from QMetaMethod or Signal
argument parsing via PySideSignalData::Signature in
PySideSignalInstancePrivate and use that to find a matching
slot instead of parsing the signature.
Task-number: PYSIDE-2524
Change-Id: I7c30bd1ee7873b4d13c40e0a91a4ace9026890a2
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SignalSignature is temporarily used while constructing Signal
instances and finally converted into a PySideSignalData::Signature.
Change the code to use PySideSignalData::Signature right away,
which allows simplifying the code.
As a drive-by, fix the less-than method.
Shorten the data type for the attributes to be able to add further
values.
Pick-to: 6.6
Task-number: PYSIDE-2524
Change-Id: I4b67d55b65356fbf56633bbbe1d3ef466167227c
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Since the name ends up in QMetaObject::addSlot() taking a QByteArray
anyways, there is no point in constructing the name using QString.
Task-number: PYSIDE-2524
Change-Id: Ib27a55efa8b22eb983d5e27e3a981efd72e9996f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Replace "<lambda>" by "_lambda_" when one is passed.
Task-number: PYSIDE-2524
Pick-to: 6.6
Change-Id: I9839c5e2862fc8c0153653eff1d29cf759dc5875
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
| |
Fixes: PYSIDE-2510
Pick-to: 6.6 6.5
Change-Id: Icc1461299907cc116bc75f5de994a687b85c1786
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Amends 7878a88aa638da63b8a2ec2200bbe18882277d21.
Pick-to: 6.6 6.5
Fixes: PYSIDE-2509
Task-number: PYSIDE-1334
Change-Id: I92fc4021054b1473bd6769ffb9ff0e6803b5439e
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is the better concept to use the same structure for
all type creation functions. We move the type slots and
type specs into these functions.
The calling function then always has the same structure
of one static expression and returning the type.
This might also save some space for shatic structures.
Task-number: PYSIDE-2230
Change-Id: Ib972f210f44422eb1ebe47a0d92ac18a8377ac87
Pick-to: 6.6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
|
|
| |
List all signatures, separated by ';'.
Pick-to: 6.6 6.5
Fixes: PYSIDE-2493
Change-Id: I3c7e3367c340ab142a388a3991dc08774b6c7075
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
| |
Task-number: PYSIDE-2487
Pick-to: 6.6 6.5
Change-Id: I93d2c350aecf1339c6b18496f376d04cdd37dc29
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A few more cases of cppgenerator were added. This are
now really all cases, because tp_dict is no longer
exported.
As a very positive side effect, there is no longer
direct tp_dict access in the "init_<type>" functions.
Usage of PepType_GetDict would have created a permanent
extra-reference.
NOTE: It was necessary to set SKIP_UNITY_BUILD_INCLUSION
on pep384impl.cpp in order to let this work with unity.
Change-Id: I021dbc978b51265db96d5d3d438e06aa96230cc1
Pick-to: 6.2 6.5 6.6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is a long due task to finally remove the direct access
to type object fields.
With Python 3.12, direct access to tp_dict became
problematic. We use that as a reason to start removing
the direct access in favor of function calls.
Task-number: PYSIDE-2230
Change-Id: I6f8a7479ab0afdbef14d4661f66c3588f3a578aa
Pick-to: 6.2 6.5 6.6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Builtin types no longer have tp_dict set. We need to
use PyType_GetDict, instead. This works without Limited API
at the moment.
With some great cheating, this works with Limited API, too.
We emulate PyType_GetDict by tp_dict if that is not 0.
Otherwise we create an empty dict.
Some small changes to Exception handling and longer
warm-up in leaking tests were found, too.
Pick-to: 6.6 6.5 6.2
Task-number: PYSIDE-2230
Change-Id: I8a56de6208ec00979255b39b5784dfc9b4b92def
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the non-limited API case, there was a cast to PyTupleObject *
required for argument tuples due to the PyTuple_GET_ITEM() macro
definition. Replace it by calling object().
Also deprecate the universal cast function.
[ChangeLog][shiboken6] Cast operators of the helper class
AutoDecRef have been deprecated.
Pick-to: 6.6
Task-number: PYSIDE-2479
Change-Id: Iff660fbc791b1a74ecbd247e71edc896767f308d
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Replace out parameters by a struct and streamline code accordingly.
Return the function name as a PyObject to be able to delay the
conversion. Fix some implicit bool conversions along the way.
Pick-to: 6.6 6.5
Task-number: PYSIDE-229
Task-number: PYSIDE-2423
Change-Id: I0dcf14f5b719529117c0ccc119fb19802b399a35
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- nullptr
- narrowing integer conversions
- else after return
- Use auto
- Missing move special functions
Pick-to: 6.6 6.5
Change-Id: Ib872481a46c8bb17592cdc1778ab3c4d9598c753
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
- Use nested namespaces instead repetitive namespace declaration
- Remove anonymous namespaces that contain only static functions.
"static" is sufficient here, the anonymous namespace only increases
compilation time.
Pick-to: 6.6 6.5
Change-Id: I6cd1b63da79eaf40a1b7ae031def97fa22903e99
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Accept only lists and tuples of strings as argument
names, preventing crashes when passing numbers or strings
being split into characters by the sequence check.
As a drive-by change PySideSignalData::signalArguments from
QByteArrayList* to QByteArrayList which eases error handling.
As it is a shared class anyways, the overhead is negligible.
Task-number: PYSIDE-2368
Change-Id: I460b5d7297cf66c6ab5566a99c998527daf12eed
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
| |
Pick-to: 6.5 6.2
Fixes: PYSIDE-2368
Change-Id: I8e52e7d5787795ec336683134c098b37e085aa01
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
| |
Task-number: PYSIDE-2384
Change-Id: I38cd611439a882e65f9f3bc6ca47dedd0a4fc66c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|