aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests
Commit message (Collapse)AuthorAgeFilesLines
* Desktop Deployment: Upgrade Nuitka to 2.6.86.8Shyamnath Premnadh2025-04-231-2/+2
| | | | | | | | | | | | - There were some updates with respect to PySide6 support - See changelog here: https://nuitka.net/changelog/Changelog.html#nuitka-release-2-6 Task-number: PYSIDE-1612 Change-Id: If091184a2661f81d3d57342ba48edc35e748fc70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 5711a3ca9cf5eb36cadfd2aa9478500a17aa395f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 8fda329af6d305a640bdaee04db382a2936797cf)
* PySide6: Add class QMessageLoggerShyamnath Premnadh2025-04-102-0/+75
| | | | | | | | | | | | | | | | | - Also add documentation with a minimal example showing the use case of QMessageLogger in Python. [ChangeLog][PySide6] Added QMessageLogger class to handle debug, info, warning, critical, and fatal messages, including support for QLoggingCategory. Task-number: PYSIDE-3052 Change-Id: Iaaf586288de4aaccf01d1e6547df9a2f478a7c8c Reviewed-by: Ece Cinucen <ece.cinucen@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 48a2c4e67c02d0b77757a518480823b6a797b9ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 6f5d32b26e069c02e664518fdeb2142ace3d60c4)
* Fix qlocale_test.py to pass after QLocale changeFriedemann Kleint2025-03-241-1/+1
| | | | | | | | | | | | | | Floating point output now uses lower case after qtbase/05c8a48612be38a3c50bb5ed9daf1adfc221b9f2. Task-number: QTBUG-134785 Task-number: QTBUG-134768 Pick-to: 6.5 Change-Id: If6c6463b3828374a2399f6bd9d26cafebc6edaf1 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit 507d8cc0e7ae494018d933571049e63131bcf3ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 55c60776ef59d28c4320f268eb6f24caabe733b9)
* Deployment Test: Remove modules for windows win_arm64Shyamnath Premnadh2025-03-151-0/+14
| | | | | | | | Task-number: PYSIDE-1612 Change-Id: Iac8406d6e49c83c8f5aa1be757cf4c7fbfcf01bc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 972cd70b4e0ed305a605b1c209770c1097457580) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tests: Fix warning about QBackingStore::flush() being called without handleFriedemann Kleint2025-03-142-13/+21
| | | | | | | | | | | | Call qApp->quit() delayed from the paint event. This fixes crashes on macOS and warnings: QBackingStore::flush() called for QWidgetWindow(0x600003a22460, name="MyWidgetClassWindow") which does not have a handle. Change-Id: I2e5d8aa1cfc36c4c247f681b4219f52c1a618737 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 918cd72f5eaebf56287a5ab0ac2e149ba1617a57) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Print erroneous PYI files, but only if COIN is presentChristian Tismer2025-02-281-1/+1
| | | | | | | | | | It turned out to be boring if the PYI files are printed locally. Task-number: PYSIDE-3012 Change-Id: Ic47e1828367c1f00c263451a6090cb5e03313103 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 1cb5ce86b41ca11dfd678d70629f21703cf09aa3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix connecting signals by QMetaMethodFriedemann Kleint2025-02-281-0/+19
| | | | | | | | | | | | The old implementation was calling the string-based overload, but did not add the '1'/'2' markers added by SIGNAL/SLOT. Call the QObject overload directly. Fixes: PYSIDE-1277 Change-Id: I912f46c33959b622301b0a75e771057c8874f7e3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit ad70c1a75af6cd7dbed4c43202c16e65481a2d7d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Print erroneous PYI files for COIN support (cleanup)Christian Tismer2025-02-271-1/+0
| | | | | | | | | | Reason: We cannot find an error which happens in CI on Windows 11, only Task-number: PYSIDE-3012 Change-Id: I99a2d72e49027cc76767c70bdc94d8d3f6451782 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit f495666f1dd540fb49661c2f126796593afaf38f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Make the error messages more verboseChristian Tismer2025-02-271-1/+1
| | | | | | | | | | | | | | The --pretty switch shows a little context. If that does not help, we will have to send the whole PYI file back from CI. Task-number: PYSIDE-2846 Task-number: PYSIDE-3012 Change-Id: I45a4111c6ea78bf6c487077c43eb37b946602ec8 Reviewed-by: Ece Cinucen <ece.cinucen@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 3b7a6766ccef2696bc0f4debbc5f849bea64d021) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Print erroneous PYI files for COIN supportChristian Tismer2025-02-251-1/+21
| | | | | | | | | | Reason: We cannot find an error which happens in CI on Windows 11, only Task-number: PYSIDE-3012 Change-Id: I8f2e4c56ee8c81e8d3b348c624be5df80d5df275 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit b6952b833e1ec336607fd909320d35c5ca74a2a5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QCanDbcFileParser parse function overloadsEce Cinucen2025-02-204-1/+58
| | | | | | | | | | | | Add the overload-number attribute to parse function to execute first QString check and then QStringList. Test for parser added. Fixes: PYSIDE-3017 Change-Id: I7e5a02fec50405bc3d71c5662a7909d34f4d20df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 4cc90374fca5cacc0d85cac937cfa29b7e70ed44) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix disconnecting a string-based connection by passing a callableFriedemann Kleint2025-02-201-8/+60
| | | | | | | | | | | | | Amends cab304e70cce68bbdaa70d7f7b2bf6e95e85e6d2. Restructure the test. Fixes: PYSIDE-3020 Task-number: PYSIDE-1057 Change-Id: I8954a534648ded5d476fec608d0699132a026461 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 96e016d95d8e37eb76492ab45dc454767ccb21b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix overriding QPaintEngine virtual functions taking a C-style array of ↵Friedemann Kleint2025-02-191-0/+86
| | | | | | | | | | | | | | | | | | | geometry primitives Add argument conversions PySequence<->C-style array, modelled after QGraphicsView::drawItems(). Move some templates around to the common template file and add generic conversions for lists of value types. [ChangeLog][PySide6] The virtual functions of QPaintEngine taking a C-style array of geometry primitives have been fixed. Fixes: PYSIDE-3002 Change-Id: Ife8fed0e17c79091f25f57bf97bcca438452e177 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit e3631c3322d28447068de3a874055ff937b237c4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* binary size: Improve the benchmark toolChristian Tismer2025-02-171-18/+29
| | | | | | | | | | | | | | | | | | | The benchmark tool now uses per default the limited API but is becoming more flexible. This will take some more checkins until it comes to convergence. The starting point stays 2025-01-27 right before a substantial change which is otherwise not measurable. The switchable size reductions will slowly vanish. The difference approach makes then no longer sense, and the --absolute switch will become the default and vanish. Task-number: PYSIDE-2701 Change-Id: I990ef26860924c10784a70ec74a2a318b4be7d41 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit f4127d19b3fa4235c9f4780a8379864f5fdb9f0e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide6: Add QFont.Tag(str), QFont.Tag.fromString(), QFont.Tag.fromValue()Friedemann Kleint2025-02-131-0/+5
| | | | | | | | | | | The constructor is a non-type template that checks the string length. Add a function for it. Fixes: PYSIDE-3013 Change-Id: I35626c29edddf38c04c5b913a35b36c540c45d6a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 8f34aaf4df4648de59d74b1b6fe72302f63d89a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* binary size: Update the benchmark tool to absolute measurementChristian Tismer2025-02-071-9/+26
| | | | | | | | | | | | | | | | | | | After sizebench.py was used successfully on relative changes (with a disable switch in the code), we now add an absolute mode. This way, we can stop to support switching. The starting point is 2025-01-27 right before a substantial change which is otherwise not measurable. The new mode is activated with --absolute / -a It works much faster since it compares against a constant. Task-number: PYSIDE-2701 Change-Id: I341a23722a304473e92f8ef38c6d16b3b69a8a92 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit d7756f432f86b9e28addcce017dfcb141fd8a30a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* pyside6-deploy: 5. Add Design Studio project example and testsJaime Resano2025-01-2315-0/+361
| | | | | | | | | | | - Add an example of a mock Design Studio project - Add tests for pyside6-project CLI tool Task-number: PYSIDE-1612 Change-Id: Ida3e469a4d2dab2fa4d8a2e473242faf1716b075 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit d3b2898e196e84d0c170a6c2606b8738804774b3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* pyside6-deploy: 2. Improve deployment of Design Studio projectsJaime Resano2025-01-221-10/+10
| | | | | | | | | | | | | Design Studio projects will specify the resources employed by the project in the .qrc file. This way, the deployment process is way simpler since all the file dependencies are stored compiled in a .py file. Task-number: PYSIDE-1612 Change-Id: Icc0047e9f9c183a4db51052a84743e5b095ec76a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 775d7bf2c6cb8b7b6b3abd12afd883e2dda1be50) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* pyside6-deploy: 1. Minor refactoringJaime Resano2025-01-211-1/+2
| | | | | | | | | | | Just adding some type hints and a bit of code cleanup None of the existing logic should be affected by this change. Task-number: PYSIDE-1612 Change-Id: I42175426a03dc463b8da82aa560c3f13ab842392 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 8a1950f66da618d59e622411604e09c9817d3b33) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android Deployment: Auto download Android NDKShyamnath Premnadh2025-01-021-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | | - In order to prevent code duplication, a symlink to tools/cross_compile_android/android_utilities.py is created under sources/pyside-tools/deploy_lib/android. When running the script sources/pyside-tools/android_deploy.py, this works without any issues. When packaging the tools, the symlink is resolved into the actual file and the actual file is packaged into the wheels. - Remove global variable to __init__.py and remove the ones that are not used - Add tqdm to requirements.txt - Adapt tests - Additionally, include several new test cases to cover error scenarios more comprehensively Task-number: PYSIDE-1612 Change-Id: I74728be30a2b8214b9a379b0b906fdacbb105833 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ab8b330123cb557f66306b237f4c3aa8c0004f39) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide6/Tests: Use fully qualified enumerationsFriedemann Kleint2024-12-23113-403/+440
| | | | | | | | | | | As a drive-by fix flake errors. Task-number: PYSIDE-1735 Change-Id: I9829b011fee78fc8edd1aefdd3066ae89e63644b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit fcfb6d1c5b983753dd3e65a592a11c17f32bd0ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* qpixmap_test.py: Fix warning about leaking file handleFriedemann Kleint2024-12-201-2/+8
| | | | | | | | | | | | | | Port to pathlib, fixing: sources/pyside6/tests/QtGui/qpixmap_test.py:42: ResourceWarning: unclosed file <_io.BufferedReader name='/data0/frkleint/pyside-setup6i/sources/pyside6/tests/QtGui/sample.png'> data = open(os.path.join(os.path.dirname(__file__), 'sample.png'), 'rb').read() ResourceWarning: Enable tracemalloc to get the object allocation traceback Change-Id: I8417719eb150aae9e04b5ff706e3934b398e7381 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit 6eb75a26498f8984345fcdd5434b6758819f0d7f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unnecessary use of 'object' in class constructionCristián Maureira-Fredes2024-12-1818-24/+26
| | | | | | | | | | | | Considering we are not compatible with Python 2 anymore, we can drop the 'object' explicit inheritance in the class declaration. Change-Id: Iac3a95aa9721c3ff1a755f457c0936ca157a8470 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 382a34586f73896d12063616eb8b31474c03f68a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix some flake8 errors in tests/examplesFriedemann Kleint2024-12-1729-46/+48
| | | | | | | | | As unearthed by the whitespace change. Change-Id: I58c1a38c3c4a9c91719131d7950950ddf475872b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 45548b18a9e73012521a7b16a234e9689da0d9ab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide: Add WebView for macOSShyamnath Premnadh2024-12-173-3/+40
| | | | | | | | | | - caused by wrong condition check in 83603fed574fc7b0eed452b347170862b12a98f6 Fixes: PYSIDE-2964 Change-Id: I1b5c441cd7448898e44f8d829b91202e68168666 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit e89255f981821967330c6046187c8942f7ca32a0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix trailing empty linesFriedemann Kleint2024-12-1382-87/+0
| | | | | | | Change-Id: I1a5964463f703ade0657816cb974206355a5ae5b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit 21d8a3f57ba9136f8d181af6d5aa0ba9a5cdb8b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tests: handle unused imports and fix type issuesCristián Maureira-Fredes2024-12-12103-306/+233
| | | | | | | | | | | Many modules were imported but unused in our tests. Additionally, some type hint issues were solved. Change-Id: Ic2368690e9a6ce0fffea812206185aa4f3dc3c58 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit 86bea038625367f5e4f0898c3312ecb7ded1ada4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Desktop Deployment: Add more testsShyamnath Premnadh2024-12-091-0/+49
| | | | | | | | | | | | | | - Added tests for extra modules and directories to ignore. These are cli options. - Fixed an issue where updating a Python set was not functioning correctly. Task-number: PYSIDE-2945 Change-Id: Ia6b0e9ef98e2e0999bc4782168b3889598cca682 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 303c2c6b23543dc662b2a7d77792b54be05f2dc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Desktop Deployment: Disregard more non existent pluginsShyamnath Premnadh2024-12-061-8/+6
| | | | | | | | | | | | - Amends 05b3c28099c1eaff74bba8b06004cc8205b24f45 - Also, ignores 'scenegraph' and 'networkaccess' Task-number: PYSIDE-1612 Change-Id: Ibc1a0ea1525f7d56ed884bc652612d8985479258 Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 333134bec911e47abccf918905362ecd41bdc532) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Raise Python version to 3.8Friedemann Kleint2024-12-032-14/+0
| | | | | | | | | | | | | | | Fix some oversights of previous changes: - Bump limited API - Fix CMake files - Remove outdated version checks from Python code - Adapt some documentation Task-number: PYSIDE-2943 Change-Id: Id8d9c4c6bb0629948de28beb3c4274991f84ff08 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit a37a3703422cc79e8b9aaa80a653719aa8c1913c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix flake 8 errors in utility scriptsFriedemann Kleint2024-12-031-15/+15
| | | | | | | | Task-number: PYSIDE-2943 Change-Id: Iaf02a21112e3d8b89fa6396481afd584a14bd952 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 5d7daaafbb8943447be2e1abffca28f96ccc3895) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Desktop Deployment: Upgrade Nuitka to 2.5.1Shyamnath Premnadh2024-11-271-13/+13
| | | | | | | | | | | | | | | - Nuitka 2.5.1 imposes strict checking for the Qt plugins included through the --include-qt-plugins option by checking if the plugin actually exists in PySide6 installation. Consequently, the plugins "accessiblebridge", and "platforms/darwin" which are not required by Nuitka are removed from the list of plugins to be included. - Adapt tests. Task-number: PYSIDE-1612 Change-Id: I89cef4acf102e01c229b1dd6063fc08903ea686d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 05b3c28099c1eaff74bba8b06004cc8205b24f45) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Deployment: Support .webp filesShyamnath Premnadh2024-11-261-3/+3
| | | | | | | | | | | | | - Ignoring .webp files are not needed in the newer Nuitka version. - Additionally, also adds a comment differentiating between the `plugins` fields used in the deployment configuration file. - Adapt tests. Task-number: PYSIDE-1612 Change-Id: Ibbaab03021fa50e4777caa346a2c128fd5e1a06c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 9064943af94f635c26135b3912f8b8c28a31d544) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyPySide: Fix a garbage collector problem in a new testChristian Tismer2024-11-261-3/+7
| | | | | | | | | Change-Id: I82f38a1ec06b922e8554d7aac8969cf945e338ba Task-number: PYSIDE-535 Pick-to: 6.7 6.5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 5d0b4fc9be0c3f413246c12ca43b39c5ef5ab796) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide: Add numpy support for QtGraphsEce Cinucen2024-11-144-2/+55
| | | | | | | | | | | | | Added appendNp and replaceNp Added test for appendNp and replaceNp Added the missing file "qcharts_numpy_test.py" to QtCharts .pyproject Pick-to: 6.8.1 6.5 Change-Id: I55aeba0fd117a8a82c3f69e18a50358936610af9 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 649592a8cbc9c656a7b9be77f043538bf4e242d5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: add __hash__, fix __copy__, __repr__ and __dir__Christian Tismer2024-11-081-1/+3
| | | | | | | | | | | | | | | | The other missing things are sequence and mapping methods which need some more support from cppgenerator. Will be added later. typing.Self is only known since Python 3.11 . We emulate that by patching it into typing and adjusting the Python version for mypy. Task-number: PYSIDE-2846 Change-Id: Icb1060c7bba355061d8f134c8e76fb14369d7dda Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 1ef1fefc26038a80ba81a860cff5024db44dca37) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove traces of Python 2: tests and flake fixesCristián Maureira-Fredes2024-11-057-72/+58
| | | | | | | | | | Addressing a few comments from tests that were related to the Python 2 compatibility. Change-Id: I88c614549cfb91f879fe3e0d82a6988362e0ce19 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 0b7cedd3f01cd6fb97aa724f0009236d933892b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Make the mypy cache more permanent, amendedChristian Tismer2024-11-041-1/+9
| | | | | | | | | | | | | | | It turned out that mypy is not loaded by COIN tests when requirements_coin.txt is used. Also enforce mypy existence in COIN to prevent further configuration errors. As a drive-by, a new cache is used that is > 10% faster. Task-number: PYSIDE-2846 Change-Id: I75a27cfd0cb0fb0d7cd44c2a121291af052b0d8f Pick-to: 6.8.0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit be4e09c4fbda0844f16f2f064e5352f8eb1b60f0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* setup: fix PySide6.__all__ after the wheel split, amendment 3Christian Tismer2024-11-011-2/+10
| | | | | | | | | | | | | | | | | | | | | The __all__ support for the PySide6 module works just fine. But there is a last incompatibility that might strike others as it did hit ourselves when using PySide6.__dict["__all__"]: Use a derived dict type and define a __missing__ attribute. Derive further a module type, then it works without problems. A little support function in Shiboken allows to replace the dict of PySide6 with this derived type. amends 703d975f16aff95bc9014a2689a3ae824b5a552f. Task-number: PYSIDE-2895 Task-number: PYSIDE-1890 Change-Id: I018228116a5fdd1401c1ebd42ceb886f6829deeb Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 07ee31548a3af6552e62625860c20772503e658c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Make the mypy cache more permanentChristian Tismer2024-11-011-1/+12
| | | | | | | | | | | | | | | | By default, mypy stores its cache data in $(pwd)/.mypy_cache . It is better to save it in the pyside_setup folder under a version specific name. This makes the cache survive full rebuilds. We tested that this folder is really writable. Task-number: PYSIDE-2846 Change-Id: I739e74cb24b5aaa1b2b457195e8a143b56a2bc44 Pick-to: 6.8.0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit cc1164d29878ab74dbbd94718eee1bc2acdddbf6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Lazy Init: Support Lazy Subtypes in star imports, amendment 2Christian Tismer2024-10-211-5/+9
| | | | | | | | | | | | | | | After addition of subtypes support, filtering is necessary to exclude subtypes from resolving. Deleting the subtype was a bad idea with an unordered_map. Better is to use a list of names to resolve. Task-number: PYSIDE-2404 Change-Id: Ide5b13fbd37bab44881a25d4466ec30c89cd9918 Fixes: PYSIDE-2898 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 9e2d49988876c48ece633446fa031856bd78d857) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Install a permanent test for error-free pyi filesChristian Tismer2024-10-172-0/+48
| | | | | | | | | | | | | | | | | | Testing Mypy on the whole project costs some time, about 33 s on a Mac Studio Max M1 in debug mode. On CI with release Windows, this is about 8 sec. An option "--skip-mypy-test" is added to save time. The mypy tool is only enforced to exist in COIN. Otherwise it is optional. Task-number: PYSIDE-2846 Change-Id: Ibbabbf6b893537ac923fbbaba9ff832ebd675a21 Fixes: PYSIDE-2672 Fixes: PYSIDE-2886 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 29fb43f5b58d9f4f0e9a6b458240dcaa83a5f0a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Evaluate multiple signatures and Union ExpressionsChristian Tismer2024-10-171-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The multiple signatures suffer from the problem that many are reported as error, because one larger type is evaluated before another type. An Example: PySide6.QtCore.QCborSimpleType is shadowed by int when int is listed first. That is due to the mro: int.mro() [<class 'int'>, <class 'object'>] QCborSimpleType.mro() [<enum 'QCborSimpleType'>, <enum 'IntEnum'>, <class 'int'>, <enum 'ReprEnum'>, <enum 'Enum'>, <class 'object'>] We are implementing a topological sort by mro length that puts the list into the right order. Result is from 226 down to 30. Change-Id: I155e2169c3c8ab4afd5b7bb8f3411ccf6467d440 Task-number: PYSIDE-2846 Fixes: PYSIDE-2687 Fixes: PYSIDE-2886 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 8a416e88cc63788550d7561b948456d1d2a122ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Lazy Init: Support Lazy Subtypes, amendedChristian Tismer2024-10-142-4/+6
| | | | | | | | | | | | | | | | The addition of nested types made it necessary to filter subtypes out of resolveLazyClasses because incarnateType should be called for toplevel types, only. Added a star test to pyenum_relax_options_test.py to test this case without using extra time. Task-number: PYSIDE-2404 Change-Id: I4b95c0f65c055376defb6a8e9ea888285c82a8e2 Fixes: PYSIDE-2888 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit a5f3828c2c3580d673c9c4f466f71fc93af6966c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Deployment: Support Design Studio projectsShyamnath Premnadh2024-10-071-0/+92
| | | | | | | | | | | | | | | | | | - new class 'DesignStudio' to handle Design Studio projects. - Currently uses a way of monkey patching to override the 'main.py' to use 'main_patch.py' which has the same content but with 'app_dir' set to the parent of `main.py``. The reason for doing this is that Nuitka requires the `main.py` to be in the same directory as other resources required for the project. Once the corresponding patch, to alternate between evaluating 'app_dir' based on whether the application is deployed or called through the Python interpreter, is merged then this temporary fix of creating 'main_patch.py' can be removed. - Add tests. Pick-to: 6.7 Change-Id: I79e6572bdbbf4576fbdd9039a4922997a22139f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update Qt Widgets Designer formsFriedemann Kleint2024-09-187-36/+66
| | | | | | | | Load and save once so that fully qualified enumerations are used. Task-number: PYSIDE-2846 Change-Id: I544467c1d9254533bf62e1344c26c90c7d17d118 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* type hints: Fix some typing bugs for mypy (forgiveness)Friedemann Kleint2024-09-186-11/+13
| | | | | | | | | | | | | The new enums still support old syntax by the forgiveness mode. Nevertheless, when using mypy to check files, strict correctness is enforced. We correct a large number of forgiveness-induced errors, but there is still a whole lot of other complaints to fix. Task-number: PYSIDE-2846 Change-Id: If566187d268ef75bc09b8d86f73d2c7d19f284f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Add QModelRoleDataSpanFriedemann Kleint2024-09-111-4/+18
| | | | | | | | | | | | | Implement QModelRoleDataSpan with an index operator returning QModelRoleData* for modification. This enables QAbstractItemModel::multiData(). [ChangeLog][PySide6] QModelRoleDataSpan for implementing QAbstractItemModel.multiData() has been added. Fixes: PYSIDE-2859 Change-Id: I35e4812bd999538f6dbd9e63a623791640287bab Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* size bench: Automate the Measurement of Size ImprovementsChristian Tismer2024-09-091-0/+151
| | | | | | | | | This script makes it easy to measure the size reduction on all three platforms. Change-Id: I54a9cce6fd18ef58421445c2eeb688bd97eca956 Task-number: PYSIDE-2701 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* type hints: Fix some systematic problemsChristian Tismer2024-09-061-1/+1
| | | | | | | | | | | | | | __str__ and __repr__ are simply fixed by returning str instead of PyObject. __reduce__ actually has return type "str | tuple[Any, ...]", but using str here too fits the purpose. Errors before: 533 Errors after: 450 Change-Id: I6dd3527d3f5f3f035e667d0ca3c8f123e94e844f Task-number: PYSIDE-2846 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>