aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Add QtQuickTestFriedemann Kleint2023-12-246-0/+78
| | | | | | | | | | [ChangeLog][PySide6] QtQuickTest has been added. Fixes: PYSIDE-2543 Change-Id: I949a0e50a2e522589863ade1e2b2335be580a0d7 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* PyPySide: Fix some new bug that should ignore featuresChristian Tismer2023-12-212-3/+8
| | | | | | | Task-number: PYSIDE-535 Change-Id: I9dc87afba17ceed9bd24c54e468e634155877e61 Pick-to: 6.6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add QQuaternion getAxisAndAngle()/getEulerAngles()Friedemann Kleint2023-12-211-1/+7
| | | | | | | | Address a fixme-comment in the typesystem file. Change-Id: I9242a04cab75229480efa81a98dc0bbef9bb4e61 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Implement QLockFile::getLockInfo()Friedemann Kleint2023-12-201-0/+3
| | | | | | Change-Id: Idd19498383f3a785a6a393ff8e9d07b6d45bb14e Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Avoid converting to string for calculating the hash valueFriedemann Kleint2023-12-191-2/+33
| | | | | | | | | | | | | | | Partially revert bf8a60db4cdbfc3e7c9c98778b219e9c83746d44, which introduced a helper function converting to QString for Q(Date)(Time) and QUrl. For these classes, the qHash() function should be found by the code model after 9c37876d6f649b3c9bd1411d3c7ffe620786f1a8. Extend the test accordingly. Deprecate the QString-helper. Task-number: PYSIDE-1906 Change-Id: Ia210a2210bc6a43991d5b26374039f4e86d0e71e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QtAsyncio: Implement call_soon_threadsafe()Adrian Herrmann2023-12-141-0/+58
| | | | | | | | | | | | | | | Using the QTimer.singleShot(msec, context, functor) overload in QAsyncioHandle already turned call_soon() threadsafe, as that allowed callbacks to be scheduled from other threads. In order to follow the API and distinguish call_soon() and call_soon_threadsafe(), the former is reverted to using the old overload without the context argument, while the latter keeps the new overload. Pick-to: 6.6 Task-number: PYSIDE-769 Change-Id: Ib2591f994d082b46fe4ec747e590e4d8eb6ff24e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Deployment: Update TestsShyamnath Premnadh2023-12-083-122/+214
| | | | | | | | | | | | - Use existing `BaseConfig` class instead of created a new class based on 'Configparser' for parsing .spec files. - Update and add Android deployment tests to CI. Pick-to: 6.6 Task-number: PYSIDE-1612 Change-Id: I32cd16e08781c71fb534bbfe7e3726818475366b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deployment: Add icon for applicationShyamnath Premnadh2023-12-041-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | - For Android deployment, by default kivy's icon is used when the application is deployed. This patch makes use of PySide icon as the default for all applications created with pyside6-android-deploy. - Icon formats accepted by Nutika windows: .ico macOS: .icns (contains a 128x128 .png file) linux: all standard image formats. We use .jpg - For Desktop deployment - change the option --linux-onefile-icon to --linux-icon. Both are the same. - Add icon options for macOS and Windows. - Adapt deployment test accordingly. - As an addition, add a default value to the --config-file option so that it picks up the one in the project directory automatically, if it exists. It aligns with the desktop deployment tool as per 6337e4a306babdb4015c248a14ad734b320ed2c1 - As another extra, remove an unused typing import from config.py Pick-to: 6.6 Task-number: PYSIDE-1612 Change-Id: Ia67ea96f94ddffe4bc65652f91c8b394c4e56a33 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Upgrade Nuitka to 1.8.0Shyamnath Premnadh2023-12-041-7/+7
| | | | | | | | | | | | - No more warning on 3.11. Still no support for 3.12. - As a drive by, remove deployment related packages from the project's requirements.txt file. Pick-to: 6.6 6.5 Task-number: PYSIDE-1612 Change-Id: I1d379b4241d3e40de107ceb8c8d28b893de39dec Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Enable connecting signals to slots with default parametersFriedemann Kleint2023-11-291-0/+20
| | | | | | | | | | | | | | | Find the number of default parameters using PyFunction_GetDefaults() and change the argCount() helper to return the min/max argument count. With that, try to match the slot using the most argument. [ChangeLog][PySide6] It is now possible to connect signals to slots/lambdas with more arguments provided they have default parameters. Fixes: PYSIDE-2524 Change-Id: I134d33e3ee78b62689fa36887a9acd41951c02e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Tests: Fix some flake warningsFriedemann Kleint2023-11-2856-72/+111
| | | | | | | | Mostly spacing related. Pick-to: 6.6 Change-Id: I748a8a06f456c5d4bafb94c397c43b3b2ee9e3e9 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* QtAsyncio: Add wrapper for calls in executorAdrian Herrmann2023-11-241-0/+46
| | | | | | | | | | | | | | | Executors require a bit of extra work for QtAsyncio, as we can't use naked Python threads, instead we must make sure that the thread created by executor.submit() has an event loop. This is achieved by submitting a small wrapper that attaches a QEventLoop to the executor thread, and then creates a singleshot timer to push the actual function for the executor into this new event loop. Pick-to: 6.6 Task-number: PYSIDE-769 Change-Id: I77569d8939d6040ddbe62a99448c6ced2785f27e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QTimer: Implement singleShot signatures w/ contextAdrian Herrmann2023-11-241-2/+28
| | | | | | | | | | | | On C++, it is possible to call singleShot timers with a context object as an argument. This allows posting events to the event loop of the given context object's thread, instead of the thread of the current thread. Implement corresponding signatures to add this capability to Qt for Python. Pick-to: 6.6 Change-Id: I0c4e3ef4b859cdfaac07415ff64c440821e7f442 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Shiboken: Fix subtle bug caused by PyPy support and "bug_825"Christian Tismer2023-11-143-5/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When implementing PyPy support, all Shiboken types lost their hidden extra fields, because they were replaced by shadow dicts. This creates a problem with multiple inheritance. In Python < 3.12, the decision which base type will create the instance is driven simply by the size of the type. In class MetaC(MetaA, MetaB): pass when MetaA is derived from type and MetaB is derived from SbkObjectType, MetaA is not the type that should win. Fixed by simply adding 1 to the default size of PyType_Type. Caused by bug_825 corrected version. The old test is retained as bug_825_old.py . NOTE: This touches a Python 3.8 bug that was fixed in 3.9.12 and 3.10.4 - unfortunately CI Python is older in all cases. Task-number: PYSIDE-2230 Change-Id: I6e82cafb83c8351bbbeafcc80e11d5e45568f73d Pick-to: 6.2 6.5 6.6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add static create() function for decorated QML singletonsFriedemann Kleint2023-11-092-2/+22
| | | | | | | | | | | | | Check for static method named "create()" and use that as a singleton creation callback. [ChangeLog][PySide6] It is now possible to use a static method create(engine) for creating decorated QML singletons. Fixes: PYSIDE-2432 Change-Id: I76c47385a0064733a1949a30d22cc01c280d0423 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QMetaMethod::invoke()Friedemann Kleint2023-11-011-0/+21
| | | | | | | | | | [ChangeLog][PySide6] QMetaMethod.invoke() has been added. Pick-to: 6.6 Fixes: PYSIDE-2500 Change-Id: I270489ec9372ddfee19e9342c1312d8c446ee5d9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* deploy: Apply fixes when using pyenv and provide readable errorsChristian Tismer2023-10-181-45/+86
| | | | | | | | | | | | | | | | | | | | When the patch for pyenv was applied, some tests in test_pyside6_deploy.py were broken, which shows up locally but not (yet) in CI. For better understanding, the test classes were further broken up into three groups (irrelevant, might be undone). Things became clearer by writing a special version of unittest.TestCase that handles long strings as lists. REMARK: We are at Python 3.8 and can use ":=" now :=) Task-number: PYSIDE-1612 Change-Id: I3a479f48b96dd5f95864b8a94af6d01b42ffc196 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove registry existence files of 5.15Friedemann Kleint2023-10-174-151055/+0
| | | | | | | Pick-to: 6.6 6.5 Change-Id: I5fef2da79500ca40400ba7943183ab22d85ad22d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Support running PySide on Python 3.12, cleanupChristian Tismer2023-10-161-0/+4
| | | | | | | | | | | | | | | | | 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>
* pysidetest: Fix some static code analysis warningsFriedemann Kleint2023-10-106-10/+13
| | | | | | Pick-to: 6.6 6.5 Change-Id: If0050eadfc36444300b61498e46034ad3b4c8cdd Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Support running PySide on Python 3.12Christian Tismer2023-10-093-2/+25
| | | | | | | | | | | | | | | | | | 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>
* Fix failing XML testFriedemann Kleint2023-10-051-1/+0
| | | | | | | | | Remove the check for error column, adapting to qtbase/3d631da88bc08816b72493dbce785cabc56b70be. Pick-to: 6.6 6.5 Change-Id: Ic3deb32ba7b8c57af794ae4df7088a1d3044fbdb Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix qsqldatabaseandqueries_test.py to work in Qt 6.7Friedemann Kleint2023-09-281-4/+4
| | | | | | | | | | | | Inherit UsesQApplication to ensure a QApplication is present, which is now always required. Since one test instantiated a Application, this is the better solution regardles of whether the underlying issue is fixed in Qt. Task-number: QTBUG-117621 Pick-to: 6.6 6.5 Change-Id: I420dadb6c2f90314fe401aaf9291d23f5986bce3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Replace typedef by usingFriedemann Kleint2023-09-201-5/+3
| | | | | | | 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>
* QtAsyncio: Add queues testAdrian Herrmann2023-09-121-0/+68
| | | | | | | | | | Add a test for the asyncio queue for consumer/producer scenarios. Additionally, fix a few bugs exposed by this test through the increased code coverage. Task-number: PYSIDE-769 Change-Id: I18e3be6d059b758868a7598b58704db216bcdcc8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QtAsyncio: Fix time unitAdrian Herrmann2023-09-122-1/+50
| | | | | | | | | loop.time() needs to return the time in seconds as a float, not in milliseconds as an int. Task-number: PYSIDE-769 Change-Id: Iac123132b49d3954abda8545d0830f1837a27c48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QIODevice: Implement buffered readsAdrian Herrmann2023-08-311-0/+78
| | | | | | | | | | | | Some users of QIODevice read functions (read, readLine and peek) might want to use fixed buffers to avoid reallocation, e.g., asyncio's buffered protocols. This adds overloads of said read functions that take an input buffer (as a bytearray) and return the number of read bytes. Pick-to: 6.5 Change-Id: I0c3678d3a87811029278c5ae8f829eef0432099a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide6: Fix up QDataStream.readRawData/writeRawData()Friedemann Kleint2023-08-291-0/+10
| | | | | | | | | | | writeRawData() was historically implemented to take a string. Fix the signature. Add an overload for PyBuffer/bytes. Fix the return type of readRawData() to be bytes. Fixes: PYSIDE-2442 Change-Id: I1684afd5aae2f8d118fa2fac87d916c23bd4a59e Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Brush up code related to pre-Jira bug 1019Friedemann Kleint2023-08-221-0/+1
| | | | | | | | | | 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>
* Fix QLocale.toLong return valueCristián Maureira-Fredes2023-08-151-0/+5
| | | | | | | | | | | | | | | | | | The currently implementation was using an inherited toLong function, not returning the Tuple[int, bool] that the docs described. This adds a modification to follow the same idea of all the other to*() methods. Additionally, we remove all the to*() methods that accept a QStringView, due to behaving the same with the QString variations. [ChangeLog][pyside6] QLocale.toLong now properly returns a (int, bool) rather than only int Fixes: PYSIDE-2226 Change-Id: I5634e4010982e115c8208fdb9b56cfc57960358b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add support for QQmlComponent in PropertyCristián Maureira-Fredes2023-08-102-0/+37
| | | | | | | | Fixes: PYSIDE-2415 Pick-to: 6.5 6.2 Change-Id: I2b19b20b1dec584667fa82abe6be2901b9580f96 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Clean up some unused suppression warningsFriedemann Kleint2023-08-011-8/+0
| | | | | | Pick-to: 6.5 Change-Id: I261ec7ec933e21658d357ad1ffbeb4de5b84d13f Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Implement custom asyncio event loop based on QtAdrian Herrmann2023-07-274-0/+113
| | | | | | | | | | | | asyncio is an established library for Python applications with concurrency and asynchronous I/O, and the de facto standard that multiple other async frameworks build upon. Like Qt, it is based on an event loop, so to this end, it offers an extensive API to implement custom event loops that applications using asyncio can then leverage. Task-number: PYSIDE-769 Change-Id: I3daf5d631e2fa0d44fd8c3c272ac5cce96f58653 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QtGraphsFriedemann Kleint2023-07-071-0/+1
| | | | | | Task-number: QTBUG-111305 Change-Id: I7ac79f59cfd0b85645d30485e86b6ff74bba20bb Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix 3 strange cases in QSettings.value() round trips of a listFriedemann Kleint2023-07-071-0/+17
| | | | | | | | | | | | | | | | | | | - The "default value" parameter had an int 0 default value, which lead to strange behavior ['0'] being returned for string lists with missing keys. - QStringList was not converted when forcing the type to be list due to the QByteArray split mechanism. - String values could not be coerced to a list Fix the default value to have a default {}. Add a helper function checking whether a custom type conversion is actually needed or the default QVariant converter can handle it. Pick-to: 6.5 Task-number: PYSIDE-2381 Change-Id: I91b22c05f851c2dc8c3792bd9f1446cfc8ceba51 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyEnum: Remove the now unreachable test cases for old enumsChristian Tismer2023-06-1911-90/+18
| | | | | | | Task-number: PYSIDE-1735 Change-Id: I51e68c50872f1d1254218ae7556ba607f73c4ea9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PyEnum: Update docs and rename the optionChristian Tismer2023-06-1612-22/+22
| | | | | | | | | | | | | The new Enum implementation can no longer be switched off. Individual features can still be deselected with the environment variable PYSIDE6_OPTION_PYTHON_ENUM which had the name PYSIDE63_OPTION_PYTHON_ENUM before. This change is meant for PySide 6.6 . Task-number: PYSIDE-1735 Change-Id: Iae5b7a9d42a0d7b005dbba20201a80713ef79be9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Enum: Enable toInt for QVariant(PyEnum/SbkEnum)Shyamnath Premnadh2023-06-136-1/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* Fix crash when using QScxmlStateMachine::connectToEvent()Friedemann Kleint2023-05-311-10/+27
| | | | | | | | | | Change (gadget) QScxmlEvent to be a value type. Refactor the test to check for events as well. Pick-to: 6.5 Fixes: PYSIDE-2340 Change-Id: I0e37de05740f17d41794ebc74c81e49c49753495 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* metaobjectdump.py: Implement slotsFriedemann Kleint2023-05-312-0/+4
| | | | | | | | | Extract helper functions from the Signal handling code to parse @Slot. Pick-to: 6.5 Fixes: PYSIDE-2347 Change-Id: I1c12becad43e7915a63bd3068c7ec71d498c380f Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* qopenglwindow_test.py: Skip for GLESFriedemann Kleint2023-05-301-3/+3
| | | | | | | | Amends 8a0a3d7fc64917d53767856f4ecedb636597ec54. Pick-to: 6.5 Change-Id: I67a1fdaee87a8359f2c2f38cba8ed26359bae3e8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix connecting signals with arguments by constructor kwargsFriedemann Kleint2023-05-221-1/+29
| | | | | | | | | | | | 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>
* qopenglwindow_test.py: Port to use QtOpenGL functions, onlyFriedemann Kleint2023-05-171-17/+22
| | | | | | | | | | | The test was using a mixture of Qt and Python GL functions, which can pose problems with Qt's dynamic GL switching on Windows. Use QtOpenGL functions 1.3, exclusively. Pick-to: 6.5 Change-Id: Iecaaacfe3cd8268b6744e5dcdb3c0e0902a148a8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide6: Prevent crash when connecting to temporary signal sourcesFriedemann Kleint2023-05-171-1/+6
| | | | | | | | | 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 anonymous slot memory leak testAdrian Herrmann2023-05-151-32/+15
| | | | | | | | | | | - Remove LeakerExternal test. - Use the right assert. - General simplifications. Task-number: PYSIDE-2299 Pick-to: 6.5 Change-Id: I0851b2b75ff5658d0ced18b73a4a4b175397cc88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Numpy support: Fix 64bit support and compiler warning about potentially ↵Friedemann Kleint2023-05-111-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | uninitialized value The size for long long was incorrect. Fix it and expand the test to check values as well. For really bizarre long types, the variable might be uninitialized, causing shiboken6/libshiboken/sbknumpyview.cpp:82:12: warning: type may be used uninitialized in this function [-Wmaybe-uninitialized] Fix by introducing a helper returning a std::optional. Amends 499832abfdf13eac5aa35f84a62166fb5aa2e034. Task-number: PYSIDE-2313 Pick-to: 6.5 Change-Id: Ie7d22a728a42f644fa84cba811c4e35e7db7ebb5 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix leak connecting signals to anonymous functionsAdrian Herrmann2023-05-111-0/+72
| | | | | | | | | | | | | | | | | 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-052-0/+44
| | | | | | | | | | | | | | | 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>
* QML reference examples: Add notify signals and final attribute to propertiesFriedemann Kleint2023-05-034-4/+4
| | | | | | | | Task-number: PYSIDE-2206 Task-number: QTBUG-111033 Pick-to: 6.5 Change-Id: I0541a3bbb4e5696962802da7f91ab79682700124 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Move the QML reference examples around to match the structure in QtFriedemann Kleint2023-05-026-10/+12
| | | | | | | | | | | Adapt the tests accordingly. Task-number: PYSIDE-2206 Task-number: QTBUG-111033 Pick-to: 6.5 Change-Id: I332d6467da56b88ecbf9282d23092d8d47b730e0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>