| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
| |
Use the new SignalManager::callPythonMetaMethod() overload
introduced by ed8fc457e04f4ead8a3b2a2da797bdc14bd5b210 in
PySideQSlotObject to convert the void ** arguments to Python.
Amends acab25a3ccb836818e5089b23d40196bc7414b7a.
Change-Id: I024bc7f8df7fa65b8b1761f517a99a854de2cec8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
QObject::connectNotify() is meant to be called with the signal method.
The code retrieved the signal method from the receiver though,
potentially causing an index violation. Fix it to use the source.
Remove misleading comments from
4edd9a1278efdf37f366e9aa6e82f151a357ef32.
Change-Id: Id5afdde16ce002e156710128e9610804b748be74
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@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>
|
| |
|
|
|
|
|
|
|
|
|
| |
On C++, there is an overload of QObject::connect() that allows passing a
context object. This creates a connection in the context object's event
loop instead of that of the caller. This implements said overload in
Python.
Pick-to: 6.6
Change-Id: Ia6a098a04470741efd450818c31aa5bffb1bd9f8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@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>
|
| |
|
|
|
|
|
|
|
| |
Do the connect/disconnect within allow-threads.
Fixes: PYSIDE-2367
Pick-to: 6.6 6.5
Change-Id: I95c908d438a4a6c9cd0a23d3fce31a53e02ea19d
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Further tighten the check for non-virtual slots overwritten in Python
by checking that the QMetaObject actually returns a different
declaring class. This works around the underlying issue that the logic
automatically creating meta methods for non-decorated slots wrongly
adds the entry to the derived class.
Amends f048d13b4f042b04d94007fba951ed3080ccf8c9.
Task-number: PYSIDE-2418
Fixes: PYSIDE-2487
Pick-to: 6.6 6.5
Change-Id: I0c62cfd9fd6dcb2ddf6bcfd1db14aa274293b34f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Narrow the test condition for pre-Jira bug 1019 to check whether the
receiver method is not declared in the same class in which the slot
returned by the MetaObject search is declared.
Fixes: PYSIDE-2418
Pick-to: 6.5
Change-Id: I01591a4e948daa19caf75eaa8f803acb17b66550
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Add explanatory comments; fix up the debug operator of
GetReceiverResult.
Task-number: PYSIDE-2418
Pick-to: 6.5
Change-Id: I77b9ad2d38a5bba1b78ffaf8835f20fbb93636d0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
| |
Pick-to: 6.5
Task-number: PYSIDE-2338
Change-Id: Iab13d0550f59a14006e0d650270ac87a6e7fe3b3
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For non-C++ slots routed via GlobalReceiverV2, sender()
of the receiving QObject returns 0. To fix this, store
the sender obtained in GlobalReceiverV2::qt_metacall()
temporarily in a special dynamic property of the receiver
and inject code checking it into QObject::sender(). This
fixes at least the synchronous calls.
Fixes: PYSIDE-2144
Fixes: PYSIDE-1295
Change-Id: Ia111162eb1404914ecfb7f19fadb8a1b63ae8b4a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Replace the current license disclaimer in files by a
SPDX-License-Identifier. Files that have to be modified by hand are
modified. License files are organized under LICENSES directory.
Task-number: QTBUG-67283
Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using this new type, two more errors concerning callbacks
could be resolved:
signals::qobject_receivers_test
QtWidgets::bug_860
[ChangeLog][PySide6] The new PyPy "builtin method" is
now handled correctly in callback functions.
Task-number: PYSIDE-1843
Task-number: PYSIDE-535
Change-Id: I0f24cf6d7c0352b853f663ffcaf899d3eb77c7e8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
It appears to be a general use helper function which could be useful
outside signalmanager as well.
Amends 56f66f128566bd08f027fee46bb42a6c4f57a26e.
Task-number: PYSIDE-1755
Change-Id: I449243bb5d800ba4d271b3079ad394810d468312
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds an extra check to see if __code__ is present.
As mentioned in PYSIDE-1755, Mocks are callable objects without __code__
attribute, unlike Python Method or Functions. However, a Mock also has
im_func__ and im__self attributes. We made the assumption __code__
would be present if im_func and im_self are present, and this makes it
fall under the category of a compiled method.
This patch makes an extra check to see if __code__ is present. If it is
not, then the Slot (here Mock) is considered as a callable method.
Task-number: PYSIDE-1755
Pick-to: 6.2
Change-Id: If7e8f52dfb2409cd856eec0d0b41891d751d8a69
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changing something in pyside.h caused excessive recompiling
of all wrappers. Try to amend the situation by splitting up
the header and include only what is needed.
pyside.h remains as a header including the others which will be
emptied out by further changes splitting out QML functionality.
[ChangeLog][PySide6] The header pyside.h has been split into
smaller headers.
Task-number: PYSIDE-1709
Change-Id: I89ff3d9d9bc486f194ad3ec62ed372ff0be960f2
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
The rather large functions should not be in code snippets. Move them
into libpyside and rearrange and streamline them a bit, fixing some
potential null pointer crashes as pointed out by clang checking.
Change-Id: I5be6468577f2a107a286775c7e8b5874531c30fe
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|