| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
Extract a helper for calling Python slots and add an overload
that only takes a list of parameter types and return type.
Change-Id: I407c3b1ae66eb4f01370ceac3112eb9407796efa
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>
|
| |
|
|
|
|
| |
Pick-to: 6.7
Change-Id: I3b460f270965706a1b8ed04ef6f51d540db3ba72
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
| |
Pick-to: 6.7
Change-Id: I0731c9c02de928dcdf268f5fc773148363b9a8fe
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>
|
| |
|
|
|
|
|
|
|
| |
Add the __call__ operator.
Fixes: PYSIDE-2767
Pick-to: 6.7 6.5
Change-Id: Ic73df2918fb8effaceeddbcb2c92f7ac7eb861c5
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lazy loading introduced a performance regression for applications
using for example an event filter on QApplication, where all internal
QObject-derived types from QML occur. This triggered the lazy loading
mechanism for each of those classes that have no binding.
To fix this, introduce checks to typeName(const QObject *)
that skip the internal classes by checking for presence of a
dynamic meta object and internal type names.
This should also help skipping over QObject-derived classes written
in Python which also have a dynamic meta object.
Fixes: PYSIDE-2749
Task-number: PYSIDE-2404
Pick-to: 6.7
Change-Id: I029d104e59820fbf3dab52a3ac65b45d97b3c2e7
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
LoadLazyClassesWithName() is already called from getConverter().
Task-number: PYSIDE-2404
Task-number: PYSIDE-2749
Pick-to: 6.7
Change-Id: Ib3dc98e92eadbdebe247b1ae18d4e737c98b1501
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the bool exactType parameter from the existing
newObject() by splitting it into 3 functions:
newObjectForType() creates an instance for the type passed in.
newObjectWithHeuristics() takes an additional typeName
parameter obtained from typeid().name() on the C++ pointer which
may contain the derived class name and also tries to find
the most derived class using the type discovery graph.
newObjectForPointer() is new and contains a test for multiple
inheritance in the inheritance tree (disabling use of the most derived
class) which was previously generated into the code.
Change-Id: Ic0a25f8ec17dc20364b37062de6f20544cd2f09e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Partially revert 4d761eaaf852f8d82925e111150f25c0dd5f3e83.
Adapt to qtmultimedia/7fcea568c9c64f3bcebda21f0df02aa0107dfd0c,
reverting qtmultimedia/edaec2bf714c98d65f12c8ed9a2ffbd1603635a7.
Task-number: QTBUG-123997
Pick-to: 6.7
Change-Id: Ibd0ad737293f4b9107909f37554c03f64bce5d1e
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Restore a notification on a sender's QObject::destroy() signal for
main thread objects. Instead of triggering instant deletion as was
done before (causing issues with recursion and threads), start an idle
timer to call the Signal manager cleanup.
Amends 1270a9e82e5bc3bd53a1131698ece60403da1192.
Pick-to: 6.7
Task-number: PYSIDE-2646
Task-number: PYSIDE-2141
Change-Id: Ifdc28f729cab64d58ac2ab300daece98b167d915
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Use PyLong_AsUnsignedLongLong if an overflow occurs. Use hex
for those large values.
Task-number: PYSIDE-2652
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I9c3404cf8b01b1fcda20516c1105797fc512ed53
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Run a signal handler cleanup in CoreApplication::aboutToQuit() already
before the general cleanup. This prevents them from leaking out of a
main() function, for example.
Task-number: PYSIDE-2646
Pick-to: 6.7 6.6 6.5
Change-Id: I87cce8d131c40c02b44b0102b3774477676b8f89
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
Amends 1270a9e82e5bc3bd53a1131698ece60403da1192.
Task-number: PYSIDE-2646
Task-number: PYSIDE-2141
Pick-to: 6.7 6.6 6.5
Change-Id: Ib8a5146766166ec4fa7ae7b42ce6d52ccae0b3c6
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
| |
Task-number: PYSIDE-2628
Change-Id: I34646f76f509ec30e3d63fc8df296d2b5692ff0e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lazy init is done by module entries which are delayed.
Although visible in the module, the classes are only created
when actually accessed by getattr.
Internally, the access to the global Init_xxx functions is
redirected to a Shiboken::Module::get function which resolves
the classes if not already present in the global type array.
PYSIDE6_OPTION_LAZY
0 - no lazy loading
1 - lazy load all known modules
2 - lazy load all modules
Task-number: PYSIDE-2404
Change-Id: I98c01856e293732c166662050d0fbc6f6ec9082b
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Refactor and streamline the code a bit.
Pick-to: 6.6
Task-number: PYSIDE-2633
Change-Id: I433b136ac036a9a297d2c22ad8dfa6af45ad46b0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add an implementation for a QIODevice that can be used to work with
anonymous pipes. It needs to be able to emit the bytesWritten and
readyRead signals. This implementation is lifted from the qt5 source
tree (qtdeclarative/tests/auto/qmlls/lifecycle) and might be added to
Qt in the future, at which point it will be removed from the PySide
source tree.
Change-Id: Iff1208a366dad747352e7507da0818934c26aa4f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When lazy initialization is used, unexpected situations are
coming up. The feature switching may call into signature init
without knowledge that feature dicts are already switched.
Fix this by
- disabling feature switching during lazy init of a class
- allow this disabling from PySide and Shiboken
- Create a way to find the unchanged type dict of features
UPDATE: Switching speed is now as high as before.
This check-in was extracted after the fact, although it claims
to exist beforehand which would have been better. This was
quite a painful experience.
Change-Id: I6639b7a3c22d21d3b9dd0627e2880a7b7a03d134
Task-number: PYSIDE-1019
Task-number: PYSIDE-2404
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
|
|
| |
Task-number: QTBUG-103757
Task-number: PYSIDE-2497
Change-Id: I1b0fd5b1cad908ee612ab33ca0aacffc55947d87
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|