| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Iron out some issues in the code:
- The old code created a fast list from the list passed
in but then did not use the fast API (PySequence_Fast_GET_ITEM(), etc)
since it does not work with the limited API. Remove it.
- For empty lists, an empty QStringList was returned since
the helper isStringList() returned true. Change
it to return an empty QVariantList.
- Add a new function pyListToVariantList() which converts each
item using the QVariant converter for use by QGenericItemModel
Change-Id: If0b5cdf4055f8d586df56a8c98bc042f4bab6427
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old code registered a Shiboken converter for PyObjectWrapper by
pointer conversion. This resulted in the Python to C++ converter
falling back to plain pointer passthrough since it only works for
SbkObjects.
The C++ to Python conversion worked by coincidence for either raw
PyObject * pointers used in meta call handling or pointers obtained
from calling QVariant<PyObjectWrapper>.data(), but without handling
reference counts.
To fix this, remove the Python to C++ conversion entirely and do this
manually via QVariant. Change the C++ to Python to be by value and use
PyObjectWrapper.
Fixes: PYSIDE-2193
Pick-to: 6.9
Change-Id: I00898894651f220d7b8fe60608e93233ef3e6493
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
| |
This useful for debugging QML issues.
Task-number: PYSIDE-2193
Pick-to: 6.9
Change-Id: Iecbfb1d9508ac89c8b213a2f2ee8d4f7f1de4fc8
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
| |
This is required by today's QVariant conversion code.
Task-number: PYSIDE-2193
Pick-to: 6.9
Change-Id: I66efcfb797653fe1d617f1f0027fd60ec95e8a79
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
| |
Task-number: PYSIDE-2916
Change-Id: I4e4619b5144451512be3eadc6810df3f3f47ada0
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Guard the deletion tracker listening on QObject::destroyed() using GIL.
Amends 33bd61d13d8d9e3794b6049891be62f3351313d9.
Fixes: PYSIDE-3072
Task-number: PYSIDE-2810
Task-number: PYSIDE-2221
Pick-to: 6.9 6.8
Change-Id: Ia085fa551903dd39c7a9624f6995d8720e9f7fb0
Reviewed-by: Ece Cinucen <ece.cinucen@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
| |
Py_GetProgramFullPath is deprecated from 3.13 and the recommendation
is to use PySys_GetObject("executable") instead.
Pick-to: 6.9
Change-Id: Ia0b0424d6fe593343272d862b05727579fad2a86
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
| |
Task-number: PYSIDE-3012
Pick-to: 6.8 6.9
Change-Id: I720dd730f6dd28ae33a6019494b7b67b8f704a10
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@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>
|
|
|
|
|
|
|
|
|
| |
- This enables the class to be used in libpysideqml to support
the `AutoQmlBridge` function.
Task-number: QTBUG-134668
Change-Id: I9c639c76ce23117dc259a811a7c4257fc79179a7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
The old implementation was calling the string-based overload, but did
not add the '1'/'2' markers added by SIGNAL/SLOT. Call the QObject
overload directly.
Fixes: PYSIDE-1277
Pick-to: 6.8
Change-Id: I912f46c33959b622301b0a75e771057c8874f7e3
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Import Callable, Iterable and Sequence from collections.abc,
since using them from typing is deprecated.
Pick-to: 6.8
Task-number: PYSIDE-3012
Change-Id: I131c00005df410fdaa40b338a2a728512269aaa0
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
The restricting type annotation for call function in Slot class is updated to more flexible one.
Pick-to: 6.8
Task-number: PYSIDE-2846
Change-Id: Ic26ebb42bb6bfe4f4d0455125ac92b3552c62d06
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Amends cab304e70cce68bbdaa70d7f7b2bf6e95e85e6d2.
Restructure the test.
Pick-to: 6.8
Fixes: PYSIDE-3020
Task-number: PYSIDE-1057
Change-Id: I8954a534648ded5d476fec608d0699132a026461
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
Add a further indirection in callPythonMetaMethodHelper()
when only a pointer conversion is available for a const-ref parameter.
Task-number: PYSIDE-3004
Change-Id: I6ec7c5a9d4d30c8e4973ec79534d5f3eb3bf8204
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>
|
|
|
|
|
|
|
|
|
|
| |
In preparation for a change that might remove the automatic finding of
private modules.
Task-number: PYSIDE-2862
Task-number: QTBUG-87776
Change-Id: I22f872d341b20a3f39aa722ee83c2a7993661710
Reviewed-by: Alexandru Croitor <alexandru.croitor@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>
|
|
|
|
|
|
| |
Pick-to: 6.8
Change-Id: I1a5964463f703ade0657816cb974206355a5ae5b
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
accessibility
The test installs a global event filter on QApplication which then
receives events from DBUS classes doing accessibility. Then apparently
something moves the DBUS receivers to different threads which causes
hangs later on when PySide tries to release the wrapper. Fix by
checking the presence of a wrapper first before releasing (empirical).
Pick-to: 6.8
Change-Id: I91480461afb19c8fc1fa7a329f63243c0dacb22c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
PyCFunction_GET_FLAGS
Removing old compatibility macros from the initial limited api
implementation.
Change-Id: I3044609ade36b5b378de05934eab8a098450f42f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
| |
It is useful for leak checking.
Pick-to: 6.8
Change-Id: Ida19cb863e8232e26c86fa82a64d0d3f741b4646
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
Remove old macros usages for the Limited API compatibility,
and doing some refactorings to their usages.
Change-Id: I10d675a1831d26b3fc878151e3a6ec40c5caddb1
Pick-to: 6.8
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PySequence_Fast_GET_ITEM is defined as:
(PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i))
and when using the Limited API we re-define the _GET_ITEM macro
to be the _GetItem function, and considering this is our standard
use case, the macro could be replaced directly by the function.
However, the function returns a new reference, so we need to manually
drecrease a reference after the usage, to avoid reference counting
issues.
Change-Id: If361e80b9e40b033e009ad46b2b9430e5b4c8eaa
Pick-to: 6.8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extract the error handling code which existed duplicated in
GlobalReceiverV2::qt_metacall() and
SignalManagerPrivate::handleMetaCallError() as a static helper of
SignalManager and call that from the DynamicSlot functions.
Amends 33bd61d13d8d9e3794b6049891be62f3351313d9.
Pick-to: 6.8 6.8.0
Task-number: PYSIDE-2810
Fixes: PYSIDE-2900
Change-Id: Ife9f156e6752dde7002218d36d369ba68ad595b0
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
| |
All callables have now arguments.
Task-number: PYSIDE-2846
Fixes: PYSIDE-2884
Change-Id: Ibf6b1d93350304550addbc459c1440bd5cefc057
Pick-to: 6.8
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
PyArg_ParseTupleAndKeywords() can return Py_None for invalid
types in the property decorator, for which getTypeName()
returns "void". Set an error in this case.
Pick-to: 6.8
Task-number: PYSIDE-2840
Change-Id: I98a497df445d9b543dddaa495d85042e00673e78
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Callables wrapping C-function and their objects (as returned by
"qobject.deleteLater()") may be temporary objects like methods.
For the connection cache key, use self and the actual C-function
as so that a disconnect succeeds.
This did not show in the old design since the disconnect code
did expensive checks to retrieve the slot index of the function
and used the index code path.
Amends 33bd61d13d8d9e3794b6049891be62f3351313d9.
Pick-to: 6.8
Task-number: PYSIDE-2810
Task-number: PYSIDE-2221
Change-Id: Ic33af0d5da60589df16ca35c17824da592910a4d
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
| |
Add a helper function checking on a weak reference.
Task-number: PYSIDE-2751
Change-Id: I4f2d505636a24df083b0d2f4d3d312fcc44d125e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a QMetaMethod
The code previously used a instances of class GlobalReceiverV2 inheriting QObject in a hash in
SignalManager per slot tracking the list of senders to be able to use standard signal/slot
connections in Qt. This was a complicated data structure and had issues with cleanups.
This has been replaced by using an invoker object based on QtPrivate::QSlotObjectBase which
can be passed to
QObjectPrivate::connect(const QObject *, int signal, QtPrivate::QSlotObjectBase *, ...).
The connections (identified by ConnectionKey) are now stored in a hash with QMetaObject::Connection
as value, which can be used to disconnect using QObject::disconnect(QMetaObject::Connection).
Deletion tracking is done by using signal QObject::destroyed(QObject*) which requires
adapting some tests checking on the connection count and weak ref notification on receivers
as was the case before.
[ChangeLog][PySide6] Signal connections for Python callables not targeting a QMetaMethod
has be reimplemented to simplify code and prepare for removal of the GIL.
Task-number: PYSIDE-2810
Task-number: PYSIDE-2221
Change-Id: Ib55e73d4d7bfe6d7a8b7adc3ce3734eac5789bea
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Complements 225e18558f37e2b228be5da60f27ec8186a26bc7.
Just like QObject::connectNotify(), QObject.disconnectNotify() is
meant to be called with the signal method. Fix it to use the signal
instead of the slot.
Task-number: PYSIDE-2810
Change-Id: I2b1903a2c870768760e24b903ef16499d8d5d1a5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
| |
Python 3.9 is now the minimum version.
Change-Id: I7d519cf4b73516ee0d659e377805e2b6f96402d2
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
| |
Task-number: PYSIDE-2810
Change-Id: I51bd24520cc9fd420ee8256f1278bb17cd406235
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DynamicSlotDataV2 provided the callable for the slot invocation and
contained switches depending on whether the callable was a method or a
plain callable.
Turn it into a virtual base class providing a call()
method and a factory to cleanly separate the code paths for method and
plain callables. Introduce an enumeration of slot types for clarity.
Expose it in globalreceiverv2.h so that it can be used
for PySideQSlotObject.
Task-number: PYSIDE-2810
Change-Id: I4bdfb58a430c39aba2cc531c28129f71ebeb498c
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
This connection type always uses callables directly, no need to
create GlobalReceiver instances by calling getReceiver().
Amends acab25a3ccb836818e5089b23d40196bc7414b7a.
Change-Id: I3fbcaaa0495b455741a0d825f68ce6d98d2ce3aa
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the signatures hash from DynamicSlotDataV2 into GlobalReceiverV2
to avoid unnecessary indirections and to enable further refactorings
of DynamicSlotDataV2.
Use QByteArray for the signature parameters, avoiding the conversion.
Task-number: PYSIDE-2810
Change-Id: I17a637e28e9dac4ea159b26a375e8c1535e00814
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the MetaObjectBuilder::addSlot()/addSignal() functions to use a
QByteArray since the underlying QMetaObjectBuilder takes QByteArray,
too.
Split SignalManager::registerMetaMethodGetIndex()
into overloads for const char * (for the signal code path)
and QByteArray (for the slot code path).
Task-number: PYSIDE-2810
Change-Id: Ie79ea071a8cc111d45248c7086cf6fda34a7548f
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
| |
Task-number: PYSIDE-2810
Change-Id: I54601a5a3f1f7cd648e5e382850ee10fbe240dac
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
| |
Extract a helper function from QTimer::singleShot()
implementation and use that to implement it.
Fixes: PYSIDE-2805
Change-Id: Ib758d355b36c598052cfa495b53d7da423999976
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Set a hook calling QCoreApplication::processEvents() unless a key is
pressed to PyOS_InputHook.
Fixes: PYSIDE-2192
Pick-to: 6.7
Change-Id: Ibaa16fb7e605c21c67b74609de3264ef5e4fc523
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|