aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtWidgets
Commit message (Collapse)AuthorAgeFilesLines
* Fix hang of test qinputdialog_get_test.pyFriedemann Kleint2021-11-101-3/+14
| | | | | | | | | | | | | | | After qtbase/851ed6f0b1014e5acabdc1f977979841d16ecc31, calling QCoreApplication::quit() no longer terminates QDialog::exec() when not in QCoreApplication::exec(). This means, TimedQApplication can no longer be used to terminate the test. Add a timer that closes dialogs instead. Task-number: QTBUG-98088 Task-number: QTBUG-98239 Change-Id: I3fa26f063a83fd1afeee557e8b6d3d250ec46ec6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 5b9320df2284b96dba4d5eec1857a797797187e6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyPySide: fix quite a few tests using del or __del__Christian Tismer2021-10-2722-25/+111
| | | | | | | | | | | | | | | | | | In PyPy, the __del__ method is only triggered reliably by calling gc.collect() Also, the del statement does a deletion from the namespace, but the real deletion happens when gc.collent() is called. This was applied to all tests which use del, regardless if it has a visible effect on PyPy or not. It turned out to save more 8 errors, which is great. Task-number: PYSIDE-535 Change-Id: I6a58d90629c9eafec7307c17f021251113b3c7f2 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit c7c789b1822fe0b2e77e66e5c1a66a16b3c3c405) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide6: Fix QObject.property() for QFlag typesFriedemann Kleint2021-10-051-0/+7
| | | | | | | | | | | | | | QObject::property() returns a QVariant for whose type a shiboken converter is retrieved by name (QVariant::typeName()). This fails for QFlags types since QVariant::typeName() returns the fully expanded name QFlag<Enum>. Register the flags converter under that name, too, to fix this. Fixes: PYSIDE-1673 Change-Id: I23e83da34b82196d76b78fa44f67647da65737c8 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 292a8e2426b14f98f4863dc58b5bf363ca97e748) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix hang in test bug_430.py in Qt 6.3Friedemann Kleint2021-10-041-6/+8
| | | | | | | | | | | | Terminating the application via closing the last window only works when the window was actually shown. Add a call to show() and reformat code. Task-number: QTBUG-97033 Change-Id: I1e0a82d1baf1676de5a38c1a8fd2408e104b464a Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 01b31e518ce4fa82c58db6ae89f481be152eb4dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide6: Add QAccessible::installFactory()Friedemann Kleint2021-08-312-0/+164
| | | | | | Fixes: PYSIDE-1650 Change-Id: I05926888aa4de8c3a34c712ed2000ba59e524833 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyPySide: Skip all tests which use reference countingChristian Tismer2021-08-3017-35/+62
| | | | | | | | | | [ChangeLog][PySide6] Tests which use reference counting need to be skipped in upcoming PyPy builds. Task-number: PYSIDE-535 Change-Id: I5dca3257d3dc40f53e9b4e4a69e24c07938047c2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* py3.10-prep: Finally support Python 3.10Christian Tismer2021-08-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | After the major problems are solved in py3.10-prep: re-implement zip import py3.10-prep: reset the type cache after feature switching py3.10-prep: Fix parser.py for changed typing module , there are only some minor changes left to do. One thing is still not clear: * Unsolved: In time_test.py, the last two tests work but crash at shutdown. It is not yet clear if this is a PySide or Python error. This will crash Python 3.10 if not solved until the release. [ChangeLog][PySide6] Support Python 3.10. This is by 99% solved. Looking for a crash with unknown origin. Fixes: PYSIDE-1436 Change-Id: I94cffa7ed16a2651e09924fe5babc188b1b4c2b8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* pathlib: support all cases which are found in the examplesChristian Tismer2021-07-061-1/+1
| | | | | | | | | | | | Wherever possible/useful, os.fspath was removed and the according pathlike modification inserted. This is still not the awaited end of the conversion, but a good step forward. Task-number: PYSIDE-1499 Pick-to: 6.1 Change-Id: I0a22ddeec06ada05dc4a97ed104d06f5f1bbf472 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Add QKey support for the setShortcut methodCristian Maureira-Fredes2021-06-182-2/+5
| | | | | | | | | | | | | | | | | | When this method is used in Qt/C++, the argument gets internally cast to a QKeyCombination if it is a QKey, but in Python land this is not automatically covered. A workaround was for the users to manually cast the QKey, but this adds an extra step to achieve the same. This patch adds a new method to QAction and QAbstractButton to use setShortcut with a QKey as an argument. Pick-to: 6.1 Change-Id: I9e9ebe16a65cb5aeb26a367faecbbbd414d80e03 Fixes: PYSIDE-907 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Purge remaining app.exec_()Friedemann Kleint2021-05-175-5/+5
| | | | | | | | Add a porting note. Pick-to: 6.1 Change-Id: I4ccb1dc2a3a5925e55e94e7f3d23b1fb199afe4a Reviewed-by: Christian Tismer <tismer@stackless.com>
* tests: use exec() instead of exec_()Cristian Maureira-Fredes2021-05-0424-27/+27
| | | | | | Change-Id: I0868f70d7dfeafa7762296da5aa6efc2f32fcb5e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Tests: Fix some space-related flake8 warningsFriedemann Kleint2021-04-29126-172/+409
| | | | | Change-Id: I9b0ad08839bf1246620c557ec304dfa90882907b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Tests: Use new form of super()Friedemann Kleint2021-04-2823-32/+32
| | | | | Change-Id: Id0a6c5e67f53623cc6d41ccc377218479931ee65 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Tests: Use per-class importsFriedemann Kleint2021-04-2723-133/+155
| | | | | Change-Id: I6dac1f54152fecab7af6831bc3c813a016408aae Reviewed-by: Christian Tismer <tismer@stackless.com>
* Tests: Fix star importsFriedemann Kleint2021-04-2730-50/+69
| | | | | Change-Id: If4e1d64af662b1802f2f748121bda5488a82235a Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use f-strings in testsFriedemann Kleint2021-04-135-6/+8
| | | | | Change-Id: I52f92326fdd903078cce5b6408d96d742bfa42b8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Port tests to pathlibFriedemann Kleint2021-04-061-2/+3
| | | | | | | | | | | | | Replace test helper function adjust_filename() by pathlib handling. Add asserts on the existence everywhere. Add error handling with helper functions to QML loading, printing the error message in the assert statements. Task-number: PYSIDE-1499 Task-number: PYSIDE-1532 Change-Id: I206929effb37f21d1f621be921bb996162398b4d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* signature: remove inspect and typing from special PySide6 modulesChristian Tismer2021-04-011-1/+1
| | | | | | | | | | inspect and typing are removed from the signature module and the official ones are used. This is done as a clean-up before re-writing generate_pyi.py . Task-number: PYSIDE-1415 Change-Id: I3b580805775962447e65a2d7593ecf737e97536c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Switch from os.path to pathlib.Path, systematic test changesChristian Tismer2021-02-08135-151/+284
| | | | | | | | | | | | | | | | | | This patch does the systematic changes on all tests. Note that there was a bug in principle: os.path was used without importing os.path This worked through the way how the os module initializes itself, but you always will find the explicit import in the python library. But the problem is going away anyway after the transition to pathlib.Path :) Change-Id: I95144d7f9bb07a38376c3aa428df663f2e64bcb7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* move "shiboken6/shiboken6" to "shiboken6/Shiboken"Christian Tismer2021-02-062-7/+6
| | | | | | | | | | | | | | | | | | | | | Modifying the paths to work in the new way is a quite ambitious task. But doing so improves the overall project structure and makes imports unambiguous. This patch should not be applied alone but with move "shiboken6/shiboken6" to "shiboken6/Shiboken" temp The reworked version of this patch no longer has different structures in `build` and `install`. Tested with Python 3.6, 3.7, 3.8, 3.9 debug build Python 3.6 debug install Python 3.9 release install Task-number: PYSIDE-1497 Change-Id: Id9d816dd825907f9359651e7e2f69f54e1ba46c9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* tests: remove old files and rewrite python 2Cristian Maureira-Fredes2021-01-051-6/+1
| | | | | | | | | | | Some utilities from the tests directory were still around, and are not currently used. Additionally, there were still some old non active tests with Python 2 directives; updating them in case we reactivated them. Pick-to: 6.0 Change-Id: I24aff3396041aa780dab94e70793cb62adea2b3c Reviewed-by: Christian Tismer <tismer@stackless.com>
* python3: remove all obsolete "from __future__" import statementsChristian Tismer2020-11-091-2/+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>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-02138-0/+10027
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>