aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside
Commit message (Collapse)AuthorAgeFilesLines
* PySide6: Add the logo as a resource to libpysideFriedemann Kleint2021-02-102-0/+7
| | | | | | | | | Use it in prominent examples. Change-Id: Ifee67802194931bbd56fbe6e6bfa4f3c18fda781 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit ac7365aa78d78a3693c46e2177df3216d0a40628) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* feature: delete setter after creating property only if standardChristian Tismer2021-01-291-5/+9
| | | | | | | | | | | | | | | | | | | | Some features like QWidget.size are defined by Qt with a non-standard setter name. For size, the standard setter name would be setSize, and in the property creation process this setter would be deleted. We changed rules in this way: If a setter name is non-standard (like resize), the setter will not be removed but still can be used. Actually it would make more sense if "size" was a read-only property. Task-number: PYSIDE-1019 Change-Id: I9ded7e9c1dbd2932aa4c5616385b90ed673bfaee Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit e675a51ce48875800c1f9137cedd49144c62af58) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* signature: Provide fixes and improvements, Part 1Christian Tismer2021-01-224-8/+8
| | | | | | | | | | | | | | | | | | | | The signature module is modified again to be more correct when using the mypy application. This part splits some changes which occurred when working on Shiboken.Enum inheritance. There will be a number of follow-ups: - signatures for all shiboken types - test cases for signatures - signature support for different __feature__ selections Change-Id: Ifb0d92bf7641f2909ab950e3458b3c3c68c20dad Task-number: PYSIDE-510 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 123e27090e0ec4f8d32f301700c9ff9d1b49ba2a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* allow to use shiboken.delete() to delete Q*ApplicationChristian Tismer2021-01-111-0/+3
| | | | | | | | | | | | | | | | | | | | This function should initially not allow deleting Q*Application with a shiboken.delete() function, but unfortunately some competitor can do that, so we will as well. Deletion of qApp needs knowledge about qApp. We add a hook function that calls the pyside function `destroyQCoreApplication`. A special problem was testing interactively. See the error description for the days long journey :) Change-Id: I34862425c2cb2cc80d6cafc22d25a867f96f3e0a Fixes: PYSIDE-1470 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 98aba46414b666c27df3904d2b4313f0a16e05dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* feature: Disable selection while creating a typeChristian Tismer2021-01-063-1/+15
| | | | | | | | | | | | | | | | | | | PySide 6 suddenly has problems with feature switching during subtype initialization. We introduce an enable function that can temporarily suppress switching. This problem is solved so far. It is the question whether this will break again in another constellation. It might be considerable for the future to have something like Python's PyType_Ready function. Right now this is too much effort. Change-Id: If0ed786d4761cf2356f01f7478e4a0d750e88d3c Fixes: PYSIDE-1463 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit b6d1b76b46d7b756f7cb01361037e1cb5efc990a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* basewrapper: clear all traces of special Q*Application treatmentChristian Tismer2021-01-041-1/+0
| | | | | | | | | | | | | | | | | | | After simplifying qApp so much, it is no longer necessary to treat Q*Application special. We now can allow garbage collection for all objects which simplifies the code quite much. Then it was easy to shrink the implementation to a single function `MakeQAppWrapper`, which made the whole "qapp_macro" files no longer necessary. This cosmetic change will probably not be back-ported to 5.15 . Task-number: PYSIDE-1447 Change-Id: I8ae3c5575e62bd7b5d6bac65c25775c712bb178f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 8998f9c1a9116151b679c61ad36fedcc74cc75a1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* property: fix an eight year olde bug that showed after the overhaulChristian Tismer2020-11-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | The modernisation of pysideproperty.cpp creates an error when using @Property(str, constant=True) This could also be provoked before the improved version of Property by def getVal(self): return self.val variable = Property(str, getVal, constant=True, fset=None) because the None/NULL - handling was incomplete. Change-Id: Ib39dd3bdb62ba928164faa465ee3dd743262e245 Fixes: PYSIDE-1426 Pick-to: 5.15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pysideproperty.cpp: Fix compilation with MSVC2019/C++ 17 modeFriedemann Kleint2020-11-261-7/+6
| | | | | | | | | It does not accept a ternary operator with QByteArray/const char * arguments. Pick-to: 5.15 Change-Id: I02bcb740100c4568ecb262fa6ecf3d466e02c875 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Replace QVector by QListFriedemann Kleint2020-11-253-15/+14
| | | | | | | | | | | | | | | | Change AbstractMetaClass::templateArguments() to return TypeEntries (const TypeEntry *) instead non-const. Remove redundant typedef OverloadData::MetaFunctionList. Use existing typedefs in some places. Add new typedefs for MetaObjectBuilder::EnumValues and AbstractMetaFunctionCList. Change-Id: Ia241b5fbe54d60ea57175fb1f6c844604e066a3d Reviewed-by: Christian Tismer <tismer@stackless.com>
* cppgenerator: rework keyword handling regarding unknown keywordsChristian Tismer2020-11-232-26/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | PySide has a distinction between functions with simple arguments and functions with keyword arguments for optional keywords. When a function has keywords specified in one or more signature branch, it gets the METH_KEYWORDS flag. In this case, it is checked that no argument is given positional and per keyword at the same time. Completely forgotten was to check which keywords are allowed in that branch, if at all. The problem was much complicated because constructors can contain extra signals and properties. At the same time, all further error messages are generated with Python. This adds necessary flexibility when features are active. All PyBuildValue objects were refcount leaking. That has been replaced by static createStaticString expressions. The `argNames` structure is no longer needed by the improved algorithm. Change-Id: Ic297912c47231720f61c7d4b79b46a1e376a9941 Fixes: PYSIDE-1305 Task-number: PYSIDE-1019 Pick-to: 5.15 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Refactor GlobalReceiverV2MapFriedemann Kleint2020-11-173-43/+57
| | | | | | | | | | | | | | | | Use a QHash of object/method PyObject instead of a QByteArray representing the sum of hash values of both as a string. The problem with using hash functions here is that 2 keys might be identical due to the hashing. Rename the hash() methods to key(). Task-number: PYSIDE-1422 Change-Id: Ie1344d8bd85a073ef5f6e2cb461bd2f514265a9f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Small nullptr-cleanupFriedemann Kleint2020-11-174-8/+10
| | | | | Change-Id: I9688480a24bafa7808796a6161cf3474f2ca44f8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* globalreceiverv2: Avoid hash call on instances which might be unhashableChristian Tismer2020-11-171-7/+8
| | | | | | | Change-Id: I423763b363cff61beb5da45374f120e5f2e63ffa Fixes: PYSIDE-1422 Pick-to: 5.15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix warnings about unused functions and variablesFriedemann Kleint2020-11-121-2/+0
| | | | | Change-Id: I7949defbd3f55b0ca231a21b0f9b8747024f8097 Reviewed-by: Christian Tismer <tismer@stackless.com>
* __feature__: provide useful error message when feature is activeChristian Tismer2020-11-113-5/+29
| | | | | | | | | | | | | | | | Features seem to work quite good so far, but they clearly need much more testing. One of the problems is that error messages are produced, but the function name is not found and we get an ugly default error message. This is an efficient implementation that does all name mangling in the C code. A helper dict avoids linear search for properties. Task-number: PYSIDE-1019 Change-Id: Ic87c4a6e7dc2b2a251e809d6df0eb7fb9ca8021c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyside6: make sure that class properties trigger feature switchingChristian Tismer2020-11-111-0/+1
| | | | | | | | There was a call to the switching function missing in the metatype. Task-number: PYSIDE-1019 Change-Id: Ia556e3c562006a267b6a0a16b68cd366981f5d2d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-0242-0/+8342
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>