aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Add license headers to cmake filesFriedemann Kleint2023-02-1613-0/+39
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Task-number: QTBUG-105718 Task-number: QTBUG-88621 Change-Id: I98bd2e80f182d8bf7aef6b633f37a428e2dac69b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* testing: make multiple_feature_test.py less verboseChristian Tismer2023-02-131-4/+8
| | | | | | | | | | | | The test writes out very much when there is any error happening in CI. With NoGIL, this becomes very boring. It now only prints if the "-v" flag is given. Task-number: PYSIDE-2221 Change-Id: I511b1fd56407a875797cfec958f5e0beff42f7a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* NoGIL: Disable opcode tests in enum_test.pyChristian Tismer2023-02-091-0/+2
| | | | | | | | | | | | The enum_test.py uses opcode inspection to make sure that changed opcodes hopefully trigger an error. For the immature NoGIL Python version, this makes no sense. Task-number: PYSIDE-2221 Change-Id: If101f49f97c5120a84672581d24336999718611a Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Adapt to Qt 6.5Friedemann Kleint2023-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | - Add new enums - Hide field QMetaMethod::mobj made protected by qtbase/0b701ec0cd86afbf6bb0d0abb361cfb6500c2e1b - Adapt to PDF qtwebengine/6769bd1544c56a514fe35bf16d05614605a49bea - Adapt to qhttpserver/55d10201dc7a47b239825548e053c1fb0de61115, adding a virtual method with rvalue reference to QAbstractHttpServer - create_wheels.py: Adapt to changed location of the metatypes directory in Qt after qtbase/4234ce12dc819b9ca76c8dc4c251f5bd4fe0bc9c. - Adapt error column in QDomDocument test - Fix QMetaObject::invoke() to work after qtbase/fe92b080658f0d8609e2a2a69e5ec2b51dd7bf9d by making the cast of the helper types to Q(Generic)ReturnArgument explicit in the snippets Change-Id: Ifb514878e999ad4c9ef00ff83172626eff112a3d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* signals: Introduce Weak Reference to protect lost SignalInstanceChristian Tismer2023-02-021-1/+26
| | | | | | | | | | | | | | | | This first solution detects the vanishing object and raises an exception. Trying to revive the object was unsuccessful. Since this happens only when no signals are connected, it is ok to leave it this way. Change-Id: Ib47f85657363b675cec3616b5550ce41d93fb4d3 Fixes: PYSIDE-2201 Pick-to: 6.4 Task-number: PYSIDE-79 Task-number: PYSIDE-68 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Add order depending on type range for C++ primitive types to the ↵Friedemann Kleint2023-01-091-0/+5
| | | | | | | | | | overload sorter Task-number: PYSIDE-2168 Task-number: PYSIDE-2133 Change-Id: I81e9d3369b1f4533239a172f48d11f52731f8484 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* PySide6: Fix negative values causing an error in QLocale.toString()Friedemann Kleint2023-01-091-0/+6
| | | | | | | | | | | Apply the same filtering as introduced for toCurrencyString() by 52e3b960b30950ac7bb59bb31e00d6d1038828f1 to prevent unsigned overloads from being generated. Fixes: PYSIDE-2168 Pick-to: 6.4 6.2 Change-Id: I3b74e9db238e9b4f34fd7bc1ff7a3a5ac7682d37 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix test_pyside6_qml.pyShyamnath Premnadh2023-01-051-1/+1
| | | | | | | | | | - has dependency on QtQuick when running the rest - removed QtQml check for disabling the test because QtQuick should cover QtQml automatically Pick-to: 6.4 Change-Id: I762669290bf8e9ab282024f1a040548ebfcf2297 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Deploy tool: Reduce QML executable size + testsShyamnath Premnadh2022-12-291-16/+111
| | | | | | | | | | | | | | - Added more Nuitka options to reduce the size of QML executable. Some binaries which cause the QML executable to become heavy eg: QtWebEngine are removed, if they are not used - Add new log messages for --verbose option - Add deploy.pyproject file - Modifies pyside6-deploy tests to consider the QML options, by mocking pyside6-qmlimportscanner Task-number: PYSIDE-1612 Change-Id: Id2e94217e99eedbf41ecfc8de1a37e94c7edaa52 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* deploy tool: fix dry_run testShyamnath Premnadh2022-12-292-50/+32
| | | | | | | | | | - instead of using subprocess module to execute the deploy.py file directly, call the main() in deploy.py. This also enables mocking deploy tool functions. Task-number: PYSIDE-1612 Change-Id: Ia4eb43ff9f514a732399ea406ee15f94b4ffdf6d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* __feature__: Fix a weird case of false metafunction lookupChristian Tismer2022-12-131-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | PySide implements duck-punching since 2010. This could create a problem with true_property since 06/2019, because a meta-function could be found in the instance dict of a QObject class, although the methods were replaced by a property object. This was an unexpected reaction of the `getMetaDataFromQObject` function. Meta methods were created and inserted into the instance dict, which caused very unrelated side effects like infinite recursion. The new implementation handles Python properties correctly and looks up the hidden methods if necessary without side effects. There are no longer meta functions involved. The function `getMetaDataFromQObject` is misleading and was replaced by `getHiddenDataFromQObject`, keeping the old name as an alias. It will be finally removed in version 6.5 . [ChangeLog][PySide6] A callback error when using true_property was fixed. Change-Id: Ie5234eab2106885f6edad24ae7d4c55fff43d62f Fixes: PYSIDE-1889 Pick-to: 6.4 Task-number: PYSIDE-1019 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix QObject::sender() for non-C++ slotsFriedemann Kleint2022-12-122-0/+64
| | | | | | | | | | | | | | | For non-C++ slots routed via GlobalReceiverV2, sender() of the receiving QObject returns 0. To fix this, store the sender obtained in GlobalReceiverV2::qt_metacall() temporarily in a special dynamic property of the receiver and inject code checking it into QObject::sender(). This fixes at least the synchronous calls. Fixes: PYSIDE-2144 Fixes: PYSIDE-1295 Change-Id: Ia111162eb1404914ecfb7f19fadb8a1b63ae8b4a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Remove pyqt_diff.pyShyamnath Premnadh2022-12-071-39/+0
| | | | | | | | | | - don't see the use case of this with the missing_bindings tool supporting all the available cases of comparing PySide6 and PyQt6 Change-Id: Ia77755b892620d60bfbdccb97008e6a846bd5ef0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide Tools: Deploy Tool TestsShyamnath Premnadh2022-12-052-0/+184
| | | | | | | | | | | | - test --dry-run in different scenarios for widgets and qml In this particular case, running --dry-run is equivalent to mocking Nuitka because the output command is the command run by Nuitka - tests the contents on config file for widgets and qml deployments Pick-to: 6.4 Task-number: PYSIDE-1612 Change-Id: I4624bdc71f9ccd027147ca10a942037d6c43fbfc Reviewed-by: Christian Tismer <tismer@stackless.com>
* Build system: Fix broken find_package() statementFriedemann Kleint2022-11-301-1/+1
| | | | | | | | | Amends c199b64bcbcaeb55ce78ce3f4e772fcdc68073f4. Pick-to: 6.4 Task-number: PYSIDE-962 Change-Id: Icb565007bf476b2512add35733409c026ab3d18f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* __feature__: heavily rework the context switchingChristian Tismer2022-11-293-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The example of the issue shows the qasync.py module which fails miserably when using snake_case. The reason: ----------- Reason is the way how feature switching is implemented. Modules like qasync get a default switching of "ignore". This ignores that the qasync module itself imports QtCore, and feature switching is of course relevant, suggesting a default setting of "normal" (explicitly no features). The real problem: ----------------- Testing the simple approach showed a serious problem with feature switching: The functions get switched when a certain function (getattr etc.) is called. But the switching is sometimes not done due to a caching problem. This fix removes caching that was wrong. Optimization will be done in a different step with a different approach. This Change was not qasync specific, but happens with PySide imports. Actions done: - adjust the inline structure - implement a feature_imported callback - identify Python functions that use PySide during import [ChangeLog][PySide6] __feature__ switching now works even with recursive imports like in the qasync module. Fixes: PYSIDE-2029 Change-Id: I3340f54f293083a09fb509383688f73bbd9b60ae Pick-to: 6.4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Build system: Use modern form of finding and linking Qt librariesFriedemann Kleint2022-11-291-8/+3
| | | | | | | Pick-to: 6.4 Task-number: PYSIDE-962 Change-Id: I91aed62a8e14bbc1101b4f23e25f57a5d6bca173 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* PySide6: Fix float type overloads of QLocale.toCurrencyString()Friedemann Kleint2022-11-251-0/+6
| | | | | | | | | | | | | | | | | | | QLocale.toCurrencyString() has a plethora of overloads from short/ushort to long long and float types. Since the overload sorter currently has no rules for preferring float over unsigned integer types, an unsigned conversion was done for float types with decimals, resulting in decimals being lost. This could arguably be fixed by adding rules for preferring float over unsigned integer types. However, since Python only knows int and float, it does not really make sense to generate a complex overload logic. Remove the unsigned and short overloads instead. Fixes: PYSIDE-2133 Pick-to: 6.4 6.2 Change-Id: Id2ef2ec02f4f962606851faf237d80196872eed2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* __feature__: Fix true_property inheritanceChristian Tismer2022-11-232-0/+39
| | | | | | | | | | | | | | | | | | The wrapping process creates wrapper functions for all C functions, also for those which are meant as virtual functions promoting an inherited function. Because properties appear as such additional functions, we need to convert not only according to the property strings, but also use the mro to reach the extra functions indirectly. [ChangeLog][PySide6] true_property was fixed to work with inherited properties as well. Change-Id: I176a30df77f550504f3aaf71e0c20de3e0707792 Fixes: PYSIDE-2042 Pick-to: 6.4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Purge remaining uses of old Qt string literalsFriedemann Kleint2022-11-222-10/+14
| | | | | | | | | | Amends a3e882b06eda8f9a63cf3834a99640034775269b. Pick-to: 6.4 Task-number: QTBUG-98434 Change-Id: I23ad60d6e4201aa2d8dbf3fa8892d3df3c56c5fc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add .pyproject files for the testsFriedemann Kleint2022-11-1132-0/+562
| | | | | | | | Makes navigation with Qt Creator easier. Change-Id: I40c6bc641faddcdbd265d6e886c2f3bd3b271be5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* CMake: Execute shiboken with appropriate PATH on WindowsAlexandru Croitor2022-11-091-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously one had to add the Qt bin dir and libclang.dll dir to PATH manually to ensure shiboken successfully runs when building Qt for Python using CMake without setup.py. This should not be necessary though, because the build system knows where Qt is (usually via the --qtpaths option) and where libclang is (via LLVM_INSTALL_DIR and friends). Introduce a CMake function that generates a batch shell script wrapper for a given tool. The wrapper will have PATH set to the Qt bin dir and libclang dir. Generate such a wrapper for shiboken and use it everywhere we call shiboken to generate bindings. The wrapper is only created on Windows. All mentions of Shiboken6::shiboken in custom commands now need to be wrapped in $<TARGET_FILE> because automatic target path conversion only happens if the target appears as the first argument to a custom command, and that is not the case anymore with the wrapper script being at the front. As a drive-by, the indentation of custom commands is now adjusted for easier readability and to conform with the indentation used in the Qt build system. Pick-to: 6.4 Fixes: PYSIDE-1844 Change-Id: I287adeedf234d0272c2963e96ae2aa5c4c0f0c83 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix passing dicts as QVariantMap to QMLFriedemann Kleint2022-11-082-0/+150
| | | | | | | | | | | Add the name to the known types for signal/slot signatures, preventing it from falling through to the PyObject default converter, which causes reference leaks. Fixes: PYSIDE-2098 Change-Id: Id95d8a352dd1913bd10578f1ec11de0c533e8f40 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Simplify enum signal testFriedemann Kleint2022-10-281-31/+20
| | | | | | | | | Amends df87bd0d6c55e0ab11aa68f7db99337860134510. Task-number: PYSIDE-2095 Pick-to: 6.3 6.4 Change-Id: I0a18abc35b1f6519fd8b82f98410240d8907652d Reviewed-by: Christian Tismer <tismer@stackless.com>
* fix signals with new enums on Python 3.11Friedemann Kleint2022-10-282-1/+63
| | | | | | | | | | | | Signals were not aware of new enums. Worse, the name of the metatype was changed in Python. Added a test that simulates the example. Change-Id: I80e1f220c387ab39e918bfc63d6bb5cab6025590 Fixes: PYSIDE-2095 Pick-to: 6.3 6.4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Build system: Bump versionsFriedemann Kleint2022-10-251-1/+1
| | | | | | | | | | | | State CMake 3.18+ and Python >= 3.7 Task-number: PYSIDE-2091 Pick-to: 6.4 Change-Id: Iad906a48bf4378ceeeebe5a55aeaa3f27ea0a61f Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add a way of specifying types for casting enum valuesFriedemann Kleint2022-10-191-1/+6
| | | | | | | | Fixes: PYSIDE-2088 Pick-to: 6.4 6.4.0 Change-Id: Ib571f67117403881001b51b1fda573074aa3fefc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add QtSerialBusFriedemann Kleint2022-10-141-0/+1
| | | | | | | [ChangeLog][PySide6] QtSerialBus has been added. Change-Id: I661912279fa03b51d19483b603fff830ede225a9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Fix smart pointers of type <const Pointee>Friedemann Kleint2022-10-063-0/+19
| | | | | | | | | | | | | | | | | Use the right function to strip the qualifications from the type since <const Pointee> and <Pointee> are treated identically. Fixes a regression introduced by change a262e9bae5dbdef92d5caa0e058a1ad07fa974d3. This is in principle tested in the smart binding test, but occurs depending on the order the types are seen, so, add another test. Fixes: PYSIDE-2071 Pick-to: 6.3 Change-Id: I838b1ae1dd607095b41018c973093a380f51ab6b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyEnum: Relax the Impact of New Enums and Make Everything OptionalChristian Tismer2022-09-302-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes every PyEnum feature of PySide optional. It allows to test the whole functionality. Some flags might also make sense for people who cannot use the new enums without modifications. Maybe this should be there for now for internal use, only. The flags for PYSIDE63_OPTION_PYTHON_ENUM are (hex) 1 (True) the default for PySide 6.4, full implementation 2 turn all Enum into IntEnum and Flag into IntFlag 4 re-add shortcuts for global enums 8 re-add shortcuts for scoped enums 10 don't fake shortcuts (forgiveness mode) 20 don't fake rename (forgiveness mode) 40 don't use zero default (forgiveness mode) 80 don't allow missing values in Enum A startup setting of for instance PYSIDE63_OPTION_PYTHON_ENUM=6 should work in most cases, avoiding the fall-back to old enums. Task-number: PYSIDE-1735 Change-Id: I636c4d9f8e671f5185058820605da73f688c16b0 Pick-to: 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyEnum: Increase Compatibility by allowing any int as enum valueChristian Tismer2022-09-261-7/+2
| | | | | | | | | | | | | | | | This patch supplies a _missing_ function to every (Int)?Enum class that creates the given integer as a nameless enum. The missing object is created on-demand and kept in the dict "_sbk_missing_" for re-use. [ChangeLog][PySide6] New Python Enum/IntEnum now allows for missing values like the Shiboken enums before, increasing compatibility. Task-number: PYSIDE-1735 Task-number: PYSIDE-841 Change-Id: I436b536e0a29337663cc3bca5db4322d9cf0de74 Pick-to: 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move examples aroundFriedemann Kleint2022-09-162-2/+2
| | | | | | | | | Change the directory structure to closer match that of Qt. Task-number: PYSIDE-841 Change-Id: I87aca346b6654aafe94dd1fb83c184c182ceb2e6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Add QtGui function qt_set_sequence_auto_mnemonic()Friedemann Kleint2022-09-161-1/+4
| | | | | | | | | | | The function is exported, but not declared in Qt; requiring some declarations. Fixes: PYSIDE-2059 Change-Id: I682483553ea1a46b978f57e991cabe4b303607f3 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>
* Remove QtWinExtrasFriedemann Kleint2022-09-091-1/+0
| | | | | | | Task-number: QTBUG-89564 Change-Id: Iee2e2ac1acc608c746f84e9a28295b0016a4deed Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix TypeError when comparing Qt.Flags and objectsAdrian Herrmann2022-09-081-0/+19
| | | | | | | | | | | | | Comparing a QtCore.Qt.Flags object with any other object calls the PySideQFlags_tp_richcompare() function. This function always threw a TypeError when comparing to a non-numerical object, causing undesired effects. Account for these cases now by returning True or False if the compare operator is != or ==, respectively. Pick-to: 6.3 6.2 Fixes: PYSIDE-2048 Change-Id: Ic81a65ace743b57e90ffe7883e42eb8330b78832 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add QtPdf/QtPdfWidgetsFriedemann Kleint2022-09-072-0/+2
| | | | | | Change-Id: I00073b583c8c84e764a8693b50af44b3b91d55eb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add setters for the the lists in QValue3DAxisFormatterFriedemann Kleint2022-09-071-1/+16
| | | | | | | | | | | QValue3DAxisFormatter::gridPositions(), QValue3DAxisFormatter::labelPositions(), and QValue3DAxisFormatter::labelStrings() return non-const-references to lists for modifications. In PySide, add setters for them. Task-number: PYSIDE-2025 Change-Id: I90f788962380eb2ff95736b33533c1c09b59fdce Reviewed-by: Christian Tismer <tismer@stackless.com>
* Enable type strings in Q_ARG/Q_RETURN_ARG for QMetaObject.invokeMethod()Friedemann Kleint2022-09-061-1/+11
| | | | | | | | | | | | This enables using "QVariant", which is needed for QML. Amends aae2f599e8215e49747c9b5dce698d35b913c6c7. Remove a left-over qDebug(). Task-number: PYSIDE-1898 Change-Id: Ibbb543cfe582eba5d652dc180191c2741730c4e6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyEnum: Improve the handling of QKeyCombination, amendedChristian Tismer2022-09-021-0/+1
| | | | | | | | | | | The new QKeyCombination calls are implemented for the new enums, only. Add a @skipUnless Explicitly no pick because 6.3 has that fix. Task-number: PYSIDE-1735 Change-Id: Icf154fe9c3334e6f18ffc5dc675ed01c651785f5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyEnum: Improve the handling of QKeyCombinationChristian Tismer2022-09-011-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | After turning IntEnum into Enum, a few classes need more attention because the simple int coercion is no more sufficient. Instead, a bit of help is necessary to make the usage of the __or__ operator consistent, again. On first sight, this coercion to KeyCombination looks slightly unpythonic. But this originates in the complex matters. If you observe what types are actually added, this is very correct. Using the IntEnum version instead is not better. It is just hiding the ongoings by using int, which would also allow to combine two characters as a bad side effect. [ChangeLog][PySide6] PyEnum now handles QKeyCombination correctly with "|" or (deprecated) "+" operators, without falling back to using IntEnum. Task-number: PYSIDE-1735 Change-Id: I08b93b8b7ece75ca650f2916ec6f6f5bb711a70b Pick-to: 6.3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix random values in QFormLayout.getItemPosition()Adrian Herrmann2022-08-181-18/+15
| | | | | | | | | | | | In QFormLayout::getItemPosition() on the C++ side, *rolePtr is not set if row == -1, in which case on the Python side this gets converted to a random value outside the enum range. Fix this by setting *rolePtr to a default value in the glue code. Pick-to: 6.2 6.3 Change-Id: I0c67c771ed017f14b211fa6ccf9c89706152d214 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add support for QFormLayout::TakeRowResultCristian Maureira-Fredes2022-08-181-2/+30
| | | | | | | | | | | The struct TakeRowResult was not explicitly declared in the typesystem, leaving out some QFormLayout functions like QFormLayout::takeRow(...). Fixes: PYSIDE-1312 Pick-to: 6.2 6.3 Change-Id: I77577cb54ff9cca56435b62c4848832e79f575f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* signature: Update, cleanup and install signature testChristian Tismer2022-08-172-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | The signature tests were disabled for a long time. Meanwhile, a number of unresolved values have piled up. The reason was partially a weird mixture of intents that made it unpractical to run the full tests on every platform. Mamely, macOS was quite unclear about which signatures have to exist and which don't. This overhaul does the following: * The various Shiboken modules were removed from the tested signatures * A pure test is added that only checks for no offending lines As effect, signatures are tested unconditionally without any other conditions. The other tests remain disabled. Task-number: PYSIDE-510 Change-Id: Id9e65ed7324a795966f460e13dd95fd5cebcca6a Pick-to: 6.3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyEnum: Define a fixed list of Int(Enum|Flag) decisions, amendedChristian Tismer2022-08-151-1/+1
| | | | | | | | | | The mentioned check-in had a bug in the new enum conversion. This will not be cherry picked but directly fixed in 6.3 . Task-number: PYSIDE-1735 Change-Id: Ib9d7293e94baeeb7286e4b207fe73863fc8f5ac6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyEnum: Define a fixed list of Int(Enum|Flag) decisionsChristian Tismer2022-08-136-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was "PyEnum: Write a default Int decisor for Enum and Flag". Historically, C++ enums were all compatible with int. The new Python enums are more diverse here. There are the basic types Enum/IntEnum and Flag/IntFlag. We have tried a lot to come up with a sensible default heuristic computed from the data. In the end, this was reverted and replaced by a fixed list that was collected from similar implementations. By the move away from Int inheritance, a few classes needed extra support. Python 3.11.0b5 also required the Flag creation parameter "boundary=KEEP". It is not clear if this is correct, yet. [ChangeLog][shiboken6] Most former IntEnum/IntFlag are replaced by pure Enum/Flag classes in a generally compatible way to other implementations. Change-Id: I1dbe7b0556a3375df89eb40e9d9f495f14bf42b1 Pick-to: 6.3 Task-number: PYSIDE-1735 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyEnum: Fix QKeySequence to stay correct when switching IntEnum to EnumChristian Tismer2022-08-091-5/+14
| | | | | | | | | | | | | | | | | | | | | | Most PyEnum types will no longer be compatible with int, when we change from IntEnum to Enum. This has a number of consequences and leads to improvements in type representations. The repr of QKeySequence was actually wrong and misleading, see the test qkeysequence_test.py . We change the repr and the indexing to return QKeyCombination like our competitor does since a long time. [ChangeLog][PySide6] QKeySequence returns now QKeyCombination instances when indexed and the new PyEnums are used. Change-Id: Idaaeb44ca3b6103b3e0416eaeb691ad954745f73 Pick-to: 6.3 Task-number: PYSIDE-1735 Fixes: PYSIDE-2021 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix setting properties by named arguments for Q[VH]BoxLayoutFriedemann Kleint2022-08-091-0/+7
| | | | | | | | | Force the named arguments code to be generated for constructors of QObject-derived classes in QtWidgets. Fixes: PYSIDE-1986 Change-Id: Ibc04959091c55a51aa77021f71786ff927f78fb3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add glGet(Boolean|Float|Integer)v() to QtGui's QOpenGLFunctionsFriedemann Kleint2022-08-051-0/+1
| | | | | | | | | | | | The function return varying numbers of return values in an array. Add a helper function to determine the number. Depending on it, a single value or a numpy array is returned, matching the behavior of PyOpenGL. Task-number: PYSIDE-2013 Task-number: PYSIDE-2017 Change-Id: I8a91e491939e668932ea03eda64d83ed08ab28b3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* build: Fix a weird build problem on macOS and other platformsChristian Tismer2022-08-021-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a long existing bug in the PySide build system that had a weird effect on macOS: * building PySide with Limited API and testing worked fine. * building PySide without Limited API worked fine too, but gave crashes when testing pysidetest. It appears that macos duplicates a static Python build, one of them uninitialized. After a month with no solution, a Linux build had problems, too, but complained already in the build. It was solved by passing `--enable-shared` to the Python build. This `--enable-shared` solved the macOS problem as well. Further analysis by Alexandru led to the suggestion that the Python libraries in pysidetest are not needed at all, and by removing them, the whole problem went away. This is now confirmed on other platforms as well. The option `--enable-shared` is no longer needed in any configuration. The problem was caused by 22e359bc19daf19033332aa2d7bb9726c7f4be14 from 2020-02-18. Task-number: PYSIDE-1735 Change-Id: I08b8628e75ef9c664be30200ae295cd2e6004370 Pick-to: 6.3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyEnum: Simplify the test-cases with the new forgiveness modeChristian Tismer2022-07-144-33/+20
| | | | | | | | | | | | | | | | | | | | | | With the new forgiveness, all the "normal" uses of old enums are working with the new enums, too. What does not work are range violations and inheritance of enums from other enums. Also, the implemented trick does not work for enums which do not belong to a class. The induced bugs are easy to find, because they should normally break at import time. [ChangeLog][PySide6] The new forgiveness mode of Python enums allows to use old enum code, most of the time. Much changed test code was reverted. Change-Id: I9c081831309f1b2358fe86e6107b0f4d78fd48cf Pick-to: 6.3 Task-number: PYSIDE-1735 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>