aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests
Commit message (Collapse)AuthorAgeFilesLines
* allow to use shiboken.delete() to delete Q*ApplicationChristian Tismer2021-01-111-2/+3
| | | | | | | | | | | | | | | | | | | | This function should initially not allow deleting Q*Application with a shiboken.delete() function, but unfortunately some competitor can do that, so we will as well. Deletion of qApp needs knowledge about qApp. We add a hook function that calls the pyside function `destroyQCoreApplication`. A special problem was testing interactively. See the error description for the days long journey :) Change-Id: I34862425c2cb2cc80d6cafc22d25a867f96f3e0a Fixes: PYSIDE-1470 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 98aba46414b666c27df3904d2b4313f0a16e05dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide: write a renamer script for debuggingChristian Tismer2021-01-111-196/+0
| | | | | | | | | | | | | | | Debug output is hard to read if there are many objects with the same type but different address. This script builds simple names instead of addresses which are easy to track. See the info at the beginning of the script. Change-Id: I51e08276d8ffc6d7365ce8620957e64769d7fd8c Task-number: PYSIDE-79 Task-number: PYSIDE-1470 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 8a115fcc3719af509a1abb91805729c06ce38443) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* sources: migration from format() to f-stringsCristian Maureira-Fredes2021-01-0612-27/+26
| | | | | | | | | | This should be the last patch related the usage of f-strings from the 'sources' directory. Change-Id: I0288d720dc4930dee088ca3396a66d1b3ba18f76 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit d9f344fcef6bec04a787f9ea9f4ea94f15eaa26c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc/tests: update old style printCristian Maureira-Fredes2021-01-042-6/+6
| | | | | | | | | | There were some leftovers from Python 2 still around our code, this patch only covers the 'print' cases. Change-Id: Icf574be6a40cdb233d3c410c2ec831d2d09bb735 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit b3a8c9898cca52b63d270a54651ec71de9b32238) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* write a leak_finder scriptChristian Tismer2020-12-171-0/+196
| | | | | | | | | | | | | | | | | PySide has a few known memory leaks and probably some unknown leaks as well. There are more or less unproblematic pseudo-leaks where only too many references are kept, but there are also the true leaks, where new objects are created all the time. This script is a first attempt to get rid of that problem. The interface is not perfect but works pretty well. Change-Id: I8e44eedde036f25adadf66ca2a7fdac8095619c4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 089d527e5a331ab83c9b365314301c39382c5b45) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* remove QBackingStore from qrasterwindow_test.pyChristian Tismer2020-12-151-26/+2
| | | | | | | | | | | The QBackingStore part of qrasterwindow_test.py does not work on macOS. We remove this part of the test that should not even reside in PySide but is a Qt matter. Change-Id: I520a5fd1336850d3e3883bcccb9b6a4b2cdafeda Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 35f0aa7be658c6dc5887aad6c38e098e3466ec5f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* fix both qflags_test and the qflags cppgenerator codeChristian Tismer2020-12-031-5/+7
| | | | | | | | | | | | | | | | | | There was a years-old qflags test failing on Python 3. It was blacklisted with the comment "# Nested exception in Python 3" This was nonsense: The test was wrong also for Python 2. It just happened to work, because Python 2 had some weird errors leaking. The real bug was in missing error handling in cppgenerator.cpp . See the main description in the issue. Change-Id: Ia0f9466640e0eb33f1b8b26178d33f2be0bcb32f Task-number: PYSIDE-1442 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* test: fix QtQml::signal_argumentsCristian Maureira-Fredes2020-12-021-1/+1
| | | | | Change-Id: Ie554c42597343d10cf199739d6821b6cb40894bc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* PySide6: Remove namespace QtQmlFriedemann Kleint2020-11-271-1/+1
| | | | | | | | It was removed in qtdeclarative/5a59cbfee71907c47587a1e3d340d31abfdc01ba. Change-Id: I94c49dced3decb9089c1f8745468d080e0d0311d Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix test javascript_exceptions.pyFriedemann Kleint2020-11-271-1/+1
| | | | | | | It was using the old Qt Quick Controls 1. Change-Id: Ia1d6a884267fdcd8e3808b08bf1efa12eb62b4dd Reviewed-by: Christian Tismer <tismer@stackless.com>
* errorhandler.py: use AttributeError instead of TypeErrorChristian Tismer2020-11-251-1/+1
| | | | | | | | | | | | | | There is a small improvement needed in errorhandler.py: It was not consequent to use TypeError for missing attributes in one case, and to use AttributeError on the constructors. The error message may be different, but it always should be AttributeError. Task-number: PYSIDE-1305 Task-number: PYSIDE-1019 Change-Id: I1c278c5256000f0f0fe66ca9da36c2d078002b25 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* cppgenerator: rework keyword handling regarding unknown keywordsChristian Tismer2020-11-231-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | PySide has a distinction between functions with simple arguments and functions with keyword arguments for optional keywords. When a function has keywords specified in one or more signature branch, it gets the METH_KEYWORDS flag. In this case, it is checked that no argument is given positional and per keyword at the same time. Completely forgotten was to check which keywords are allowed in that branch, if at all. The problem was much complicated because constructors can contain extra signals and properties. At the same time, all further error messages are generated with Python. This adds necessary flexibility when features are active. All PyBuildValue objects were refcount leaking. That has been replaced by static createStaticString expressions. The `argNames` structure is no longer needed by the improved algorithm. Change-Id: Ic297912c47231720f61c7d4b79b46a1e376a9941 Fixes: PYSIDE-1305 Task-number: PYSIDE-1019 Pick-to: 5.15 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Add QMetaTypeFriedemann Kleint2020-11-161-10/+9
| | | | | | | | | | This is required for QSqlField among other things. Re-add the conversions that previously existed for the now deprecated QVariant::Type for QMetaType. Change-Id: If47168f0f45ecfbfe483a8eaa9c6e037477f5ce6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* __feature__: provide useful error message when feature is activeChristian Tismer2020-11-112-0/+124
| | | | | | | | | | | | | | | | Features seem to work quite good so far, but they clearly need much more testing. One of the problems is that error messages are produced, but the function name is not found and we get an ugly default error message. This is an efficient implementation that does all name mangling in the C code. A helper dict avoids linear search for properties. Task-number: PYSIDE-1019 Change-Id: Ic87c4a6e7dc2b2a251e809d6df0eb7fb9ca8021c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* python3: remove all obsolete "from __future__" import statementsChristian Tismer2020-11-0922-44/+0
| | | | | | | | | | | Note that not all future statements can be removed: PEP 563 for instance deals with from __future__ import annotations Task-number: PYSIDE-904 Change-Id: Ia387ec87f3c68ca64d13e8e80191eda900f58638 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Further adaptations to Qt 6Friedemann Kleint2020-11-051-2/+2
| | | | | | | | | | | - Remove QPrinter::getPageMargins() - Fix qcollator test, adapting to qtbase/3a1bc4bad5757d72e5af8b4abe236e3cfac9621d. - Add new QShortcut constructor, adapting to qtbase/b26fa9722f9e8c81406259f6db8044e8bbc2d50b Change-Id: I92b2b54fbe5a93ac40a8ad69589f9317df03b4ad Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-02619-0/+197412
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>