aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a separate __str__ function for SignalFriedemann Kleint2023-10-231-2/+16
| | | | | | | | | List all signatures, separated by ';'. Pick-to: 6.6 6.5 Fixes: PYSIDE-2493 Change-Id: I3c7e3367c340ab142a388a3991dc08774b6c7075 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Improve error messages around signal/slot connectionsFriedemann Kleint2023-10-172-5/+7
| | | | | | | Task-number: PYSIDE-2487 Pick-to: 6.6 6.5 Change-Id: I93d2c350aecf1339c6b18496f376d04cdd37dc29 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Implement QMetaMethod::tags() for @SlotFriedemann Kleint2023-10-173-7/+18
| | | | | | | | | | | | | Tags can be used like annotations and are for example used in the DBus module. [ChangeLog][PySide6] An optional parameter "tag" has been added to @Slot, allowing to set QMetaMethod.tag(). Pick-to: 6.6 Fixes: PYSIDE-748 Change-Id: I62bef6179917307471cb72491ac3d05970572f3f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Support running PySide on Python 3.12, cleanupChristian Tismer2023-10-161-1/+1
| | | | | | | | | | | | | | | | | In the course of fixing 3.12 issues, a 3.11 fix for PyEnum was missing that created a 3.11 error. A bug with deployment was fixed but not reflected in the tests. This was only visible for pyenv users. Also fixes a minor cosmetic bug introduced by "Python 3.12: Fix the structure of class property" Task-number: PYSIDE-2230 Change-Id: I3a6bd6426e23168dfccdda17b408f193aacd28a0 Pick-to: 6.2 6.5 6.6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix crash when running a limited API build of 3.9 in 3.12Friedemann Kleint2023-10-132-2/+11
| | | | | | | | | | | | The size of propertyobject as needed as basic size of PyClassProperty_spec needs to be adapted according to runtime version. Otherwise, PyType_FromSpecWithBases fails with: TypeError: tp_basicsize for type 'PySide6.QtCore.PyClassProperty' (56) is too small for base 'property' (64) Pick-to: 6.6 6.5 Task-number: PYSIDE-2230 Change-Id: I03788edbb7031577f37db0fb2eb029b41f37c5f1 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix disconnecting non-decorated slot of base class from signalFriedemann Kleint2023-10-131-1/+2
| | | | | | | | | | | | | | | 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>
* shiboken: Get rid of tp_dict in general, amendedChristian Tismer2023-10-111-3/+3
| | | | | | | | | | | | | | | | | | 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>
* shiboken: Get rid of tp_dict in generalChristian Tismer2023-10-093-20/+29
| | | | | | | | | | | | | | 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>
* Support running PySide on Python 3.12Christian Tismer2023-10-093-9/+12
| | | | | | | | | | | | | | | | | | 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>
* libshiboken/libpyside: Fix special functionsFriedemann Kleint2023-10-067-1/+19
| | | | | | | | Pick-to: 6.6 Task-number: PYSIDE-2479 Change-Id: I6df19d487be7087f17e37bea3ea30a66e9b24ed7 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* libshiboken: Deprecate cast operators of AutoDecRefFriedemann Kleint2023-10-051-2/+3
| | | | | | | | | | | | | | | 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 QPair by std::pairFriedemann Kleint2023-09-292-4/+5
| | | | | | Pick-to: 6.6 6.5 Change-Id: Ic64a2a2c162c54fbbfb6ddc5004ffe1944bfd37a Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Avoid some string conversionsFriedemann Kleint2023-09-272-4/+6
| | | | | | | | | Remove some usages of String::toCString(func_name) and construction of a QByteArray. Pick-to: 6.6 6.5 Change-Id: I9fb29341fba1be205e70d8d5ffc1a6d258ef87dd Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Refactor signal helper extractFunctionArgumentsFromSlot()Friedemann Kleint2023-09-271-78/+68
| | | | | | | | | | | | | 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>
* Improve libpyside debug operatorsFriedemann Kleint2023-09-261-0/+31
| | | | | | | | | | | | Output True/False directly. Also output methods and functions. Amends 74a2ec0202af250828c10dfb10b71036a3af9dd8. Task-number: PYSIDE-229 Pick-to: 6.6 Change-Id: I3625853ec5deef03cb6f94f24e0a2e80d4ac30a7 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Replace typedef by usingFriedemann Kleint2023-09-206-11/+11
| | | | | | | Pick-to: 6.6 6.5 Change-Id: I23d8ea03ec578a897352c2627417a706ca71ef82 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* libshiboken/libpyside: Fix some static analysis warningsFriedemann Kleint2023-09-2010-20/+17
| | | | | | | | | | | | - 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>
* Fix namespacesFriedemann Kleint2023-09-2020-90/+51
| | | | | | | | | | | - 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>
* PySide6: Strictly check the argument names argument to SignalFriedemann Kleint2023-09-053-18/+34
| | | | | | | | | | | | | | | 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>
* libpyside: Refactor passing slot data between @Slot and MetaObjectBuilderFriedemann Kleint2023-09-053-34/+51
| | | | | | | | | | | | | | | The slot data required for MetaObjectBuilder were stored in a PyList set as an attribute on a method. This required concatenating return type and signature, converting the resulting string to CPython in the @Slot code and converting it back to QByteArray in MetaObjectBuilder. To simplify this, introduce a small C++ struct storing the QByteArrays and store a list of them as a PyCapsule (encapsulating a void *ptr) which is used as the attribute value. Task-number: PYSIDE-748 Change-Id: I7f4075f5e828fe543d01e5dfbdc7087905cd004f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Use a static string for the slot attribute attached to methodsFriedemann Kleint2023-08-305-6/+6
| | | | | | Task-number: PYSIDE-748 Change-Id: Ieeeb2c1c392706a5c74bf29ff67ff4ddd8c4feaa Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Add QDebug operators for PyTypeObject/PyObjectFriedemann Kleint2023-08-282-0/+126
| | | | | | | | | | Complement the operators std::ostream in libshiboken which are very verbose, outputting all flags and refcounts, by simple operators for QDebug which basically output a simple type: value. Change-Id: Icf99c55cd64d63eb9d2e47b40fdc6df88e9119e3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix signature of PySide6.QtCore.SignalFriedemann Kleint2023-08-281-1/+1
| | | | | | | Pick-to: 6.5 6.2 Fixes: PYSIDE-2368 Change-Id: I8e52e7d5787795ec336683134c098b37e085aa01 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix connections to base class slots falling back to global receiverFriedemann Kleint2023-08-221-4/+30
| | | | | | | | | | | | 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>
* Brush up code related to pre-Jira bug 1019Friedemann Kleint2023-08-221-2/+5
| | | | | | | | | | 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>
* PySide6: Add a convenience function for retrieving signal emittersFriedemann Kleint2023-07-262-0/+24
| | | | | | Task-number: PYSIDE-2384 Change-Id: I38cd611439a882e65f9f3bc6ca47dedd0a4fc66c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Type hints: change Slot result to Optional[type]Cristián Maureira-Fredes2023-07-141-1/+1
| | | | | | | | | | It was wrongly set to Optional[str] Fixes: PYSIDE-2390 Pick-to: 6.5 Change-Id: Ieb0892fcf69a03263693a867aab0cd998d0133fa Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Adapt to Qt 6.6Friedemann Kleint2023-07-071-0/+4
| | | | | | Change-Id: Ie6379044282809fe73790d03cd086845bee98089 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PyEnum: Get rid of the no longer needed flags typeChristian Tismer2023-07-033-245/+0
| | | | | | | | | | | | | | | | | As a welcome unexpected gift, we now even get rid of the flags class. The builtin Qt flags are still touched when creating properties. This needs an extra registration of the single flag converter name but no extra functions. See testQObjectProperty of qlabel_test.py . [ChangeLog][PySide6] After removal of the old enums, also the complex flags structure could be removed. Change-Id: Ie531a7470330af41eb491e8b1e37939f1afcb9a0 Task-number: PYSIDE-1735 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyEnum: Shortcut old Enum code and generate Python enums directlyChristian Tismer2023-06-303-7/+1
| | | | | | | | | | | | | | | | | 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>
* PySide6/SignalManager: Fix memory leaks connecting free methods/lambdasFriedemann Kleint2023-06-281-0/+19
| | | | | | | | | | | | | | | | | Change 1270a9e82e5bc3bd53a1131698ece60403da1192 changed the deletion of global receivers from listening to QObject::destroyed() (which caused thread issues) to using QPointer<> and purging the lists in notify. What is missing was the deletion of global receivers that are not tied by weak reference to a Python instance. Add a check in notify() to clean out the empty global receivers. Pick-to: 6.5 Fixes: PYSIDE-2371 Fixes: PYSIDE-2299 Task-number: PYSIDE-2141 Change-Id: I39dca2a21088930c9a7f8e5eb7e948b3fff49b4b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* PySide6: Add debug operators for DynamicSlotDataV2/GlobalReceiverV2Friedemann Kleint2023-06-272-0/+60
| | | | | | | | Task-number: PYSIDE-2371 Task-number: PYSIDE-2299 Pick-to: 6.5 Change-Id: I1d3edf539e156a3a64f9e4b4499bc967b0da2ade Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Enum: Enable toInt for QVariant(PyEnum/SbkEnum)Shyamnath Premnadh2023-06-132-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | - For Python/Shiboken types not known to Qt that requires wrapping around a QVariant, we use the PyObjectWrapper type. This patch registers a toInt() QMetaType converter for PyObjectWrapper, which enables automatic conversion to int for a QVariant(PyObjectWrapper) within C++ i.e. QVariant(PyObjectWrapper).toInt() will work - This means that cases like QAbstractItemModel::data() that calls QtPrivate::legacyEnumValueFromModelData(const QVariant &data) would work without explicit conversion from QVariant(PyObjectWrapper) to QVariant(int). But for cases like QMetaProperty::write() explcit handling is still required. - This would also work for cases where the QVariant(PyObjectWrapper) is simply channeled from Python to C++, and from C++ back to Python without performing any operations on it. - Incase, the wrapped object is not a PyEnum/ShibokenEnum object, then toInt() would return a -1. Pick-to: 6.5 Task-number: PYSIDE-1930 Task-number: PYSIDE-2339 Change-Id: I983351f2ff88c79c29399c257e38421116efc7a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Implement raising of unraisable exceptions correctlyChristian Tismer2023-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | TODO in another check-in: Control exec/run by an XML attribute [ChangeLog][PySide6] Unraisable exceptions are now handled by a handler on the stack or printed if impossible. Unraisable exceptions are stored in an error store if there is an error handler on the call stack that can handle it, otherwise it is printed immediately. We record the existence of an error handler in thread local storage, which solves thread problems automatically. Since exec and run functions completely block all handlers, we need to mark them as a special case. The overhead is minimal and uses constant memory per thread. Task-number: PYSIDE-2310 Task-number: PYSIDE-2321 Change-Id: Ic25a2ff8552baf6e132ad86a4ad0925375e7ea88 Fixes: PYSIDE-2335 Pick-to: 6.5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Revert anonymous slot memory leak fixAdrian Herrmann2023-06-021-10/+1
| | | | | | | | | | | | | | | The fix to PYSIDE-2299 unfortunately introduces regressions that are more serious than the memory leak caused by an edge case that was originally supposed to be fixed. A different approach will be needed to fix the memory leak, in the meantime, revert the change. The corresponding unit test remains blacklisted, as it will apply to a future fix. Pick-to: 6.5 Fixes: PYSIDE-2346 Task-number: PYSIDE-2299 Change-Id: I1dcddb03f731a333f6acf7c9df79b9dba42bec21 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Leak fix: special consideration for functools.partialShyamnath Premnadh2023-05-251-0/+5
| | | | | | | | | | | - Amends 5b39b316e3c9e40cdc0784538b8d5f290e41d67b until proper fix is deviced. Task-number: PYSIDE-2299 Change-Id: Ia4ace136cb44d092691fdfd030de1889f1d3c671 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit cc2054bc13ac91da50e3e796e107f12883176314) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crash when mixing other decorators with @SlotFriedemann Kleint2023-05-231-0/+2
| | | | | | | Pick-to: 6.5 Task-number: PYSIDE-2338 Change-Id: Iab13d0550f59a14006e0d650270ac87a6e7fe3b3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Fix connecting signals with arguments by constructor kwargsFriedemann Kleint2023-05-221-5/+22
| | | | | | | | | | | | The search was only implemented for signals without arguments by appending "()" to the signal name to form the search signature. Implement a search by signal name only. Fixes: PYSIDE-2329 Pick-to: 6.5 Change-Id: I295150cdebe60c886891553c9f31d14011a004d6 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Shiboken: Undo the unraisable exception delay for nowChristian Tismer2023-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | The delayed exception looked good in the first place. PYSIDE-2310 and PSIDE-2321 showed some special cases where the delayed error reporting fails to notify about an error, to be in time (2321) or all-together (2310). This is no complete reversal of the thing. We need to improve the theory to cover all cases and do a better implementation. This temporary reversal removes the pressure from us to get the feature perfect before the 6.5.1 release. Change-Id: Idf25ca31571a45c59082d27e4d736a4932ab9f8c Fixes: PYSIDE-2310 Fixes: PYSIDE-2321 Pick-to: 6.5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Prevent crash when connecting to temporary signal sourcesFriedemann Kleint2023-05-171-0/+5
| | | | | | | | | 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>
* Fix leak connecting signals to anonymous functionsAdrian Herrmann2023-05-111-1/+5
| | | | | | | | | | | | | | | | | When connecting a signal to the same anonymous function repeatedly, a new GlobalReceiverV2 object would be created after each call. Each GlobalReceiverV2 would have a unique callback object despite all these callback objects sharing the same code. This would lead to a large number of GlobalReceiverV2 and callback objects, each never reaching a refcount of 0 and thus never being released. The remedy is that we only need one GlobalReceiverV2 object, whose corresponding GlobalReceiverKey references not the outer callback object, but the code object associated with it. Pick-to: 6.5 Fixes: PYSIDE-2299 Change-Id: I474284dc5ce08dc6601636f2e7ac5e5a10ed8560 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Numpy support: Handle short/long/long long integer typesFriedemann Kleint2023-05-051-0/+16
| | | | | | | | | | | | | | | The default type of numpy is int64 on Linux and long in Windows these days. As numpy is still based on the old long/long long scheme for the types, add some mapping. [ChangeLog][shiboken6] numpy support has been extended to handle short/long long integer types. Fixes: PYSIDE-2313 Pick-to: 6.5 Change-Id: I75d9277ae0867401c2c188efb3a50f4c53c4fc24 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Implement multiple inheritance correctly, compatible versionChristian Tismer2023-03-212-2/+8
| | | | | | | | | | | | | | | | PySide does not implement multiple inheritance. Please see "About Multiple Inheritance in Python" at the issue. This patch just supports the `__init__` call. A more consequent implementation will follow that supports multiple inheritance with every method. [ChangeLog][pyside6] Cooperative multiple inheritance is now implemented for all __init__ methods. Fixes: PYSIDE-1564 Change-Id: I8df805d22c2052c3a9747420a86341f64e29a5ad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix exit crash related to QObject::thread()Friedemann Kleint2023-03-101-0/+5
| | | | | | | | | | In the deletion handler registered by getWrapperForQObject(), add a check whether Python is still initialized. Fixes: PYSIDE-2254 Pick-to: 6.4 Change-Id: I20d221b57fc9d0aaa7ef4067a79fb0c3bb4ef844 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* SignalInstance: Fix more very old errors due to unlucky exposureChristian Tismer2023-03-091-1/+14
| | | | | | | | | | | | | | | | | | | | | 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>
* SignalInstance: Fix another very old bugChristian Tismer2023-03-071-7/+8
| | | | | | | | | | | 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>
* CMakeLists.txt: Add header filesFriedemann Kleint2023-03-011-36/+37
| | | | | | | | | Hoping this will help the Qt Creator code completion. Change-Id: I0777f5c38e37d560cfc1942b8acd5c76c8d64d25 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* property: fix an old refcount bug, concluding debug errorsChristian Tismer2023-02-201-4/+11
| | | | | | | | | | | | | | | | There was a refcounting bug in pysideproperty.cpp that took some time to be understood. By using Property.__init__ multiple times, an omission became manifest: Not clearing a Property instance's attribute before generates a leak. This was the last unsolved reference bug in debug mode :-) Change-Id: Ie91fa9e56ef52ca555168841c99c14fd550202ed Fixes: PYSIDE-1402 Pick-to: 6.4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Python 3.12: Fix the structure of class propertyChristian Tismer2023-02-171-1/+6
| | | | | | | | | | | | | | | | There is a PySide bug in Python 3.10 already: The structure for classproperty derives from the property structure. This was extended in Python 3.10, already, but the type generation check was made more exhaustive in Python 3.12 and recognized that. This change is only for making the compiler/C API happy. In order to use the extension field, it is necessary to do a runtime check because of the Limited API. Task-number: PYSIDE-2230 Change-Id: I88dcaa11589ff41852f08fa2defa5200a0dd4eb6 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add license headers to cmake filesFriedemann Kleint2023-02-161-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Task-number: QTBUG-105718 Task-number: QTBUG-88621 Change-Id: I98bd2e80f182d8bf7aef6b633f37a428e2dac69b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Kai Köhne <kai.koehne@qt.io>