aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Pin Qt6.3.2 sha1 and fix version for releasev6.3.26.3.2Simo Fält2022-09-083-7/+7
| | | | | Change-Id: Icf8dbe2b8bfd57cdc57715207bcd01a3f7bd5cf6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Documentation: Update the modules pageFriedemann Kleint2022-09-071-2/+60
| | | | | | | | | Remove the obsolete QOpenGLFunctions and add some missing modules. Change-Id: I824ee3c125c4fd42d07b55afe7c532c3188bec4c Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 81f75fa027076a65747109f2d8ddd9bd904d7dda) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add title to the SpinBoxDelegate docVenugopal Shivashankar2022-09-061-0/+3
| | | | | | | | | | Amends 89e5d35c0f002fcb1aac3b1205402ce306074255. Task-number: PYSIDE-1984 Change-Id: I09e74d2c3494ea263f988492cc09b2270137ad6a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit e2598d08d9db18cd5d24a8217c435dcbe212b071) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* shiboken6: Fix a crash caused by invalid return types of added functionsFriedemann Kleint2022-09-061-1/+1
| | | | | | | | | | Pass up the parse error. Task-number: PYSIDE-2046 Change-Id: I5c32b056887ac9b4b5229457e5416fa16d4b1818 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit b42c3339158c4c677e16614e698db30a3643122f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix doc warningFriedemann Kleint2022-09-061-1/+3
| | | | | | | | | | | | | | Fix warning: package_details.rst:9: warning: Literal block ends without a blank line; unexpected unindent. Amends 52d38437445f6aa979875a93702496f800b98d63. Task-number: PYSIDE-1112 Change-Id: Ifebd2c33625c0612827b9626a312450714584233 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 2748937c7335eb288c8adf6f7084fa6a3a6f6ee1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add QML window example + shared QML moduleAdrian Herrmann2022-09-0535-0/+4106
| | | | | | | | | | | | Port the Qt Quick example "Window and Screen" to PySide. This includes a "shared" QML module located in a sibling directory of the example. Task-number: PYSIDE-841 Change-Id: I7c8376701390b10d8b28bbf0ad04dce7a3089b20 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit ef8d3daa8f4d19c48e44874dd6e38a3ed4d02425) Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* example: add google suggestjaime022022-09-056-0/+303
| | | | | | | | | Ported from C++ Task-number: PYSIDE-841 Change-Id: Ib64218925961f3d0bbd783c5bb9d8365a81e8767 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 0a187a3aa58d326349d6c3415a031f0f68fdb84a)
* shiboken6: Use the full path of libdir in pkg-config fileZhu Zihao2022-09-021-1/+1
| | | | | | | | | | | | "libdir" in shiboken6.pc is the relative path to the install prefix. Fix it to the full path of directory. Fixes: PYSIDE-2040 Change-Id: I5caa54813e2104b7ebd9163ba2c5da781ac28919 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 855aaa252bdba645af19a11ea887befe06febacd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippets_translate: Speed up regexp evaluationFriedemann Kleint2022-09-022-93/+134
| | | | | | | | | | | Precompile the regular expressions and store the stripped string. Brings down user time from 2.3s to 2s, approximately. Change-Id: If929dc0c85cbe3e797bb3ec01eff9c434a8c5527 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit c0387967f81dcabe3087a741e337d01ca177d0b1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Complement the changelog 6.3.2Friedemann Kleint2022-09-021-1/+17
| | | | | | | | | Amends 0625f8373b4a8df9bc82835624495f26780c3f22. Change-Id: If892e8299943edcdd65d77b037f404e5472fe8d7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit dcdcdd71e9b83f1cb82cd77a1bc0f1bf9d9363a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippets_translate: Refactor handling of castsFriedemann Kleint2022-09-022-20/+15
| | | | | | | | | | Use one non-greedy regexp instead of several ones. Change-Id: I192476b5f184d22227fdd0e26ec9408098114b0e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> (cherry picked from commit 6be651a994f1e6564441d8aa51c5c3ed3303b341) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Modernize Shiboken.getAllValidWrappers()Friedemann Kleint2022-09-021-8/+7
| | | | | | | | | | Task-number: PYSIDE-2046 Change-Id: I09bea4ba6a9793cc576f3a3c8ef44df021744a3a Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 3911525f0b8ee1c8b301ef794cff4bf24e9f68f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix stubs of shiboken6.ShibokenFriedemann Kleint2022-09-022-11/+11
| | | | | | | | | Fixes: PYSIDE-2046 Change-Id: I6a888d1f1f8dff25d5fc7f40131504d93c79be62 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit fc9b08123a1f2c3a9d1d6def83dd4d4599646c34) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: Finish the flexible Enum/Flag assignment and correctChristian Tismer2022-09-024-20/+16
| | | | | | | | | | | | | | | | | | The former fixed coupling between flags and the Enum/Flag decision is no longer correct, because there are rare cases which deviate heavily from the default. One example is Qt.Modifier: This class is equivalent to Qt.KeyboardModifier, which is a Python Flag type. This patch implements the full flexibility of redefining enum and flag and corrects the Qt.Modifier case. Task-number: PYSIDE-1735 Change-Id: I7947e722f72b4d7b821bce57586e1793a1089606 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit edbee6b65aeafc0fb9a5cdb8d53e04e15a94edbe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: Simplify code generator because of full forgivenessChristian Tismer2022-09-022-22/+2
| | | | | | | | | | | | | | | | | | | | | | PyEnum needed extra signature handling in the parser.py file and the abstractmetatype.cpp file because we needed to decide at runtime what names are to be generated. With the full forgiveness mode, all special handling is still implemented, but the old versions of the enum representation can also always be used. The unexpected funny side effect is that we now can remove all special handling that has been implemented for these cases. The way how things are written is no longer relevant, although the new version is still the only one advertized. Change-Id: I76efc8ffc646d3a04d974d6776a1c9c2b5ffec70 Task-number: PYSIDE-1735 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 5419080e948c89d4f271d7d4a9bf980f647d53f5) Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyEnum: Improve the handling of QKeyCombinationChristian Tismer2022-09-024-4/+66
| | | | | | | | | | | | | | | | | | | | | | | | | 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 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 20729eb6ffda8771c192e1614f8e53823108cab1) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* doc: add section for cmake-only buildCristián Maureira-Fredes2022-09-011-8/+38
| | | | | | | | | | | | Adding notes for the recommendation related to building and packaging pyside and shiboken for different scenarios, besides Python wheels, using a CMake. Fixes: PYSIDE-2005 Change-Id: I02a45c92dc339a32fddb4b2a0de87a5c61483931 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 4cfa700d5965922b5156517a64790369deac354f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: use more processes for sphinx-buildCristián Maureira-Fredes2022-09-013-3/+3
| | | | | | | | | | | Adding the option '-j auto' to the calls we have for sphinx-build, speeding up the documentation generation process. Change-Id: Ie676d305e283fa217a90f3de64f96978ce6b3af0 Task-number: PYSIDE-1106 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ddbf71586ac56b623c6467285b2b965f377d4752) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add the Bluetooth heart rate examplesFriedemann Kleint2022-09-0130-0/+2571
| | | | | | | | | | Incorporates fix ecc192d91985e93536c64d6e40604c7c8cd6c18d. Task-number: PYSIDE-841 Change-Id: If24127be2ab78b3542777fdf691227d51e628373 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit ba5fdf167b79444f210884aa01f484b5283ec67a)
* PySide6: Add QBluetoothDeviceDiscoveryAgent.DiscoveryMethodsFriedemann Kleint2022-08-311-1/+1
| | | | | | | | Task-number: PYSIDE-1571 Change-Id: I12f23238333a350835bb923299a7b2e5fbf9cb03 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 24b86d11921c70029c1b1b75f8a20c83dbc8a88c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Documentation: Improve module pages titleFriedemann Kleint2022-08-271-2/+2
| | | | | | | | | | Task-number: PYSIDE-2038 Change-Id: Ib87c2a1ff77bbb0bf71f4f2ca976929780e5b398 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit ae970d1794821f383e53ae62487cb1e0723ff051) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix setting override cursors without context managerFriedemann Kleint2022-08-251-1/+1
| | | | | | | | | | | | | Do not restore the cursor in the destructor of the helper class, only in __exit__ of the context manager. Amends f81168387be7879f9167405b28d29ba26e7b3f14. Fixes: PYSIDE-2039 Change-Id: I78d1dc402adda953ec3d5516631cfda5900a9a43 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 287dc1365251a15e95363366d9c86bb8f5962ecb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Examples: Add some missing slot decoratorsFriedemann Kleint2022-08-2540-40/+222
| | | | | | | | | | | As unearthed by the warnings added by the logging category. As a drive-by, fix some imports. Task-number: PYSIDE-2033 Change-Id: I3812c705b60eb7be744c3532fcfb0e4024763885 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit ebfaceedf7413ce70e6ae411c821e6c3e68aa37f) Reviewed-by: Simo Fält <simo.falt@qt.io>
* quicknanobrowser example: Fix warningFriedemann Kleint2022-08-241-1/+1
| | | | | | | | | | | | Rearrange initialization, fixing warning: QtWebEngineQuick::initialize() called with QCoreApplication object already created and should be call before. This is depreciated and may fail in the future. Change-Id: Ibb55c6b793cd961aca34eb9c0822f8567e5b933d Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit b910d4fffbde3a4d6c6310acda6bf6f530c69755) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix blocking threads in static functions of QMessageBoxFriedemann Kleint2022-08-241-0/+9
| | | | | | | | | | | | Add the allow-thread attribute for the compatibility overloads along with a fixme comment. Fixes: PYSIDE-2034 Task-number: PYSIDE-803 Change-Id: Id89767c8fdd14cc450ae131ead873d1afdc94b8f Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 5c37a8c9ffea848f4115e3b89f50bddc4ea4a6de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix binding,scriptable examples when no build typeAdrian Herrmann2022-08-223-5/+5
| | | | | | | | | | | | | Fix a problem where building the samplebinding, widgetbinding and scriptableapplication examples would fail if the CMAKE_BUILD_TYPE variable was not explicitly set. Amends f9f620436058efe93d086c5214955c4d56e70e26. Change-Id: I6fa8afc386d259a16812bd69148d6299f3b70233 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit c9269fc4e55b467773d80cfb05739b3b11a0b35d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix some bitrot in examplesFriedemann Kleint2022-08-193-17/+27
| | | | | | | | | | | | | | | | | | | | examples/widgets/graphicsview/elasticnodes/elasticnodes.py", line 132, in __init__ self.setCacheMode(self.DeviceCoordinateCache) AttributeError: 'Node' object has no attribute 'DeviceCoordinateCache' examples/charts/chartthemes/main.py:137: DeprecationWarning: Function: 'QXYSeries.pointsVector() const' is marked as deprecated points = lower_series.pointsVector() examples/charts/chartthemes/main.py:148: DeprecationWarning: Function: 'QChart.axisX(QAbstractSeries * series) const' is marked as deprecated chart.axisX().setRange(0, self.value_count - 1) examples/charts/percentbarchart/percentbarchart.py:46: DeprecationWarning: Function: 'QChart.setAxisX(QAbstractAxis * axis, QAbstractSeries * series)' is marked as deprecated chart.setAxisX(axis, series) Task-number: PYSIDE-841 Change-Id: Ifc7a539f547b5986055a56b98d59ca00c5b51e19 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 81c0c6d8ca57485cdaec68474fc879416f8fbecb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix random values in QFormLayout.getItemPosition()Adrian Herrmann2022-08-182-18/+20
| | | | | | | | | | | | | 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. Change-Id: I0c67c771ed017f14b211fa6ccf9c89706152d214 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 5e4a830f2aa5e27e203fc0a4fc482b339d9106a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippets_translate: Handle connect statementsFriedemann Kleint2022-08-183-3/+53
| | | | | | | | | | | Replace pairs of instance/pointer to member functions (PMF) by the Python dot notation and connect statements afterwards. Task-number: PYSIDE-1721 Change-Id: I29f01d47026e3a7ab2407cf8c5b112533d5fb4dc Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit ed4474cb3be12c1a9566c6cd7299db39e7b9a756) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add support for QFormLayout::TakeRowResultCristian Maureira-Fredes2022-08-183-2/+34
| | | | | | | | | | | | The struct TakeRowResult was not explicitly declared in the typesystem, leaving out some QFormLayout functions like QFormLayout::takeRow(...). Fixes: PYSIDE-1312 Change-Id: I77577cb54ff9cca56435b62c4848832e79f575f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit f096a6497b311555a06be7218027411a6a6ee166) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* shiboken6: Trim white space of default expressionsFriedemann Kleint2022-08-181-2/+5
| | | | | | | | | | Remove Windows carriage return characters as observed in the signature of QWebEngineView::printToPdf(). Change-Id: I29db24d7407436f9f579684fb6dbce3c1c4cbf7b Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit db143665ff9df2e07cc4d072e88cfe071666c63f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* signature: Update, cleanup and install signature testChristian Tismer2022-08-185-21/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit bd3e8afdb06c8614164e4ed1f195a8618c1d586d)
* CI: Use same python with testrun as with build on winSimo Fält2022-08-181-3/+4
| | | | | | | | | It seems the default python3.6 is broken on tier2 vm template. Change-Id: I8f45e3a9561eca4adefaa575d784071011168c1b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 19c194d28e9bebb4b0ec66ba42eea9d5dddcc49a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippets_translate: Do convert return statements to functionsFriedemann Kleint2022-08-162-2/+6
| | | | | | | | | Task-number: PYSIDE-2030 Change-Id: Icd6f3a639449d737933d4420fbeb891224999b59 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit beaf2513cbe23f0a40162df1cd454c278fc7a1d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* libpyside: Output a warning when a property metacall failsFriedemann Kleint2022-08-161-1/+5
| | | | | | | Change-Id: Ib435b4b87a92e859a5e1da0b54e6d442b465defc Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 659bc34168f33c43c65f5160a7619e25cac20529) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add changelog 6.3.2Friedemann Kleint2022-08-161-0/+56
| | | | | | | | | Completed enum and formatted a bit. Change-Id: I2a10d65b13cc3269221328bf76bd8d33b8af0e01 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 6cad6d81a97900bd98234bc6434d68f65578a539) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippets_translate: Fix indented conditionsFriedemann Kleint2022-08-152-3/+4
| | | | | | | | | | | Adapt the regexes accordingly. Fixes: PYSIDE-2030 Change-Id: I6515b2ca0fe23c753feadeb491173b72889abba5 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 9f727745797a433de70f491ef7997016bb57ee04) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippets_translate: Fix the testsFriedemann Kleint2022-08-152-33/+57
| | | | | | | | | | | | | Change c4a266e38fe5bdce707ad6b123fa88bb4f10dff3 broke the test by changing the function values and signature. Task-number: PYSIDE-1984 Task-number: PYSIDE-2030 Change-Id: I88412f3f4398aa7fd0748d9ad3b7ba2a75cf9ff0 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 780c7a9314672da4c917650f0a9548a537515fd8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: Enable the type definition to override all enum typesChristian Tismer2022-08-153-3/+8
| | | | | | | | | | | | | | | | | | | | The new enum support in XML knew IntEnum and IntFlag, only. After we recognized that there exist three cases that should be IntFlag, although there is no according "flags" C++ definition and adding this definition crashes, it became clear that we must allow to override IntEnum by IntFlag, just for Python. But the existence of such cases may be not restricted to IntEnum, it can also occur with normal enums. This patch prepares such an override. It must be still checked if there are such cases at all. Task-number: PYSIDE-1735 Change-Id: I4af1c3153c84f88fbef6ac36e421c47dfb5429a9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 3d8ade9b5bd6f8114bd52b33d454bfc141684d54) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: Accelerate item accessChristian Tismer2022-08-151-7/+11
| | | | | | | | | | | | | | | | With the transition to Python 3.11, access to enum items has become slower by the replacement of direct item access by Python properties, involving unnecessarily the use of Python code. When we are in charge of Enum item access, we circumvent the slower property access by using the internal mapping directly. Task-number: PYSIDE-1735 Change-Id: Iabe045be09df847d9587e9d3f6913e9610f5695e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 01e048763a372677c358172a66232f15b09a1021) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: Define a fixed list of Int(Enum|Flag) decisionsChristian Tismer2022-08-1519-78/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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> (cherry picked from commit 0f5dcb03eb258280acd10a0f4f2889301a9ef365)
* PyEnum: Fix QKeySequence to stay correct when switching IntEnum to EnumChristian Tismer2022-08-156-19/+38
| | | | | | | | | | | | | | | | | | | | | | | 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 Task-number: PYSIDE-1735 Fixes: PYSIDE-2021 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 06bc40580c5f170e903d58e5e1fe5793be749e3c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the modelview programming tutorialFriedemann Kleint2022-08-126-1/+496
| | | | | | | | | | | | | Add some documentation examples and snippets to fix most outstanding C++ to Python conversion errors. The rest looks roughly ok and could be improved by further fixing up the snippet conversion. Task-number: PYSIDE-1984 Change-Id: I8c1bdcbc4a07847b2731ef7e2b9ba666cc00ccd6 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 2d7a4fc710e59d0e766ffa101dba383eff46bb50)
* snippets_translate: Add a way of using snippets from PythonFriedemann Kleint2022-08-1210-32/+198
| | | | | | | | | | | | | | | Split a helper off the snippet extraction function taking the comment pattern and let it return a dict by id to make it possible to replace snippets by id. Prototypically use it for the modelview tutorial. Fixes: PYSIDE-1984 Task-number: PYSIDE-1952 Change-Id: I05dbc3e36825761fe2968d6507880cd6f588682d Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit c4a266e38fe5bdce707ad6b123fa88bb4f10dff3) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port the modelview tutorialsFriedemann Kleint2022-08-129-0/+636
| | | | | | | | | | | | Planning to add a mechanism to extract snippets from them. Task-number: PYSIDE-1984 Change-Id: I0277ec27cb1eea85af8a921395374fc30935c99c Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit b4fc1c5d81053d30a9b03fe8a0d15336f024ed7a) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix a crash when overriding QAbstractItemModel::mimeData()Friedemann Kleint2022-08-111-1/+1
| | | | | | | | | | | | | Correct the signature modification, which changed due to typedefs in Qt 6, fixing: sources/pyside6/PySide6/QtCore/typesystem_core_common.xml:1511: signature 'mimeData(QModelIndexList)const' for function modification in 'QAbstractItemModel' not found. Change-Id: I0798308861a5ca6161c52681919a5dac672bbad2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 660485ee362180ee023b88ebbfd1e5dbf1175ae6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port the SpinBoxDelegate exampleFriedemann Kleint2022-08-113-0/+120
| | | | | | | | | Task-number: PYSIDE-1984 Change-Id: I91eadd56d87e95c7ff440d5625e41046c0a5341b Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 89e5d35c0f002fcb1aac3b1205402ce306074255) Reviewed-by: Simo Fält <simo.falt@qt.io>
* shiboken6: Remove Python code snippet markersFriedemann Kleint2022-08-111-3/+6
| | | | | | | | | | | Task-number: PYSIDE-1984 Task-number: PYSIDE-1952 Change-Id: I2e74b9c3d26c8d9fb60480c052189630ff54eded Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit df9c852d6cd6a3aff5d93ff17fcee38dc9e7088b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update the VS Code debugging tutorial for WindowsAdrian Herrmann2022-08-102-31/+85
| | | | | | | | | | | | Update the "Debugging PySide with VSCode" tutorial so it applies to Windows as well. Task-number: PYSIDE-2000 Change-Id: I487534f3094e2b9a1c2b60733ffe599afe7b39b4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 7e1c05339cdd1e457646f27e939d50f6ccbc25ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix binding, scriptable examples for Windows debugAdrian Herrmann2022-08-103-5/+55
| | | | | | | | | | | | | | | Fix the samplebinding, widgetbinding and scriptableapplication examples for debug configurations on Windows: 1. Account for the python_d executable name vs python 2. Same for the pyd file name for the binding examples (module_d.pyd instead of module.pyd) Change-Id: I60933e8968401e03c829b797c5bc67a4db8d115d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit f9f620436058efe93d086c5214955c4d56e70e26) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>