| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
This allows for removing a number of free functions and
eventually better separating QmlListProperty from Property.
Task-number: PYSIDE-3227
Change-Id: If2806f86bbbb615e59655d4f9a19b0fe87219fb5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Take over arguments only if they are neither null nor Py_None
and simplify checks accordingly.
Make the error message more precise.
With that 2aff6a35a9aa2f233c9801456daa6986437d2647, can be
partially reverted.
Task-number: PYSIDE-3227
Change-Id: I335db395e969415022581e1ec95a7e3715725bf1
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
| |
For use in QtRemoteObjects and Python bridges.
Change-Id: Ica4d3c36cc87db958353d7d6de25806acdf5d8b7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
The @setter decorator causes the property to be recreated with Py_None
set for the non-existent members, apparently due to a long-closed Python
bug (see_property_copy()). As a band-aid fix, check for Py_None.
Fixes: PYSIDE-3227
Pick-to: 6.10
Change-Id: Ib818e9930bd598306270377e26e625bfa9692a92
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
PyModule_AddObject() is deprecated in 3.13. For adding types to a
module, PyModule_AddType() can be used instead (added to stable ABI in
3.10). Add a Pep function for it.
This requires adapting some type names in QML.
Pick-to: 6.9 6.8
Task-number: PYSIDE-3147
Change-Id: I169a6b7071c780dd3c3ec2ddd0762dca6cacf067
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Some macros (Py_INCREF/Py_TYPE) were reimplemented as functions,
unearthing some type incompatibilities.
Pick-to: 6.9 6.8
Task-number: PYSIDE-3147
Change-Id: If10bc5941d718d8845c7bbd5facf6021539aad34
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
QtCore.Property
- The stub previously declared notify as Optional[Callable[[], None]], but at runtime notify must be a Signal (emitted when the property changes), never a Callable.
- This caused errors in type checkers when passing a Signal to notify.
- The annotation is now updated to Optional[Signal]
Pick-to: 6.8 6.9
Fixes: PYSIDE-2308
Change-Id: Ie42e220c51dc0419524b9dc5696371f03c42cad9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old code registered a Shiboken converter for PyObjectWrapper by
pointer conversion. This resulted in the Python to C++ converter
falling back to plain pointer passthrough since it only works for
SbkObjects.
The C++ to Python conversion worked by coincidence for either raw
PyObject * pointers used in meta call handling or pointers obtained
from calling QVariant<PyObjectWrapper>.data(), but without handling
reference counts.
To fix this, remove the Python to C++ conversion entirely and do this
manually via QVariant. Change the C++ to Python to be by value and use
PyObjectWrapper.
Fixes: PYSIDE-2193
Pick-to: 6.9
Change-Id: I00898894651f220d7b8fe60608e93233ef3e6493
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
| |
Task-number: PYSIDE-3012
Pick-to: 6.8 6.9
Change-Id: I720dd730f6dd28ae33a6019494b7b67b8f704a10
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Remove the global header <shiboken.h> in favor of the respective
headers.
Pick-to: 6.9
Change-Id: I08ee39fbd5abb15741fa5746bb82f9ddcd32ed7f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Import Callable, Iterable and Sequence from collections.abc,
since using them from typing is deprecated.
Pick-to: 6.8
Task-number: PYSIDE-3012
Change-Id: I131c00005df410fdaa40b338a2a728512269aaa0
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
macros
Removing old macros for compatibility with the limited api,
and refactoring some of their usages
Change-Id: I33954199d2ef9884c64b963863b97aed851c440f
Pick-to: 6.8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
All callables have now arguments.
Task-number: PYSIDE-2846
Fixes: PYSIDE-2884
Change-Id: Ibf6b1d93350304550addbc459c1440bd5cefc057
Pick-to: 6.8
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
PyArg_ParseTupleAndKeywords() can return Py_None for invalid
types in the property decorator, for which getTypeName()
returns "void". Set an error in this case.
Pick-to: 6.8
Task-number: PYSIDE-2840
Change-Id: I98a497df445d9b543dddaa495d85042e00673e78
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
| |
Python 3.9 is now the minimum version.
Change-Id: I7d519cf4b73516ee0d659e377805e2b6f96402d2
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Initialize variables
- Use auto *
- Remove repeated return types
- Fix else after return
- Fix some invocations of static methods
- Make functions const/static where appropriate
- Fix some int types to avoid lossy conversions
- Use Py_RETURN_NONE where appropriate
- Minor cleanups
- Remove some macros
Change-Id: I7fa7a29e7b3dc47037027978001824e0709d001f
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Add the __call__ operator.
Fixes: PYSIDE-2767
Pick-to: 6.7 6.5
Change-Id: Ic73df2918fb8effaceeddbcb2c92f7ac7eb861c5
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Using PepType_GetSlot() as is requires adding ugly casts. To work
around, add a new file with convenience helper functions in C++
linkage. This also allows for using templates for tp_alloc.
Task-number: PYSIDE-560
Change-Id: Ia50a226f5b545861f885d600445b91b4e11713c5
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is the better concept to use the same structure for
all type creation functions. We move the type slots and
type specs into these functions.
The calling function then always has the same structure
of one static expression and returning the type.
This might also save some space for shatic structures.
Task-number: PYSIDE-2230
Change-Id: Ib972f210f44422eb1ebe47a0d92ac18a8377ac87
Pick-to: 6.6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Builtin types no longer have tp_dict set. We need to
use PyType_GetDict, instead. This works without Limited API
at the moment.
With some great cheating, this works with Limited API, too.
We emulate PyType_GetDict by tp_dict if that is not 0.
Otherwise we create an empty dict.
Some small changes to Exception handling and longer
warm-up in leaking tests were found, too.
Pick-to: 6.6 6.5 6.2
Task-number: PYSIDE-2230
Change-Id: I8a56de6208ec00979255b39b5784dfc9b4b92def
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
| |
Pick-to: 6.6
Task-number: PYSIDE-2479
Change-Id: I6df19d487be7087f17e37bea3ea30a66e9b24ed7
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- nullptr
- narrowing integer conversions
- else after return
- Use auto
- Missing move special functions
Pick-to: 6.6 6.5
Change-Id: Ib872481a46c8bb17592cdc1778ab3c4d9598c753
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
- Use nested namespaces instead repetitive namespace declaration
- Remove anonymous namespaces that contain only static functions.
"static" is sufficient here, the anonymous namespace only increases
compilation time.
Pick-to: 6.6 6.5
Change-Id: I6cd1b63da79eaf40a1b7ae031def97fa22903e99
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was a refcounting bug in pysideproperty.cpp that took
some time to be understood.
By using Property.__init__ multiple times, an omission
became manifest: Not clearing a Property instance's attribute
before generates a leak.
This was the last unsolved reference bug in debug mode :-)
Change-Id: Ie91fa9e56ef52ca555168841c99c14fd550202ed
Fixes: PYSIDE-1402
Pick-to: 6.4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pysideproperty has Q_ASSERT calls, which cause errors when
a typename is undefined. This behavior is inconsistent and
should either raise an exception or be circumvented.
For compatibility with another implementation, unknown
types are now ignored, and debug and release are consistent.
To obtain an error, run the script with -Werrors . This makes
use of the new exception delay feature.
Task-number: PYSIDE-2160
Change-Id: Ia320edab4b51dd6f6b94a429b8f1f086ce9897f7
Pick-to: 6.4 6.2
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
The GC was not untracked when PySide Property was deleted.
This was found by the new deeper error tracking in debug Python 3.11 .
Fixes: PYSIDE-1960
Change-Id: I5ecdfb88529c22a44575ca9460d6753b1e389079
Pick-to: 6.2 6.3 5.15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Replace the current license disclaimer in files by a
SPDX-License-Identifier. Files that have to be modified by hand are
modified. License files are organized under LICENSES directory.
Task-number: QTBUG-67283
Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Add a check for None
Pick-to: 6.2 5.15
Fixes: PYSIDE-1874
Change-Id: I0127ba77ef2017dae232f2a1db1410d9cfe62405
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
| |
The exact type information is required for QML grouped properties.
Task-number: PYSIDE-1836
Change-Id: Id24cc1db355cee6fea88dfb4c1a67904c7e37bf3
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Amends d3883e9186892e673e8a66ad6651409d5eaf7cf3.
Pick-to: 6.2
Task-number: PYSIDE-1402
Task-number: PYSIDE-1836
Change-Id: I8bbdb2a4f4d82786d15db85b3b8e364b9df35d8a
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
PySidePropertyPrivate had a function pointer for the meta call
handler that was set to an internal function for most properties.
QmlListProperty would set it to a different function along with
user data. Turn this into a virtual function of PySidePropertyPrivate
and override it in QmlListPropertyPrivate. The function pointer
and the user data pointer can then be removed.
Task-number: PYSIDE-1827
Change-Id: I9c6452e2d39d5fd9b14d4c74ab7ed2fad483af29
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The logic of SignalManager::qt_metacall() instantiated a number of
variables that were only relevant for properties in each call and
locked and released the GIL multiple times.
Split it apart into separate handler for properties and method
invocations and reduce the GIL allocations.
Task-number: PYSIDE-1827
Change-Id: I171853d1bd95dc3d8437c64075448a08af2ea7e0
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The names of certain interface functions are not always
following a simple scheme. Especially it is not easy
to see immediately if we are dealing with a method
of SbkObjectType or SbkObject
Do a few renamings to simplify debugging and make the code
easier to understand. When a function is used in a type spec
and there is no other important reason, it should be named
like
{Py_<tpname>: reinterpret_cast<void *>(<TypeName>_<tpname>)},
Rename also all type functions ending on "TypeF()" to end
in "_TypeF()". This is not always the case.
Examples:
SbkObjectTpNew -> SbkObject_tp_new
SbkObjecttypeTpNew -> SbkObjectType_tp_new
PyClassPropertyTypeF -> PyClassProperty_TypeF
Task-number: PYSIDE-535
Change-Id: Icbd118852f2ee732b55d944ed57c7a8ef7d26139
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
| |
Change-Id: I4aef7765fc2647cd597fb316535fe28dc43cef01
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
* hand-crafted class signatures don't have a return type (__init__)
* make optional typing imports complete
* skip imports which are defined in the same module
Task-number: PYSIDE-1675
Change-Id: I30950e16347158804430e04f93254f0177d2a506
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Type generation in PyPy is critical. When type creation calls
PyType_Ready, PyPy freezes the current state of the type object.
That has fatal effects, because with the Limited API, we need
to patch some types a little _after_ creation.
The functionality of this patch is still the same, but type
creation is totally encapsulated, and we can do a different
implementation for PyPy.
[ChangeLog][PySide6] PyPySide: Type creation was completely
encapsulated. The implementation can now be rewritten for PyPy.
Task-number: PYSIDE-535
Change-Id: Iae0cadb15b631344ae76cea8c104d4b69941c2b0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This step prepares the transition of type generation
to PyPy compatibility.
[ChangeLog][shiboken6] SbkType_FromSpec() has been changed to
return a PyType_Object *.
Task-number: PYSIDE-535
Change-Id: I74e2e527e66a41f1a9f3f911f44d641139371889
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyClassProperty is now correctly published as a QtCore class
and existing as an import.
As a side effect, a bug was fixed where a syntax error
occurred because of a missing signature count.
Task-number: PYSIDE-1019
Fixes: PYSIDE-1593
Change-Id: Iae733280d9f9c23244e83a356011104bf527c329
Pick-to: 6.1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Use nullptr
- Initialize variables
- Remove else after return
- Remove C-style casts
- Avoid constructing QString from const char *
- Use emit for signals
Change-Id: I6ba8cad51f4b2a22f94996d1a9d8c3ae87c35099
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
- Remove unused variables
- Remove assignments that do not have any effect
- Fix mixing const/non-const iterators
- Fix for loops, use const ref and/or qAsConst()
Change-Id: I4b52f11030493c440026b194f18ec0151a3ea710
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
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>
|
|
|
Adapt CMake files, build scripts, tests and examples.
Task-number: PYSIDE-904
Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88
Reviewed-by: Christian Tismer <tismer@stackless.com>
|