aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a typesystem XML attribute for Python enum typesFriedemann Kleint2022-08-105-0/+46
| | | | | | | | | This is preparing the PyEnum completion of different Enum types. Task-number: PYSIDE-1735 Change-Id: I917bd62eae785b486302092c33843efceecf0568 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 1a71e6f87d238c72f8d2fadf976310378ae78b3d)
* Documentation: Fix some snippets of the model view tutorialsFriedemann Kleint2022-08-102-0/+42
| | | | | | | | | | | Replace the snippets showing the C++ header without implementation; they cannot be extracted from Python examples. Task-number: PYSIDE-1984 Change-Id: I373063ea8f3f890bb3b217951cce71feec79951c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit a78d18eab747a6af306627eab6d3e004647751f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippets_translate: Replace spaces in overridden snippet ids by '_'Friedemann Kleint2022-08-091-1/+2
| | | | | | | | | | | | Amends 22bc41605a4dd18330a39f6346143ec55a7d6074. Manifests as "Quoting ModelView Tutorial". Task-number: PYSIDE-1984 Task-number: PYSIDE-1952 Change-Id: Ie74080136d825adcdaf2348d2e2cd5db35ac1ff7 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 01b8632f363bf32069bde732c2fd66c58299a77e) Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* snippets_translate: Add a way of overriding snippetsFriedemann Kleint2022-08-086-5/+59
| | | | | | | | | | | | | Prototypically fix the QInputDialog dialog snippets. Task-number: PYSIDE-1984 Fixes: PYSIDE-1952 Change-Id: Iad75971b8778a6364123963d28f54f02a0c56737 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 22bc41605a4dd18330a39f6346143ec55a7d6074) Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* QtDataVisualization: Add ownership transfers for QValue3DAxisFormatterFriedemann Kleint2022-08-081-1/+13
| | | | | | | | | | | | | Add ownership modifications to the setter and factory functions. Amends 966fa464d1f91292c91bede88bfaf1741acdce6e. Fixes: PYSIDE-2019 Change-Id: I257af1533509d823a70aa0a8f8704d3f211b23a7 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit ae297b960d031e2ef630bf914297e108434e5ad8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build: Fix a weird build problem on macOS and other platformsChristian Tismer2022-08-041-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 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 114de72f1f63999a08f698a0972cce3a7f33a372) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippet translate: Fix errorFriedemann Kleint2022-08-031-13/+14
| | | | | | | | | | | | | | Adapt to get_snippets() returning a list after 168f0c941cefe2fcdaaa12498272f181fe246986: File "pyside-setup-devt/tools/snippets_translate/converter.py", line 21, in snippet_translate if x.strip().startswith("content-type: text/html"): AttributeError: 'list' object has no attribute 'strip' Change-Id: I3366b6fcf7647e24cf50ad7afe1f62ff0d04f9e2 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit b5ca9db036e9380c05b2291cefe9b0b4f735fcce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add support for Python 3.11Friedemann Kleint2022-08-031-0/+1
| | | | | | | | | Fixes: PYSIDE-1960 Change-Id: I180da61cf7085e9620cbec0f1832ac1332c9b9a1 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit bc7face18376b52e99079d633da610adc5cc57ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build error on Windows caused by macro copysign in CPythonFriedemann Kleint2022-08-011-0/+6
| | | | | | | | | | | Remove the define, fixing: qjsprimitivevalue.h(805): error C2039: '_copysign': is not a member of 'std' Change-Id: Iad9b467decc81a3eed534f49d26e30237eef23de Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 9aa0225352cada0c7957f4310b9be9d3d0922f56) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tools: update missing bindings script to 6.3Cristián Maureira-Fredes2022-07-253-56/+41
| | | | | | | | Change-Id: I893b995a616e7473fa81cbf5e51eaeeb1c90d2d3 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 73be208de02456860ace00d3548b49ced1228290) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add html directory to .gitignoreAdrian Herrmann2022-07-221-0/+1
| | | | | | | | | | Compiling the Sphinx documentation creates a directory html, this should be ignored by Git. Change-Id: I4ef24f7274f4e7d95c6aeafc19820d02f414c626 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit f27a74919bfcd6dd64d1c8860d0337f300ad9295) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide6-examples: SpreadSheet exampleAdrian Herrmann2022-07-216-0/+910
| | | | | | | | Port pre-existing SpreadSheet example to PySide. Change-Id: I32d014fbd5e3e406672b6bec2465c6e41c3a6580 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit eae788072fff001028e0c8f04babd61325125281)
* Shiboken: use the Python 3.11 buffer interface for Limited APIChristian Tismer2022-07-193-7/+7
| | | | | | | | | | | | | | | | | | | | | Because the stable API includes now the bufferprocs, we add a warning to remove the special handling when the lowest version is 3.11 . Unfortunately, I see no other way to use the new buffer interface, because things must work with every Python runtime. But that also does no harm, since this is now in the stable API. And of course, we can remove the boring version check :) Also, an old shiboken error workaround could be removed. XXX No, the shiboken error still exists in RHEL Change-Id: I2fae8cabb2cf116a7365b9cf45618da5238c2ea7 Task-number: PYSIDE-1960 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit a3c1a50eb1577caf3715c47b00ca26312d235a80) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: Increase compatibility by allowing defaults etc., refinementChristian Tismer2022-07-193-20/+38
| | | | | | | | | | | | | | | | | | | The change has been tested with Python 3.6 to 3.11.0b4 . The enum_310.py warning triggers now only when on 3.11.0 final. The enumFlagInfo empty check was simplified by removing empty structures. The code introspection was optimized version-specific for Python 3.9 and Python 3.11 where optimizations were introduced. Task-number: PYSIDE-1735 Change-Id: Ic5e25fd4edae0ab92aad291a8067c9dcccd5acb8 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 615d6a820137b31f03295e884f58cd46aadf5032) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: Simplify the test-cases with the new forgiveness modeChristian Tismer2022-07-147-55/+34
| | | | | | | | | | | | | | | | | | | | | | | 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 Task-number: PYSIDE-1735 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 0a3f69537d5901d626077c0a8e6486f33ebf88af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: Increase compatibility by allowing defaults and old flag namesChristian Tismer2022-07-147-8/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch supports to write Qt.Alignment() instead of Qt.AlignmentFlag(0) Also supported is Qt.AlignmentFlag() which is mapped to Qt.AlignmentFlag(0) This trickery was quite involved since the Python opcodes needed to be analyzed if we have a parameterless call. Only in that case, we insert a partial object which supplies the missing value=0 default. Changing the implementation of PyEnum was not desired because this is highly complicated, not portable and even not possible. The change has been tested with Python 3.6 to 3.11.0b3 . [ChangeLog][shiboken6] The new Python enums are made as compatible to the old ones as possible. It is again allowed to use Qt.Alignment() instead of Qt.AlignmentFlag(0), and a default of 0 is always allowed. Change-Id: If6a93f8210ff6cae4e38251420e1ad5fffbe42cb Task-number: PYSIDE-1735 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit f92b7dcac9537fb091dc15d3ee218f1984d8abef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PyEnum: make forgiving duplicates work with Python 3.11Christian Tismer2022-07-145-13/+21
| | | | | | | | | | | | | | | | | | | | There was a silent change in PyEnums that turns Enum attributes into properties. This does not harm the Python interface but needed some change in the duplication emulation. Furthermore, new internal enums are created with an underscore name. The meta class was changed from EnumMeta to EnumType. [ChangeLog][shiboken6] The new Python Enums are now compatible with Python 3.11 Change-Id: I3b1ab63dc5eed15a75ebd0f42dddf4001f640c00 Task-number: PYSIDE-1735 Fixes: PYSIDE-1960 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit da2cf031521815a9559ca784beadb70c7a2852d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Shiboken: Fix the oldest shiboken bug ever which shows up on Python 3.11Christian Tismer2022-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | b7df2f1c0 "Fix signal initializer.", 18. May 2010 at 00:55 There was a `PySequence_Check` in the evaluation of some signature function parameter processing, which should have been `PyTuple_Check`. Since the new PyEnums are also sequences, the new optimization in Python 3.11 changed the parameter handling in a correct way and replaced the argument tuple by a direct single argument of an enum type. And that is also a sequence ... There are probably still dormant issues like this in the codebase which gives reason to submit a task that checks all Python interface functions for correctness. Change-Id: I45996a0458c3e60795d2eb802eb98f7dd3678d92 Task-number: PYSIDE-1735 Task-number: PYSIDE-1987 Fixes: PYSIDE-1988 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit 2720e01f21f3771cb755ef183b8160f691bdb575) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix signal ↵Friedemann Kleint2022-07-081-0/+7
| | | | | | | | | | | | QAbstractItemModel::layoutAboutToBeChanged(QList<QPersistentModelIndex>) Add a meta type registration for QList<QPersistentModelIndex>. Task-number: PYSIDE-1978 Change-Id: I579926877c69a624dc709b3c0534a963b04f6901 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 4f9c457f28dde6423666e8227c8904e4e84ee6e1) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* doc: add package detail pageCristián Maureira-Fredes2022-07-084-4/+151
| | | | | | | | | | | | | To clarify the content of the packages, dependencies, and tools that we include in the wheels. Other files were modified to link the new page. Task-number: PYSIDE-1112 Change-Id: I358c47601e2b930b12807dda41382474186baf01 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 52d38437445f6aa979875a93702496f800b98d63) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Shiboken: Rewrite the signature initializationChristian Tismer2022-07-0711-104/+68
| | | | | | | | | | | | | | | | [ChangeLog][shiboken6] The initialization of the signature module was moved into Shiboken and rearranged. This was necessary for the new backward-compatible PyEnum module. This change makes even sense if the PyEnum forgiveness should not work in 3.11 because it is a real cleanup. Change-Id: I5de54584154fb43648617adcac823f42049be57b Task-number: PYSIDE-1735 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit dc058bddb1f1089c007721c9301e174f3f7a7887) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Shiboken: Move the shibokensupport initialization into the moduleChristian Tismer2022-07-075-31/+16
| | | | | | | | | | | | | | | | Importing shibokensupport is now possible inside the Shiboken import. That is a prerequisite to re-order the signature initialization, which is again mandatory for the new PyEnum forgiveness feature. This allows to remove much initialization code and makes the Shiboken startup less vulnerable. Task-number: PYSIDE-1735 Change-Id: Iaed4275d7e204fb242b1466cd6d2c09ad10002b5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 06448ba29c2e568f64132b81ce56ec2b063e456c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Documentation - Cross CompilationShyamnath Premnadh2022-07-071-0/+5
| | | | | | | | | | | | | | | - Fix symlinks appears as if it were only a part of Option B of prerequisities. This is now fixed by adding a new sub-heading. - Added a note about having same version for host and target Qt. Having 6.3.0 on the host and 6.3.1 on the target, does not work for cross compilation. The documentation mentions same minor version works for cross compilation. However, this works for 6.2.4 on host and 6.2.1 on target. Hence, not completely removing the statement. Change-Id: Ic678dbf094998108c55d916074753db41e9a2e0f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit a372285581adc26730b7919d878bbe9eb2f64b2e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix getting started Qt for PythonShyamnath Premnadh2022-07-073-3/+12
| | | | | | | | | - the pip install -r requirements.txt command should come after pyside-setup is cloned Change-Id: I4ed8108bf1fb850f773d422472b603ee11d97b87 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 9eb09c82cbe29df18c86b4f337de3637a211e780) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Typo : PySide Debugging TutorialShyamnath Premnadh2022-07-071-1/+1
| | | | | | | | | - CMAKE_BUILD_TYPE instead of MCAKE_BUILD_TYPE Change-Id: I542d3828c6b2dad3fa5f48dbedfecf37910fcae8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit a245ed9f6080c6a84328517b02a97cc5f895f5a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Regression: use explicit unpackShyamnath Premnadh2022-07-071-1/+1
| | | | | | | | | | | Amends 4f37d045e03af7481b41b06fb53b56cb8062c56c Change-Id: Id4134b41124c2fb29a57e2615e3b50c11c495c05 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> (cherry picked from commit 8e1769f7df1717efb94cca2d13e7771337339aae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build: fix readability detailsCristián Maureira-Fredes2022-07-076-23/+21
| | | | | | | | | | | | | | | Removing some leftover common anti-patterns: - remove unnecessary dict() usage - remove unnecessary map() - avoid index-based loops - use capitalize() instead of index-based capitalization - use f-strings for concatenation Change-Id: I0ffdf73ec47c6ef537789015052dea0fd047350d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 39b38b0cfc81d352c60c44efeb890b10c3e1bc88) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build: use explicit unpackCristián Maureira-Fredes2022-07-064-17/+13
| | | | | | | | | | Avoid accessing elements from sequences by index without being explicit about all the returns from functions. Change-Id: I1cddda7f8c38724907cad854ee99489058dae5f3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 4f37d045e03af7481b41b06fb53b56cb8062c56c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build: replace the usage of reserved Python wordsCristián Maureira-Fredes2022-07-068-200/+198
| | | | | | | | | | | Internally, we were using many words like 'filter', 'vars', and 'dir' which are built-in functions in Python. To avoid confusion and a possible wrong behavior, we renamed them. Change-Id: Idbadda3857705ef3a5f0440112ee923d3a61ffa0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit eba195611ac30fd490e87a03238060eca05f2073) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build: rename our rmtree to avoid shutil conflictCristián Maureira-Fredes2022-07-065-14/+14
| | | | | | | | | | | | There is an implementation in the 'utils' module that implements a 'rmtree' function to handle removing readonly files from a directory. To avoid confusion with shutil.rmtree we rename it to 'remove_tree'. Change-Id: I3548ea81f36c87ba51fd984fcf7b1cd4cafd54d6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ea9ac28cc215289ae46b1679c58a3acfc66883fc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* examples: add license wizardjaime022022-07-067-0/+399
| | | | | | | | | Ported from c++. Task-number: PYSIDE-841 Change-Id: I8cac7256d38a37d2c94967fec4e9349e8b17ec6a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 387c1b84b5eae22dd394aac24bc73fdcac24a7b3)
* shiboken6: Simplify smart pointer types when searching instantiationsFriedemann Kleint2022-07-031-7/+11
| | | | | | | | | | | | | | When the code model first sees a "foo(const SmartPtr &)" instead of "foo(SmartPtr)", compilation would break since const, & propagate into the generated type name. Simplify types as is done for containers as well. Task-number: PYSIDE-454 Change-Id: I1d9f75aceb983f8e9c4a28314db94b8d83b1c1ca Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 6d81913ed1189a5c7b1e26d2456f05e8e8684914) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove left-over archive fileFriedemann Kleint2022-06-301-0/+0
| | | | | | | | | Added by 25180730194bec25f915f32ab846ea583fb1493f. Change-Id: Ib6440293f5193972cb5f10c71816b6e7189534a9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 2eea860f88a6e6f5be10a6097733f4e676af3717) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* libpyside: Improve error message about using the wrong signal overloadFriedemann Kleint2022-06-301-6/+13
| | | | | | | | Task-number: PYSIDE-1978 Change-Id: I912d4317bc639c5c597ab8259eef4ae389af04e6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit a438c4d60f4913ea0db82cda0c419c26d557d0dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippet translate: add option to process directoryCristián Maureira-Fredes2022-06-302-63/+100
| | | | | | | | | | | | | Including option to process the snippets inside a directory, and refactoring the general script to adapt this option. Initial-Patch-by: Jaime Resano <gemailpersonal02@gmail.com> Change-Id: I629be8b7c13bc0445279ced73c3159800cd0644d Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit f357d75b30890e7df853199f72560a3f34a290f2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippet translate: fix get_snippetsJaime Resano2022-06-293-25/+128
| | | | | | | | | | | - Fixed the get_snippets function which did not work properly when more than one snippet id was on the same line. - Tests were added Change-Id: Idffbb0aee258522d7855e2ad0e2b8df61a1872c8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 168f0c941cefe2fcdaaa12498272f181fe246986) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build: avoid mutable default value as argumentCristián Maureira-Fredes2022-06-282-4/+14
| | | | | | | | | | | Mainly to avoid having a persistent object every time we call the function, to avoid future issues. Change-Id: I9aea45ffa7ecd381e8c5ed6b3c83036d6e8aef72 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 50c746d61fdf521e98557ec34dc21f9413c2a465) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build: fix flake8 warnings and missing f-stringsCristián Maureira-Fredes2022-06-287-12/+13
| | | | | | | Change-Id: Ibd2a6088f6a2826be38a13037fe2db6656630b34 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit d8e9b867560dafe1baa75356dbb65a177c74b6d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* libshiboken: Remove old code paths for static stringsFriedemann Kleint2022-06-271-59/+0
| | | | | | | | | | | PyUnicode_InternFromString() should be used unconditionally. Amends a09a1db8391243e6bb290ee66bb6e3afbb114c61. Task-number: PYSIDE-1960 Change-Id: I80837b2b58c9eadbd2aca4279df10e2f03e30450 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 71d97ff54ba2ea225d4fb215b3dbbf7feeab489a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* libshiboken: Fix crashes with static strings in Python 3.11Friedemann Kleint2022-06-241-2/+17
| | | | | | | | | | | | | In Python 3.11, some strings come with a refcount above decimal 1000000000, apparently indicating that they are interned. Replace the mechanism by PyUnicode_InternFromString(). Task-number: PYSIDE-1960 Change-Id: I6436afee351f89da5814b5d6bc76970b1b508168 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit a09a1db8391243e6bb290ee66bb6e3afbb114c61) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* snippet_translate double colon improvementsShyamnath Premnadh2022-06-242-3/+23
| | | | | | | | | | | | | | | | | | | - Earlier, double colons were converted to dot operator only when the statement had a QObject class or namespace. For cases with a normal C++ namespace like MyClass::x, it was still translated without modifications to Python. - This patch adds an extra statement at the end of snippet_translate(x) to convert all the remaining scope resolution to dot operator On top of the above changes, it also addresses a FIXME to handle C++ iterator declaration in Python Task-number: PYSIDE-1972 Change-Id: I45d12954835aaa569d1a4ef15badb366eaff0fe7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 1815221245c0c0e8e437b46975357a282b3ad9b3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix returning flags from QAbstractTableModel and other modelsFriedemann Kleint2022-06-241-3/+2
| | | | | | | | | | | | | | | Move the function modification from QAbstractListModel to QAbstractItemModel. Amends 20eb4f94c637d20461f1fef16942841803ada909. Fixes: PYSIDE-1974 Task-number: PYSIDE-1930 Change-Id: I9adedf8340a7f0999c42147e8fd290444642abcc Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit f8e945097c4639df5d1263dbca81e2c4fcc371b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* support enum handling for headerData(...)Shyamnath Premnadh2022-06-241-0/+4
| | | | | | | | | | - similar to data(...), headerData(...) also needs to support handling of enums Task-number: PYSIDE-1974 Change-Id: I7fd96e267af4cd30269e5fb42102c1bf6f32b155 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit c6a96f04c20db6e620cd800fd57d4d9cdd1910f6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove build warning qCDebug, qCWarning, qCInfo, qCCriticalShyamnath Premnadh2022-06-231-4/+4
| | | | | | | | | | | | | | | | | amends 936bdcf97f8ca657531496592dfce7d9144fa977 Warning (potential error) fixed - ../PySide6/QtCore/PySide6/QtCore/qtcore_module_wrapper.cpp:947:35: warning: format string is not a string literal (potentially insecure) [-Wformat-security] qCCritical(*category, cppArg1); Task-number: PYSIDE-1899 Change-Id: If488e7b0d44cb905549fc35855439dec2194a79b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 678ed9bc201c739f1b0ebdf8aeb31f6513bb3ba4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* libshiboken: Fix build with numpy 1.23.0Friedemann Kleint2022-06-231-0/+5
| | | | | | | Change-Id: I885c332d6c948820140946c73ae1926e88834143 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 1422cf4a7f277fb13fd209f24a90d6c02641497d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build with QT_LEAN_HEADERSFriedemann Kleint2022-06-231-0/+2
| | | | | | | | | | Amends f88b4b646776b4d6fc8c9ab5253a0a4f89e26976. Task-number: QTBUG-97601 Change-Id: I3cd27556dc975d72a3dfebb8fb16d21edf00767b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 8982a82c55bf4366627ab20c5ffb53903efbc113) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix various documentation warningsFriedemann Kleint2022-06-232-2/+2
| | | | | | | | | | example_datavisualization__surface_numpy.rst:: WARNING: image file not readable: ../surface/doc/surface_mountain.png examples/example_declarative_referenceexamples_extended.rst:1: WARNING: malformed hyperlink target. Change-Id: I6c935a79a27b314d4ade12f1c2983aa49aa65259 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 304e00b83ef6069d91f7b27fa13cbe0c8680bbc0) Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6/Doc generator: Fix index pagesFriedemann Kleint2022-06-231-2/+2
| | | | | | | | | | | | Insert a new line before "List of Classes", fixing: QtCore/index.rst 251 WARNING: Block quote ends without a blank line; unexpected unindent. Amends 530cfb8c9fb3a050635577afa5ae23145a3ecc30. Change-Id: I15f55d224afa8c189d49cdd406d7c9f64ad9d82b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 0b37c63608b3d94f2b73eeec5f599d8af1cd9daa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Python 3.7 and 3.10 usage in CISimo Fält2022-06-221-7/+6
| | | | | | | Change-Id: I0676713438b0b9e7b627c80cb400568edb2333d1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 2e3a7f720017d2d6fb303217bf00642e8284666a) Reviewed-by: Simo Fält <simo.falt@qt.io>
* Take python3.7 in use with win11 and python3.10 with win10Simo Fält2022-06-221-0/+5
| | | | | | | | Change-Id: Ifd34be5de6d2cdbeb571320a21dfd3bb7ec47b37 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 94a597d37a787d18ba239f4326a00f83cd977fb2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>