| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The amalgamation of old and new enums is slowly unraveling from the
inside. This meanwhile actually removes the old code.
Included a change by Friedemann to improve enum value handling.
After the signed/unsigned problem was fixed, there was only one case
left where Qt and Clang parser disagreed which could be fixed.
The final solution uses overloaded functions to generate all
necessary cases with minimal footprint in the executable.
Task-number: PYSIDE-1735
Change-Id: I3741ce8621e783a750f3c05241c916008f78f39b
Done-with: Friedemann.Kleint@qt.io (+2 squashed commits)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Add a check to the connect function.
Pick-to: 6.5
Fixes: PYSIDE-2328
Change-Id: I62a10ef5710487f8ab23cc46c1cc4a34fab5e2b1
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SignalInstance unfortunately can be created directly without
a calling Signal. This is an old design error that cannot easily
be reverted because that is now the API.
Fixed by printing "(no signature)":
* print(SignalInstance()) # prints "(no signature)"
Fixed by producing a runtime error:
* SignalInstance().connect(lambda: None)
* SignalInstance().disconnect()
* SignalInstance().emit()
Thanks to <bers bers> who reported them all.
Task-number: PYSIDE-79
Change-Id: I92598d963b9796453fbd17c1526a674fa007e5e8
Pick-to: 6.4
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
When a SignalInstance is initialized with wrong arguments, it is
immediately deallocated. The deallocation was not aware that
certain structures were not initialized.
Task-number: PYSIDE-79
Change-Id: I4999bfc3eac1239cfbe8216d5ad574ba17b3ac85
Pick-to: 6.4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PYSIDE-79 bug was never understood, completely.
After getting much more clarity through the work on
PYSIDE-2201, the real problem could be found:
It turned out that the implementation of descriptors was
incomplete. Instead of respecting an already cached instance,
it created a new one, all the time, resulting in a serious leak!
This became visible by deep inspection of the control flow
with VS-Code. After the interaction of PyObject_GetAttr,
getHiddenDataFromQObject and signalDescrGet became transparent,
the function was completed and the issue finally solved.
Fixes: PYSIDE-79
Task-number: PYSIDE-68
Task-number: PYSIDE-2201
Change-Id: Ifd6098b1ce43d9bf51350218deb031bbf9ccb97a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This first solution detects the vanishing object and raises
an exception.
Trying to revive the object was unsuccessful. Since this happens
only when no signals are connected, it is ok to leave it this way.
Change-Id: Ib47f85657363b675cec3616b5550ce41d93fb4d3
Fixes: PYSIDE-2201
Pick-to: 6.4
Task-number: PYSIDE-79
Task-number: PYSIDE-68
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Shiboken::Py(Magic)Name needs to be disambiguated from
PySide::Py(Magic)Name as otherwise
using namespace Shiboken;
using namespace PySide;
leads to ambiguities in jumbo builds.
Task-number: PYSIDE-2155
Change-Id: I7ffd1c9325f9c9a83be8ef797aebb096cc15f593
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][PySide6] A `signatures` attribute was added to the Signal
type in order to increase compatibility with other implementations.
Task-number: PYSIDE-1113
Change-Id: I7b97e38feaff5a0db8a82a26f52fb6ecadab08d2
Pick-to: 6.4
Fixes: PYSIDE-1713
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Add the name to the known types for signal/slot signatures,
preventing it from falling through to the PyObject default
converter, which causes reference leaks.
Fixes: PYSIDE-2098
Change-Id: Id95d8a352dd1913bd10578f1ec11de0c533e8f40
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When a wrong argument is passed, the signalTpInit function is
left early, leaving self.data uninitialized in the signal structure.
The function signalFree then crashes.
Task-number: PYSIDE-1603
Change-Id: I97549092198fab206d37643716af3db2d8201cde
Pick-to: 6.3 6.4
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
| |
Task-number: PYSIDE-1603
Change-Id: I90c858ed37bd270188a4ac11419fd2cc066204a0
Pick-to: 6.3 6.4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
b7df2f1c0 "Fix signal initializer.", 18. May 2010 at 00:55
There was a `PySequence_Check` in the evaluation of some signature
function parameter processing, which should have been `PyTuple_Check`.
Since the new PyEnums are also sequences, the new optimization in
Python 3.11 changed the parameter handling in a correct way and
replaced the argument tuple by a direct single argument of an enum
type. And that is also a sequence ...
There are probably still dormant issues like this in the codebase
which gives reason to submit a task that checks all Python interface
functions for correctness.
Change-Id: I45996a0458c3e60795d2eb802eb98f7dd3678d92
Pick-to: 6.3
Task-number: PYSIDE-1735
Task-number: PYSIDE-1987
Fixes: PYSIDE-1988
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
| |
Task-number: PYSIDE-1978
Change-Id: I84118a41df3569329093d7f216f8dc148fe1ba2f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|