aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix include conventionsFriedemann Kleint2022-04-221-4/+4
| | | | | | | | | Reorder includes such that local includes are first, followed by Qt and C/C++ system includes. Pick-to: 6.3 6.2 Change-Id: Ib801d34de7242befce4be429bfb099ccabe1f987 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* qimage_test.py: Split out XPM test data to a separate fileFriedemann Kleint2022-04-202-234/+263
| | | | | | | Pick-to: 6.3 Task-number: PYSIDE-1859 Change-Id: Ie85edc9c8dc6814fa00c22b3a5b22a1f839dea97 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Write smart pointer constructors/reset methodsFriedemann Kleint2022-04-201-1/+23
| | | | | | | | | | Enable the generation and invalidate the pointee passed in in case it is a wrapped class. Task-number: PYSIDE-454 Change-Id: I4c751d9e8731a6f70e4ecc0f808cb204f010f9b2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add readBytes and writeBytes functions from QDataStreamShyamnath Premnadh2022-04-081-3/+18
| | | | | | | | | | | - along with the addition of these functions, a common.xml is created to stores all the common templates Task-number: PYSIDE-890 Pick-to: 6.2 Change-Id: I4fadfe77a38635f15a7aef04adeac949c2d61b5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QAction: Add setMenu() and menu()Cristián Maureira-Fredes2022-04-081-1/+12
| | | | | | | | | | | | | | | | | | | | After the changes in Qt6 related to moving QAction completely to QtGui, the 'on-demand' functions associated to QMenu were not properly exposed. This patch manually adds setMenu()/menu() using QObject's. A simple test case was added. [ChangeLog] QAction.setMenu() and QAction.menu() were implemented. Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Pick-to: 6.2 Fixes: PYSIDE-1627 Change-Id: Ib8102a9cf513ee2e13ff71751b1167ca0146af31 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add a test for QSharedPointerFriedemann Kleint2022-04-076-0/+172
| | | | | | | Pick-to: 6.2 Task-number: PYSIDE-454 Change-Id: I2cb352390a9c6fcc32f8ef871a6de3023ab03237 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add QPyQmlParserStatusFriedemann Kleint2022-04-013-0/+119
| | | | | | | | | [ChangeLog][PySide6] class QPyQmlParserStatus for handling QML parser status changes has been added. Fixes: PYSIDE-1876 Change-Id: Ic1066924ec85dc8633f959342921c1d03da1aee4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix QMetaProperty::Write(..)Shyamnath Premnadh2022-03-311-1/+8
| | | | | | | | | | | | | | | Change 108d82d2ca5323652a50706b37f829b9f0457367 introduced a regression that when enum is passed to a QVariant and that QVariant is processed from C++, it does not work as expected. This patch handles the case of enum, separately for the function under consideration. Pick-to: 6.2 Task-number: PYSIDE-1870 Change-Id: I5d002cb36f23d8763de737578af7b52d8259a306 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix failing test qimage_test.pyFriedemann Kleint2022-03-211-0/+2
| | | | | | | | | | qtbase/019d0dd4b49d5a0e9cbb73829158e798ea25fd86 extended QImage::operator==() to also compare the color space. This causes image comparison to fail when reading from file and converting. Pick-to: 6.2 Change-Id: I302998954ce24fc4a6ae1823dea7c62f23031bcd Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPy: Fix timeout in bug_997.py, take 2Friedemann Kleint2022-03-122-11/+14
| | | | | | | | | | | | | | | Amends 6ffb2c3e852e2153b0c58ac659e7d8b60b691f19. The QML component is usually complete even before the window shows. Signal complete from QML and do not enter the event loop if that is the case. Pick-to: 6.2 Task-number: PYSIDE-1843 Task-number: PYSIDE-535 Change-Id: I7c68b7e16c197d9ec97e83cebb5b7919a5de71dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: fix a bunch of pseudo-errorsChristian Tismer2022-03-116-0/+15
| | | | | | | | | | | | | These ten errors could be removed. There were more GC calls needed. Sometimes, calling GC twice did the trick. We are now at 14 core errors, 18 in total :) Task-number: PYSIDE-1843 Task-number: PYSIDE-535 Change-Id: Iafb3f93682639ba28e5326f3b8cdebf6670a7b69 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPySide: disable __feature__ completely, temporarilyChristian Tismer2022-03-114-12/+27
| | | | | | | | | | | | | | | | | | | PyPy is currently not able to handle feature switching. This was disabled, internally only. Be more consequent and avoid a misleading feature that does not work. This will be re-enabled as soon as PyPy is able to exchange class dictionaries. [ChangeLog][PySide6] Feature switching is not only disabled, but also syntactically not allowed in PyPy. Task-number: PYSIDE-535 Change-Id: Ic6a9ef3233db787e050a1ee5c913c24ae6650168 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPy: Fix tests with timeoutsFriedemann Kleint2022-03-103-6/+22
| | | | | | | | | | | | | | | bug_997.py: Stop the timer. qqmlnetwork_test: Move the closing logic to a local function since the network factory classes are in a different thread. qquickitem_grabToImage.py: Use a longer timeout. Pick-to: 6.2 Task-number: PYSIDE-1843 Task-number: PYSIDE-535 Change-Id: I34a09739431cec4de8e68f455dc771a03527e526 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix some tests checking delection for PyPyFriedemann Kleint2022-03-071-0/+11
| | | | | | | | | Add gc.collect(). Task-number: PYSIDE-535 Task-number: PYSIDE-1843 Change-Id: Ia52e53a42cb6fa266dfabcec607fb3391eb9d22a Reviewed-by: Christian Tismer <tismer@stackless.com>
* Expose QtGui's qFuzzyCompare() overloadsFriedemann Kleint2022-03-041-2/+9
| | | | | | | | | | | They are declared as friend functions of the respective classes only; so, declare them in the type system file. Remove the QMatrix overload since the class was removed. Fixes: PYSIDE-1840 Pick-to: 6.2 Change-Id: Ia49eab4219918ea939df95f103d56c17519e8e4e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add QtNfcFriedemann Kleint2022-03-042-0/+56
| | | | | | | | | [ChangeLog][PySide6] QtNfc has been added. Task-number: PYSIDE-1570 Change-Id: I7c2832f8529732f1d6cc0abbb1dd2a60f59682a1 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix grouped QML propertiesFriedemann Kleint2022-03-033-0/+172
| | | | | | | | | | | | | Register the meta type using QQmlMetaTypeInterface and use them when creating properties in the dynamic metaobject builder. This at least fixes grouped properties when decorators are used. It does not work when using plain qmlRegisterType() due to an ordering problem. Fixes: PYSIDE-1836 Change-Id: I06db020a1ccd169da7a745cc5ef42d38ce35f5f5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix signals/slots with non-QObject object typesFriedemann Kleint2022-02-281-1/+36
| | | | | | | | | | | Add meta type registrations for pointer types. Pick-to: 6.2 Fixes: PYSIDE-1827 Change-Id: I771ab6d2c075ec1cb7d9153bc7a8ddc47642dc83 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* __feature__: rework constructor handling of both featuresChristian Tismer2022-02-221-6/+60
| | | | | | | | | | | | | | | | | | | | | | 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>
* Fix the multimap/hash conversion and add the testFriedemann Kleint2022-02-211-0/+1
| | | | | | | | | | | | Avoid iterating over end by removing the increment from the outer loop. Amends 20b207f41b72f857acc1a747ea06f4f657d7d1ea. Pick-to: 6.2 Change-Id: I1adba4c847fa060f594e6eb0c7d2e48356bd1746 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix QLowEnergyServiceData.chacteristics()Friedemann Kleint2022-02-172-0/+78
| | | | | | | | | | Change the data types to be value types since lists of instances are returned from the function. Pick-to: 6.2 Fixes: PYSIDE-1824 Change-Id: I7e0006f2cddef412fd26cb09c43d01474d30d54b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add the QmlAttached decoratorFriedemann Kleint2022-02-163-0/+172
| | | | | | | | [ChangeLog][PySide6] The QmlAttached decorator has been added. Task-number: PYSIDE-1709 Change-Id: I0301ecc7a9bc7a1b798095e8972b2fe4addf2eaf Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add the QmlExtended decoratorFriedemann Kleint2022-02-163-0/+134
| | | | | | | | | [ChangeLog][PySide6] The QmlExtended decorator has been added. Task-number: PYSIDE-1709 Change-Id: I56d1c75f281f37e9d23c64362ce89c5f1f49723a Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* __feature__: Fix true_property overridingChristian Tismer2022-02-111-1/+21
| | | | | | | | | | | | | | | | | | | It was assumed that an override of a property would not make any sense, and the feature was disabled. An example showed that it _does_ make sense, and this works without any effort. This does not fix other problems which are still there, like correct handling of renamed implicit function calls. This will be addressed in another change. [ChangeLog][PySide6] true_property overriding was enabled. Change-Id: Ic22f05c6c999e7f97c47161d95e785c952168bb6 Fixes: PYSIDE-1765 Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add the @QmlForeign decoratorFriedemann Kleint2022-02-113-0/+111
| | | | | | | | [ChangeLog][PySide6] The @QmlForeign decorator has been added. Task-number: PYSIDE-1709 Change-Id: I7dbba47923efb6a1c3ac4accb2b3adcd3fb6fd9b Reviewed-by: Christian Tismer <tismer@stackless.com>
* __feature__: Fix snake_case handling on user defined classesChristian Tismer2022-02-101-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | The snake case feature filters candidate methods and turns them into snake case. This works fine for built-in classes. The assumption is that all methods come from the tp_methods list. This assumption is not correct when applied to user defined classes. The methods have no static source in this case. To distinguish here, we inspect the tp_methods list. If it is empty, we assume a user defined class and do nothing. A forgotten initialization in feature.py was added, too. As a note: RHEL has such an old Python version that does not have MethodDescriptorType in the types module. [ChangeLog][PySide6] snake_case handling now does explicitly not touch user defined classes. Fixes: PYSIDE-1702 Pick-to: 6.2 Change-Id: Idfa16cdc50cb7234c1d2f473dfae3a568887547e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add the @QmlNamedElement decoratorFriedemann Kleint2022-02-091-3/+3
| | | | | | | | | | | Add the decorator and split the registration functions in order to be able to pass a different type name. [ChangeLog][PySide6] The @QmlNamedElement decorator has been added. Task-number: PYSIDE-1709 Change-Id: I081cd33313d7b9c19cb6403ee56ac9d8b1d9e606 Reviewed-by: Christian Tismer <tismer@stackless.com>
* CMake: pyside: Add support for cross-buildingAlexandru Croitor2022-02-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | The pyside project will be cross-compiled either if CMAKE_CROSSCOMPILING is set to TRUE (which is usually set by a CMake toolchain file or computed by CMake itself) or if QFP_SHIBOKEN_HOST_PATH is provided on the command line. Various code is added to ensure the correct target Qt, Python and Shiboken libraries are found, as well as host Qt and shiboken tools. These are specified to the project by setting one of the following vars: - QFP_QT_TARGET_PATH (for device Qt libs and includes) - QFP_PYTHON_TARGET_PATH (for device python libs and includes) - QFP_SHIBOKEN_TARGET_PATH (for device libs) - QFP_SHIBOKEN_HOST_PATH (for host shiboken generator) - QT_HOST_PATH (for host moc and friends) When cross-compiling, pyi file generation is disabled because it's not possible to run a target python interpeter on a host machine. It might be possible to do that by using qemu userland emulation in the future. Task-number: PYSIDE-802 Task-number: PYSIDE-1033 Change-Id: Ifa101e90d83397fa19132f9f0ce21e03b3523a74 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Refactor code snippets for QByteArray::__msetitem__()/__mgetitem__()Friedemann Kleint2022-02-031-4/+4
| | | | | | | | | | | | | | Fix integer types, move variable declarations to initialization, remove superfluous variables. As a drive-by, fix spelling in the test. Pick-to: 6.2 Task-number: PYSIDE-1804 Change-Id: I7ed4e69ae850a63d7e213a31cb078aa40e597fb2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: Fix locker handling which enables MandelbrotChristian Tismer2022-02-032-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not only the QPainter, but also the QMutexLocker were not correctly modelled after PEP 343 in the examples. Since that is now fixed, we consider the PyPy project not as ready, but good enough to publish it. It also turned out that people have the expectation to use QSignalBlocker in the "as" form: with QSignalBlocker(self.double_spin_box) as blocker: self.double_spin_box.setValue(2.5) https://stackoverflow.com/questions/60384734/how-to-use-qsignalblocker-in-python But that blocker would be None. As a side effect, QMutexLocker, QReadLocker, QWriteLocker and QSignalBlocker were augmented with a default __enter__ implementation that returns the locker instance. [ChangeLog][PySide6] The Mandelbrot example needed context managers for QPainter and QMutexLocker to work in PyPy. Task-number: PYSIDE-535 Pick-to: 6.2 Change-Id: I2a62ca645a4fddcafbf11869f14a538141f32c39 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Clean up QtWidgets testsFriedemann Kleint2022-02-0218-62/+47
| | | | | | | | | | | | | | Many QtWidgets tests do not require classes from QtWidgets any more due to splitting out the QtGui module and moving further classes into it. Move the tests to the proper module. As a drive by, move some misplaced tests from QtGui into QtCore or QtWidgets, respectively. Pick-to: 6.2 Change-Id: Ib995ce6556fceff4eb8ec8ac9b25680834a2426f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Convert QVariant to Enum typesShyamnath Premnadh2022-01-301-2/+70
| | | | | | | | | | | | | | | | Before this patch, the conversion from QVariant->enum in Shiboken was same as the conversion from QVariant->int. So, the user will have to explicitly convert the returned integer to the original enum type. With this patch, an enum type is considered as an Object type rather than an int type. This enables the enum type to be considered as itself. Added tests for all conversions of QVariant types. Pick-to: 6.2 Fixes: PYSIDE-1798 Change-Id: I18acc08e1f59ac7df844444d0ad6950e1d70ab21 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Long live pyside6-metaobjectdump!Friedemann Kleint2022-01-277-0/+99
| | | | | | | | | Add a tool to print out the metatype information in JSON to be used as input for qmltyperegistrar. Task-number: PYSIDE-1709 Change-Id: Ie57feeeecc09b1a01aadcc08f7e529a16609b3a4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: Turn most QPainter instances into context managersChristian Tismer2022-01-264-20/+14
| | | | | | | | | | | | | | | After the new context manager is in place, most of the examples benefit from moving QPainter into a `with` statement. The comments concerning PyPy could be removed, again. [ChangeLog][PySide6] The examples are updated to use the new context manager for QPainter. Task-number: PYSIDE-535 Change-Id: Idf7e1f734d549ed663383ffbb2416297ebb1e0c7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: Implement a context manager for QPainterChristian Tismer2022-01-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Context managers existed in Python since 2005 (PEP 343). They were invented to support resource management for different Python implementations that cannot rely on immediate object destruction. PyPy is the first alternate Python implementation that can run PySide. QPainter does not work in PyPy without an explicit end() call. For convenience, we supply a context manager that handles this. Like in file I/O, we now prefer instead of painter = QPainter(paintable) the new indented form with QPainter(paintable) as painter: [ChangeLog][PySide6] QPainter has become a context manager. Using a with statement saves the need to call painter.end() . Task-number: PYSIDE-535 Change-Id: Ib8bebbe121dc08334d31c9663a1e5bc8042c3b62 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPySide: fix a few more cases of QPainter without end()Christian Tismer2022-01-262-1/+4
| | | | | | | | | | | This will be replaced by a context manager, soon. Also, begin and end should not simply return a boolean but raise an exception when something serious broke. Task-number: PYSIDE-535 Change-Id: Ieb2f845a01105381aab539e04b964de7a551d739 Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Safe distinction of Nuitka compiled methodsShyamnath Premnadh2022-01-182-0/+60
| | | | | | | | | | | | | | | | | | Adds an extra check to see if __code__ is present. As mentioned in PYSIDE-1755, Mocks are callable objects without __code__ attribute, unlike Python Method or Functions. However, a Mock also has im_func__ and im__self attributes. We made the assumption __code__ would be present if im_func and im_self are present, and this makes it fall under the category of a compiled method. This patch makes an extra check to see if __code__ is present. If it is not, then the Slot (here Mock) is considered as a callable method. Task-number: PYSIDE-1755 Pick-to: 6.2 Change-Id: If7e8f52dfb2409cd856eec0d0b41891d751d8a69 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* signal: Fix equality test for inherited signals, updateChristian Tismer2022-01-121-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Signal initialization was improved by walking the MRO to find all signals. But this had the side effect that signals could be overwritten. This implementation resolves signals only once per name, so that only the most recent signal places an instance into the instance dict. Note: this does _not_ solve the equality problem of super().signal == super().signal # fails because the super call triggers a new signalInstance in the parent. This has to be addressed in a bigger rewrite if desired. [ChangeLog][PySide6] Signal initialization now respects the order of subclasses in the mro(). Change-Id: I7481576798ca272ebebf8e9a5ba875cfc94e8361 Fixes: PYSIDE-1751 Pick-to: 6.2 Task-number: PYSIDE-1431 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Speed up test qqmlnetwork_test.pyFriedemann Kleint2021-12-171-2/+5
| | | | | | | | | | Instead of relying on TimedQApplication to tear down the test, wait until the network request is started and start a timer to close the window. Pick-to: 6.2 Change-Id: Ib68f97d8fb57503b7e1a228fbd54755e986a8605 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix QQmlApplicationEngine.load(str) to not construct a QUrlFriedemann Kleint2021-12-153-0/+112
| | | | | | | | | | | | | | Specify the overload number so that string is checked first. Add a test since QQmlApplicationEngine is not yet tested. Amends 2cc81fd5e63bf931d8c9d1c8c2c66ac9e16ef087. Pick-to: 6.2 Fixes: PYSIDE-1736 Task-number: PYSIDE-1499 Change-Id: I1736928f1acf17fda5671bd11d16c5017141f1ff Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: build multiple inheritance pass-through for SignalsChristian Tismer2021-12-144-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | Signals always had support for calling a method that is sitting at the same place as a signal with the same name. This is done by letting the signal act as a proxy for the hidden method. Lately, the equality check of signal instances was corrected (PYSIDE-1431) which had the side effect that now some method lookups failed in multiple inheritance. This patch extends the search for homonymous methods to look not only in the signal attribute, but extends the lookup along the whole tp_mro. The related tests were slightly re-arranged to keep them together. [ChangeLog][PySide6] Signal instances allow pass-through of methods with the same name, explicitly and with multiple inheritance. Change-Id: I92828855ada7aa8d98517918008b93fc79629d8e Fixes: PYSIDE-1730 Task-number: PYSIDE-1431 Pick-to: 6.2 5.15 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move the QML registration code into a libraryFriedemann Kleint2021-12-081-1/+2
| | | | | | | | | This makes the code easier to maintain. Task-number: PYSIDE-1709 Change-Id: Idb75143a7e6d218637ab75463db88b6135cd4086 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Signature: fix the __doc__ attribute of classesChristian Tismer2021-12-071-0/+10
| | | | | | | | | | | | | | | | | | | The signature module had been changed to no longer default the __doc__ attribute of classes to the __init__ signature. This has the side effect of crashing "help(QtCore)". Fixed by correct defaults in C++ (AttributeError) and by setting a "None" default in the Python handler. The make_helptest function defaults again correctly to the signature: >>> errorhandler.make_helptext(QtWidgets.QApplication) 'QApplication(self) -> None\nQApplication(self, arg__1: Sequence[str]) -> None' Change-Id: I140f2b940f98eb126541b18b0feb312c7c4e9728 Fixes: PYSIDE-1727 Pick-to: 6.2 5.15 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Prospective fix for stabilizing qthread_signal_test.pyFriedemann Kleint2021-12-071-20/+15
| | | | | | | | | | | | | Instead of using a flags handshake and busy loops, let the thread run its own event loop and terminate it by signals. Start the signal emission sequence by a timer to ensure the app is running. As a drive-by, modernize the code. Pick-to: 6.2 Change-Id: I880674c7dc46a8259e878014fb14a90d01133804 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Prospective fix for stabilizing test qthread_prod_cons_test.pyFriedemann Kleint2021-12-071-9/+3
| | | | | | | | | Terminate the test only by the consumer. Verify the wait() statements. Pick-to: 6.2 Change-Id: I811dd48c6522319efc7351bad683c6d3a6e25def Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Prospective fix for stabilizing test QtCore_bug_686Friedemann Kleint2021-12-071-8/+8
| | | | | | | | | | Move the modification of the variable into the locked scope. Try to avoid busy wait by using QThread.msleep(). Pick-to: 6.2 Change-Id: I86be86b7e3257cdb734e82d274f98f1f55b6163d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: Skip AssertRaises which needs a PyPy fixChristian Tismer2021-12-062-0/+10
| | | | | | | | | | | | Seven tests create an RPython: NotImplemented error that needs fixing in PyPy. We skip the error until solved, but keep an entry in blacklist.txt in order to not forget about the fact. This brings the error count from 30 down to 23. Task-number: PYSIDE-535 Change-Id: I36c8d3e3e4b5b24508bae884a392f976c41964da Reviewed-by: Christian Tismer <tismer@stackless.com>
* Speed up paint_event_test.py, qpen_test.py and virtual_pure_override_testFriedemann Kleint2021-12-063-24/+11
| | | | | | | | | | Start a timer to close the window as soon as paintEvent() is called instead of waiting. Pick-to: 6.2 Change-Id: Id7a0e1123e148bdc8ba142ccbe0ff9d7a02c77dd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* tests: Use QGuiApplication where applicableFriedemann Kleint2021-12-0623-47/+47
| | | | | | | Pick-to: 6.2 Change-Id: I9401fa0721ea6e3df413c5a9fccb5e802d57295d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Speed up qtreewidgetitem_testFriedemann Kleint2021-12-021-3/+0
| | | | | | | | There is no need to show a widget here. Pick-to: 6.2 Change-Id: I914e6c43ca398cf9fffd27d2f182c8ad47c9a0f6 Reviewed-by: Christian Tismer <tismer@stackless.com>