aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/pyside.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PEP 697: Introduce the SbkObjectType_Check functionChristian Tismer2023-10-251-0/+2
| | | | | | | | | | | | | | | By Python 3.12, there is now an official way to extend heap types by custom extra data. In order to make that most effective, we can no longer accept every type in PepType_SOTP, but keep the types carefully apart. This is done with SbkObjectType_Check, which is very rarely necessary. Change-Id: I9cc4b594f2f676712ba92bf7733c4321b717f252 Pick-to: 6.6 Task-number: PYSIDE-2230 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Avoid some string conversionsFriedemann Kleint2023-09-271-2/+3
| | | | | | | | | 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>
* 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-201-1/+1
| | | | | | | 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-201-1/+1
| | | | | | | | | | | | - 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>
* libpyside: Add QDebug operators for PyTypeObject/PyObjectFriedemann Kleint2023-08-281-0/+107
| | | | | | | | | | 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>
* 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>
* Implement multiple inheritance correctly, compatible versionChristian Tismer2023-03-211-1/+6
| | | | | | | | | | | | | | | | 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>
* Fix '&&' within '||' warningsAdrian Herrmann2023-02-151-2/+2
| | | | | | | | Placing parentheses around the '&&' expression silences this warning. Pick-to: 6.4 Change-Id: Ic7884834de1fd3e38b7477d3946b8757d40e27ba Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix broken Qt prefix for conda installsAdrian Herrmann2023-02-141-1/+9
| | | | | | | | | | | | If PySide6 is installed through Anaconda, it will conflict with Anaconda's own Qt package, which is based on Qt 5, creating a version mismatch. To work around this, if PySide runs in a conda env, register an internal qt.conf setting the prefix value to the corresponding path in site-packages. Pick-to: 6.4 Change-Id: I5639d7eeaf524a8a4aa533dc5a83bdb0c74cbd9f Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Remove function `getMetaDataFromQObject`Friedemann Kleint2023-02-131-6/+0
| | | | | | | | | Complements e20e29d1bd03f6ff9e57037d0a7f35bb59604f4. Task-number: PYSIDE-1889 Task-number: PYSIDE-1019 Change-Id: Iddf0cdfebf23f3f305e73e3de7e80c5582efc44d Reviewed-by: Christian Tismer <tismer@stackless.com>
* pyside.cpp: Light refactoringAdrian Herrmann2023-02-101-14/+15
| | | | | | | | Just some light refactoring, cleanup, whitespace fixes etc. Pick-to: 6.4 Change-Id: Ia37195d20b1925fbe25449a022a4965c64a17b01 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* signal: Finally clean up all leaks after complete understandingChristian Tismer2023-02-071-9/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* Fix encoding of prefix path in embedded :/qt/etc/qt.conf resourceFriedemann Kleint2023-01-251-7/+1
| | | | | | | | | | | | | | QString-type entries of QSettings are UTF-8 in Qt 6; do not use toLocal8Bit(), which uses the code page on Windows. Amends 4134ffd908144a5cf7c84333d2b2726c86ac8762. Pick-to: 6.4 6.2 Fixes: PYSIDE-2204 Task-number: PYSIDE-972 Change-Id: Id59019caa1e01a90bd8836db63c50e3b582c3ecf Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide6: Port from QSharedPointer to std::shared_ptrFriedemann Kleint2023-01-041-4/+5
| | | | | | Task-number: QTBUG-109570 Change-Id: Ieb13bf352d9b75e364a73bddc464548ec19701ed Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Rename the static stringsFriedemann Kleint2022-12-161-6/+6
| | | | | | | | | | | | 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>
* __feature__: Fix a weird case of false metafunction lookupChristian Tismer2022-12-131-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | PySide implements duck-punching since 2010. This could create a problem with true_property since 06/2019, because a meta-function could be found in the instance dict of a QObject class, although the methods were replaced by a property object. This was an unexpected reaction of the `getMetaDataFromQObject` function. Meta methods were created and inserted into the instance dict, which caused very unrelated side effects like infinite recursion. The new implementation handles Python properties correctly and looks up the hidden methods if necessary without side effects. There are no longer meta functions involved. The function `getMetaDataFromQObject` is misleading and was replaced by `getHiddenDataFromQObject`, keeping the old name as an alias. It will be finally removed in version 6.5 . [ChangeLog][PySide6] A callback error when using true_property was fixed. Change-Id: Ie5234eab2106885f6edad24ae7d4c55fff43d62f Fixes: PYSIDE-1889 Pick-to: 6.4 Task-number: PYSIDE-1019 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* __feature__: Remove the no longer efficient reserved_bits structureChristian Tismer2022-11-291-3/+4
| | | | | | | | | | | | | | | The reserved_bits structure is no longer an optimization after moving to PyPy. Accessing any extra field involves always a dict lookup. - remove the reserved_bits field - re-order SbkObjectTypePrivate - replace access functions by currentSelectId() Task-number: PSYIDE-2029 Change-Id: I08642eace9a6399649c039bcc358ce678bbd4fd3 Pick-to: 6.4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* __feature__: Cleanup and optimize before changing true_propertyChristian Tismer2022-11-231-15/+15
| | | | | | | | | | Casing and naming was adjusted, minor correction, replaced QString(List)? with QByteArray(List)?. Change-Id: I0dae86fbd8dd27d5460ecb7f44f81134c69acb5d Pick-to: 6.4 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Port some loop variables to qsizetypeFriedemann Kleint2022-10-131-1/+1
| | | | | | | | Where possible, used range-based for. Otherwise, use qsizetype for loop variables. Change-Id: I4773bee8468ce73722656ec73845369b7d40d4cd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add a logging category to libpysideFriedemann Kleint2022-08-261-0/+3
| | | | | | | | | | | | | | | | | | It provides: - Debug output for Qt meta calls (useful for debugging QML applications). - Warnings, for example about dynamic slot registration caused by missing decorators. It can be enabled for example by export QT_LOGGING_RULES="qt.pyside.libpyside.warning=true". [ChangeLog][PySide6] A logging category "qt.pyside.libpyside" with warnings has been added to libpyside. Task-number: PYSIDE-2033 Change-Id: Ie972b85b8e92d2f3e2cf00efbc1047a178d95241 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Shiboken: Optimize attribute access a bit moreChristian Tismer2022-06-201-2/+2
| | | | | | | | | | | Some leftover attributes can be turned into statics, too. The StaticMetaObject needs to be moved into Shiboken in preparation of the following enum checkin. Task-number: PYSIDE-1735 Change-Id: I2172bd785ae229ea5637588c53be660477fc2f0e Pick-to: 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-271-38/+2
| | | | | | | | | | | 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>
* Move numpyview from libpyside into libshibokenFriedemann Kleint2022-05-131-2/+0
| | | | | | | | | | libpyside then no longer depends on numpy. There is only one place left where numpy is initialized, allowing for dynamic loading. Task-number: PYSIDE-1924 Change-Id: I50d02814f8cc6eb85d8cdb5330cfff3b586656ad Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Fix qMetaTypeFromPyType() for wrapped typesFriedemann Kleint2022-05-091-1/+1
| | | | | | | | | | | | Replace the type check by Shiboken::ObjectType::checkType(pyType) since it is inherited. Amends 6e26532b6b8430ba4d8a56aebeea5adf73501faf. Task-number: PYSIDE-1898 Change-Id: I6b32d678e9729112f9a475e5419bb976a5be553d Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Add QString to UNICODE conversionFriedemann Kleint2022-04-291-0/+6
| | | | | | | | Complements dffe483604d6371112da6ef5ad40c6dfcee20f76. Task-number: PYSIDE-1898 Change-Id: I65bf5631ca2507a6488db370dfc8972b1a1e3c5f Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Add function to convert a PyTypeObject to a QMetaTypeFriedemann Kleint2022-04-281-0/+14
| | | | | | | | Move the snippet into the library for further use. Task-number: PYSIDE-1898 Change-Id: If04da23cb0a4890474810ca762cc2ee29de480f6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Move the UNICODE conversion into the libraryFriedemann Kleint2022-04-281-5/+20
| | | | | | Task-number: PYSIDE-1898 Change-Id: I8ed11bb3f46a5e26adf8bcb7aa3f083adde40628 Reviewed-by: Christian Tismer <tismer@stackless.com>
* __feature__: rework constructor handling of both featuresChristian Tismer2022-02-221-50/+226
| | | | | | | | | | | | | | | | | | | | | | This is a quite complicated patch that tries to do the right thing in all cases with snake_case and true_property. Special is that a property can be a true property that is really turned into a property object, or it can be a pseudo-property which is not a property but should be treated as such. Exhaustive tests for all cases are added. [ChangeLog][PySide6] Properties are now usable in constructors of classes in any combination of snake_case and true_property. Task-number: PYSIDE-1019 Fixes: PYSIDE-1705 Pick-to: 6.2 Change-Id: I1c6b6a24e0bb2e906ecbed225953ac782fed48f7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* __feature__: Do the renaming also in the hidden methodsChristian Tismer2022-02-151-11/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has taken quite a while until it was understood why mistyped (un-renamed) methods are still found when using `snake_case`. It is a very old patch that searches hidden objects via the QMetaObject when normal attribute retrieval fails. This implementation is used all the time, but it is easily overlooked because most generated wrapper objects use this implementation from QObjectWrapper by inheritance, and is not found in the source code. Renaming these hidden methods the same way as the normal methods are renamed solves this problem. As a side effect, the solution to PYSIDE-1765 becomes more complete, too, since these hidden attributes were really missing. [ChangeLog][PySide6] The snake_case feature is now more complete since it renames hidden methods, too. Change-Id: I8614314e417a40549ef09f3105a03f22cb575bab Fixes: PYSIDE-1753 Task-number: PYSIDE-1765 Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPySide: Rename interface functions and classes to simplify debuggingChristian Tismer2022-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The names of certain interface functions are not always following a simple scheme. Especially it is not easy to see immediately if we are dealing with a method of SbkObjectType or SbkObject Do a few renamings to simplify debugging and make the code easier to understand. When a function is used in a type spec and there is no other important reason, it should be named like {Py_<tpname>: reinterpret_cast<void *>(<TypeName>_<tpname>)}, Rename also all type functions ending on "TypeF()" to end in "_TypeF()". This is not always the case. Examples: SbkObjectTpNew -> SbkObject_tp_new SbkObjecttypeTpNew -> SbkObjectType_tp_new PyClassPropertyTypeF -> PyClassProperty_TypeF Task-number: PYSIDE-535 Change-Id: Icbd118852f2ee732b55d944ed57c7a8ef7d26139 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside: Move helper isCompiledMethod() to pysideutils.hFriedemann Kleint2022-01-191-0/+7
| | | | | | | | | | | 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>
* PySide6: Move the mutex for locking QObject allocation helpers to libpysideFriedemann Kleint2021-12-081-0/+7
| | | | | | | | | | Qml and Quick were using 2 different mutexes, which does not make sense. Task-number: PYSIDE-1709 Change-Id: Id0ec0f780c1d24e40a7f072dea62964ecf92e9d2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Pyside6: Move the QuickRegisterItem helpers into libpysideqmlFriedemann Kleint2021-12-081-12/+0
| | | | | | | | | libpyside had some variables that were only used by Qt Qml/Quick. Move them into libpysideqml. Task-number: PYSIDE-1709 Change-Id: I8d794c1149bc35f5bd0d8c6aec9b222bb7f73bf5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Split up the pyside.h headerFriedemann Kleint2021-11-261-0/+5
| | | | | | | | | | | | | | | | 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>
* libpyside6: Add a convenience function to convert a PyObject * to a QObject *Friedemann Kleint2021-11-231-8/+34
| | | | | | | Pick-to: 6.2 Task-number: PYSIDE-1709 Change-Id: I137d7fd3ac84f50bb6a799e27e07b7523d943812 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside6: Use isEmpty() instead of empty() for Qt containersFriedemann Kleint2021-11-191-1/+1
| | | | | | Pick-to: 6.2 Change-Id: I0e2f7164bd89ae75eb2aa1cb82adcfa317aea309 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: check in the rest of PyPy changesChristian Tismer2021-11-121-0/+5
| | | | | | | | | | | | | | | | | | | The PyPy branch has been apart from the main branch for a long time. Meanwhile, almost everything has settled and can be merged into the main branch. This has the advantage of a single branch for both configurations. This project is still not ready. It will be called ready when the Mandelbrot example can be run without any changes. To achieve that, the current threading problem must be solved. The WIP branch is kept. It now holds only the pypy-blog.txt file. Task-number: PYSIDE-535 Change-Id: I317b0e921cc6810e1b76c69991a0f8e592135c65 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Remove QML includes from pyside.hFriedemann Kleint2021-11-111-2/+0
| | | | | | | | | | | Forward-declare QQmlPrivate::RegisterType. This requires adding some includes in dependent modules. [ChangeLog][PySide6] pyside.h no longer includes QML headers. Pick-to: 6.2 Change-Id: I7d7b703d46e45adbb714d817f05b5480b35d4a4c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Remove SbkObjectType from the APIFriedemann Kleint2021-09-131-4/+4
| | | | | | | | | | Leave only a deprecated typedef. Complements a4311711eb89e3f9833a05edf3debdf7563a104f. Task-number: PYSIDE-535 Change-Id: Icab9e82e7bff99363c01e471db1c84ee8d6c0b6b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Define SbkObjectType to be a PyTypeObjectFriedemann Kleint2021-09-111-6/+1
| | | | | | | | | | | | | | | SbkObjectType was a struct embedding a PyTypeObject after fec1611e9f42c1f0a13eb33474df2ed8ee480842. Remove that and make the types equvivalent, which allows for removing many reinterpret_casts. SbkObjectType is left as a typedef for client code snippets. [ChangeLog][shiboken6] SbkObjectType is now a typedef for PyTypeObject. Task-number: PYSIDE-535 Change-Id: I44812311ccbbe0988c38e34c47d16f6874f8d1cf Reviewed-by: Christian Tismer <tismer@stackless.com>
* Implement qmlRegisterSingletonInstanceCristián Maureira-Fredes2021-08-171-0/+11
| | | | | | | | | | | | Using a similar approach to the qmlRegisterSingletonType, but wrapping the instance (QObject) into a SingletonFunctor as described in Qt/C++. Add helper function PySide::isQObjectDerived Task-number: PYSIDE-487 Change-Id: Id0fd9da0351a9ba58eae006d7d882f9815f06742 Reviewed-by: Christian Tismer <tismer@stackless.com>
* pathlib: fix empty constructors in conversionCristián Maureira-Fredes2021-07-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | In some classes, like QDir, there is a default value for constructors that accept a QString: QDir(const QString &path = QString()) However this case was not considered in Python land when nothing is passed. Considering other classes might have a similar situation, we fix this at the level of the conversion and not per Qt class. To reproduce this issue, a simple: from PySide6.QtCore import QDir a = QDir() will segfault. Added a simple test case, and instructions to make the parameter optional (pyi). Task-number: PYSIDE-1499 Change-Id: I42156b87ca0aa60466c743a8cc8b42ea5eeb3559 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix assert when retrieving wrapper from different threadFriedemann Kleint2021-07-081-2/+5
| | | | | | | | | | | | | | Check if the thread matches before calling QObject::setProperty(), fixing: ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 0x0x1e2bd40. Receiver '' (of type 'QDBusConnectionInterface') was created in thread 0x0x7f54b3ce16e0", file qtbase/src/corelib/kernel/qcoreapplication.cpp, line 554 Task-number: PYSIDE-1570 Change-Id: Ib10984a03606bf2cf4dddb0dbd9dfaed3e4d09fe Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix crashes in QObject.findChild()Friedemann Kleint2021-06-291-1/+15
| | | | | | | | | | | | | | | | | | | For all objects encountered in findChild(), a wrapper was created just to be able to retrieve its type object and check against it. As there is a name lookup involved, it happens that non-QObject wrappers are created for this (in the specific case, an enum wrapper), which leads to crashes later on. Refactor the code, extracting a helper function to PySide which finds the best-matching type object for a QObject to check on that. Rearrange the check so that the name is checked first. Pick-to: 6.1 5.15 Fixes: PYSIDE-1609 Change-Id: I026854201f3f6eca9e5905105127f0a4b4588fa9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build support for pathlib.Path, baselineChristian Tismer2021-06-121-1/+16
| | | | | | | | | | | | | [ChangeLog][PySide6] pathlib.Path gets additionally accepted for all function arguments which have a std::filesystem::path type. This is a first part that implements those modifications which have a std::filesystem::path entry. In a later patch, all the possible other Path insertions will be made. Task-number: PYSIDE-1499 Change-Id: I2dec04dbdb2aaff6ca56c39b28f60281262fe078 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyClassProperty: Correct the decorator and publish the classChristian Tismer2021-06-101-0/+2
| | | | | | | | | | | | | | PyClassProperty is now correctly published as a QtCore class and existing as an import. As a side effect, a bug was fixed where a syntax error occurred because of a missing signature count. Task-number: PYSIDE-1019 Fixes: PYSIDE-1593 Change-Id: Iae733280d9f9c23244e83a356011104bf527c329 Pick-to: 6.1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside: Add helpers for numpyFriedemann Kleint2021-04-211-0/+2
| | | | | | | | | | | | Add utility functions for converting numpy vectors containing x,y data to list of QPoint, QPointF, respectively along with helpers for type checking and initialization. Task-number: PYSIDE-1540 Task-number: PYSIDE-1503 Change-Id: Idde5084434a36ec31eb87bf65dec3d637cff728b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* libpyside: Fix some clang analzyer warningsFriedemann Kleint2021-03-111-5/+5
| | | | | | | | | | | | - Use nullptr - Initialize variables - Remove else after return - Remove C-style casts - Avoid constructing QString from const char * - Use emit for signals Change-Id: I6ba8cad51f4b2a22f94996d1a9d8c3ae87c35099 Reviewed-by: Christian Tismer <tismer@stackless.com>