| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
Use the new SignalManager::callPythonMetaMethod() overload
introduced by ed8fc457e04f4ead8a3b2a2da797bdc14bd5b210 in
PySideQSlotObject to convert the void ** arguments to Python.
Amends acab25a3ccb836818e5089b23d40196bc7414b7a.
Change-Id: I024bc7f8df7fa65b8b1761f517a99a854de2cec8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
| |
Extract a helper for calling Python slots and add an overload
that only takes a list of parameter types and return type.
Change-Id: I407c3b1ae66eb4f01370ceac3112eb9407796efa
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
QObject::connectNotify() is meant to be called with the signal method.
The code retrieved the signal method from the receiver though,
potentially causing an index violation. Fix it to use the source.
Remove misleading comments from
4edd9a1278efdf37f366e9aa6e82f151a357ef32.
Change-Id: Id5afdde16ce002e156710128e9610804b748be74
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
| |
Pick-to: 6.7
Change-Id: I3b460f270965706a1b8ed04ef6f51d540db3ba72
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
| |
Pick-to: 6.7
Change-Id: I0731c9c02de928dcdf268f5fc773148363b9a8fe
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This problem is new shown in Python 3.13 although this
was not correct before.
We need to remove the error before issuing a warning.
Task-number: PYSIDE-2751
Change-Id: Ie4572e043388ca3f87092ea886e935b583f871b4
Pick-to: 6.7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
|
| |
|
|
|
|
|
|
|
|
|
| |
There was a "Short circuit" code path triggering
on QMetaMethod signal signatures without parentheses,
which is apparently dead.
Task-number: PYSIDE-2667
Change-Id: I68c4c636ea224a7691e76286ed43f5aaaa6d4bd7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lazy loading introduced a performance regression for applications
using for example an event filter on QApplication, where all internal
QObject-derived types from QML occur. This triggered the lazy loading
mechanism for each of those classes that have no binding.
To fix this, introduce checks to typeName(const QObject *)
that skip the internal classes by checking for presence of a
dynamic meta object and internal type names.
This should also help skipping over QObject-derived classes written
in Python which also have a dynamic meta object.
Fixes: PYSIDE-2749
Task-number: PYSIDE-2404
Pick-to: 6.7
Change-Id: I029d104e59820fbf3dab52a3ac65b45d97b3c2e7
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
LoadLazyClassesWithName() is already called from getConverter().
Task-number: PYSIDE-2404
Task-number: PYSIDE-2749
Pick-to: 6.7
Change-Id: Ib3dc98e92eadbdebe247b1ae18d4e737c98b1501
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
Use the PY_RETURN_* macros for returning them.
Pick-to: 6.7 6.5
Task-number: PYSIDE-2747
Change-Id: I48db8b958925e6ae39ce8ae8fb926429d0e4cd02
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function PyErr_SetString is used quite often, which has
no return value. The bracketed sequence
PyErr_SetString(...);
return nullptr;
can in most cases be replaced by a single call to
return PyErr_Format(...);
To simplify matters, PyErr_Format is now used everywhere.
Task-number: PYSIDE-2404
Change-Id: I5988fcd2430be700415d14d7a5cc740211e61d08
Pick-to: 6.7
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the bool exactType parameter from the existing
newObject() by splitting it into 3 functions:
newObjectForType() creates an instance for the type passed in.
newObjectWithHeuristics() takes an additional typeName
parameter obtained from typeid().name() on the C++ pointer which
may contain the derived class name and also tries to find
the most derived class using the type discovery graph.
newObjectForPointer() is new and contains a test for multiple
inheritance in the inheritance tree (disabling use of the most derived
class) which was previously generated into the code.
Change-Id: Ic0a25f8ec17dc20364b37062de6f20544cd2f09e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Use PyExc_RuntimeWarning instead of PyExc_RuntimeError.
Amends d7aa15abe25bd71ea19180743ce9b41e0b788520.
Fixes: PYSIDE-2705
Pick-to: 6.7
Change-Id: I04de3eb92468b996e50270b2268e08b3b819e802
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Partially revert 4d761eaaf852f8d82925e111150f25c0dd5f3e83.
Adapt to qtmultimedia/7fcea568c9c64f3bcebda21f0df02aa0107dfd0c,
reverting qtmultimedia/edaec2bf714c98d65f12c8ed9a2ffbd1603635a7.
Task-number: QTBUG-123997
Pick-to: 6.7
Change-Id: Ibd0ad737293f4b9107909f37554c03f64bce5d1e
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Restore a notification on a sender's QObject::destroy() signal for
main thread objects. Instead of triggering instant deletion as was
done before (causing issues with recursion and threads), start an idle
timer to call the Signal manager cleanup.
Amends 1270a9e82e5bc3bd53a1131698ece60403da1192.
Pick-to: 6.7
Task-number: PYSIDE-2646
Task-number: PYSIDE-2141
Change-Id: Ifdc28f729cab64d58ac2ab300daece98b167d915
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Use PyLong_AsUnsignedLongLong if an overflow occurs. Use hex
for those large values.
Task-number: PYSIDE-2652
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I9c3404cf8b01b1fcda20516c1105797fc512ed53
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Run a signal handler cleanup in CoreApplication::aboutToQuit() already
before the general cleanup. This prevents them from leaking out of a
main() function, for example.
Task-number: PYSIDE-2646
Pick-to: 6.7 6.6 6.5
Change-Id: I87cce8d131c40c02b44b0102b3774477676b8f89
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
Amends 1270a9e82e5bc3bd53a1131698ece60403da1192.
Task-number: PYSIDE-2646
Task-number: PYSIDE-2141
Pick-to: 6.7 6.6 6.5
Change-Id: Ib8a5146766166ec4fa7ae7b42ce6d52ccae0b3c6
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
| |
Task-number: PYSIDE-2628
Change-Id: I34646f76f509ec30e3d63fc8df296d2b5692ff0e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lazy init is done by module entries which are delayed.
Although visible in the module, the classes are only created
when actually accessed by getattr.
Internally, the access to the global Init_xxx functions is
redirected to a Shiboken::Module::get function which resolves
the classes if not already present in the global type array.
PYSIDE6_OPTION_LAZY
0 - no lazy loading
1 - lazy load all known modules
2 - lazy load all modules
Task-number: PYSIDE-2404
Change-Id: I98c01856e293732c166662050d0fbc6f6ec9082b
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Refactor and streamline the code a bit.
Pick-to: 6.6
Task-number: PYSIDE-2633
Change-Id: I433b136ac036a9a297d2c22ad8dfa6af45ad46b0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add an implementation for a QIODevice that can be used to work with
anonymous pipes. It needs to be able to emit the bytesWritten and
readyRead signals. This implementation is lifted from the qt5 source
tree (qtdeclarative/tests/auto/qmlls/lifecycle) and might be added to
Qt in the future, at which point it will be removed from the PySide
source tree.
Change-Id: Iff1208a366dad747352e7507da0818934c26aa4f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When lazy initialization is used, unexpected situations are
coming up. The feature switching may call into signature init
without knowledge that feature dicts are already switched.
Fix this by
- disabling feature switching during lazy init of a class
- allow this disabling from PySide and Shiboken
- Create a way to find the unchanged type dict of features
UPDATE: Switching speed is now as high as before.
This check-in was extracted after the fact, although it claims
to exist beforehand which would have been better. This was
quite a painful experience.
Change-Id: I6639b7a3c22d21d3b9dd0627e2880a7b7a03d134
Task-number: PYSIDE-1019
Task-number: PYSIDE-2404
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
|
|
| |
Task-number: QTBUG-103757
Task-number: PYSIDE-2497
Change-Id: I1b0fd5b1cad908ee612ab33ca0aacffc55947d87
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
- Adapt the examples.
- Create an alias into the module.
- Add a hack to the signal manager for signals which
maintain the old string-based signature.
Task-number: PYSIDE-2497
Change-Id: I9db5e59851a2cb9161fdcecf87e78d980eda2045
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
On C++, there is an overload of QObject::connect() that allows passing a
context object. This creates a connection in the context object's event
loop instead of that of the caller. This implements said overload in
Python.
Pick-to: 6.6
Change-Id: Ia6a098a04470741efd450818c31aa5bffb1bd9f8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
| |
Task-number: QTBUG-99313
Task-number: QTBUG-97601
Change-Id: I2422a995d73f19e385c73d54410004f7b8f9d77b
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Do not use the %S-formatting directive when an error is already set,
since that will invoke str() and thus cause an error.
Amends d7aa15abe25bd71ea19180743ce9b41e0b788520.
Task-number: PYSIDE-1275
Change-Id: I1125ca254efdeeb3652d6171d71f3e22fb686a7a
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
[ChangeLog][PySide6] QObject.disconnect() now returns False instead
of raising an exception for non-fatal cases.
Fixes: PYSIDE-1275
Change-Id: I860b69e1a7055c38f903ffafd7f816575c0d1f7a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Partially revert bf8a60db4cdbfc3e7c9c98778b219e9c83746d44, which
introduced a helper function converting to QString for Q(Date)(Time)
and QUrl. For these classes, the qHash() function should be found by
the code model after 9c37876d6f649b3c9bd1411d3c7ffe620786f1a8.
Extend the test accordingly.
Deprecate the QString-helper.
Task-number: PYSIDE-1906
Change-Id: Ia210a2210bc6a43991d5b26374039f4e86d0e71e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Use qHashMulti, noexcept and make them inline friends.
As a drive-by, also make comparison for Clang structures noexcept.
Pick-to: 6.6
Change-Id: Ibdcbf3bde90af0fc419bd1640d3f45602f772f9a
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By Python 3.12, there is now an official way to extend
heap types by custom extra data.
When we supported PyPy, the old type extension of PySide
did no longer work, and we introduced shadow dicts.
With the interface found in Python 3.12, we can use direct
extended data, again.
The supporting structures are not Limited API compatible.
We implemented a patch that enables this anyway, but it
is valid for this version only without a new review.
NOTE: The documentation lists `PyObject_GetTypeData` as
Limited API since Version 3.12, but in fact we had to
write a cheating patch.
[ChangeLog][PySide6] Hidden Type Extensions according to
PEP 697 are now used instead of shadow dictionaries.
Change-Id: I4b724ba7bcc72470b13f55ea5ebf94666061420d
Task-number: PYSIDE-2230
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Use QLatin1StringView or literals.
Task-number: PYSIDE-2537
Change-Id: I03cb9ae80dacd84da9e53648dd179ad79e9189b1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Find the number of default parameters using PyFunction_GetDefaults()
and change the argCount() helper to return the min/max argument count.
With that, try to match the slot using the most argument.
[ChangeLog][PySide6] It is now possible to connect signals to
slots/lambdas with more arguments provided they have default
parameters.
Fixes: PYSIDE-2524
Change-Id: I134d33e3ee78b62689fa36887a9acd41951c02e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
| |
Replace it by a list.
Task-number: PYSIDE-2524
Change-Id: I16089a2f53f10726377f4ed66bc466549f4f6474
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Store the argument count as obtained from QMetaMethod or Signal
argument parsing via PySideSignalData::Signature in
PySideSignalInstancePrivate and use that to find a matching
slot instead of parsing the signature.
Task-number: PYSIDE-2524
Change-Id: I7c30bd1ee7873b4d13c40e0a91a4ace9026890a2
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SignalSignature is temporarily used while constructing Signal
instances and finally converted into a PySideSignalData::Signature.
Change the code to use PySideSignalData::Signature right away,
which allows simplifying the code.
As a drive-by, fix the less-than method.
Shorten the data type for the attributes to be able to add further
values.
Pick-to: 6.6
Task-number: PYSIDE-2524
Change-Id: I4b67d55b65356fbf56633bbbe1d3ef466167227c
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SbkObjectType's meta type was changed due to a wrong fix.
This has strange side effects when applying PEP 697
because a wrong action is taken.
The meta class for class property was also rewritten
to have its own meta class for PEP 697 compatibility.
Amends: 73adefe22ffbfabe0ef213e9c2fe2c56efdd7488
Change-Id: I2d5c0a58e274c0a60496e29cbd714b9e69bfffbd
Pick-to: 6.6 6.5 6.2
Task-number: PYSIDE-2230
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Since the name ends up in QMetaObject::addSlot() taking a QByteArray
anyways, there is no point in constructing the name using QString.
Task-number: PYSIDE-2524
Change-Id: Ib27a55efa8b22eb983d5e27e3a981efd72e9996f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
Replace "<lambda>" by "_lambda_" when one is passed.
Task-number: PYSIDE-2524
Pick-to: 6.6
Change-Id: I9839c5e2862fc8c0153653eff1d29cf759dc5875
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
|
|
|
|
|
| |
Fixes: PYSIDE-2510
Pick-to: 6.6 6.5
Change-Id: Icc1461299907cc116bc75f5de994a687b85c1786
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
| |
Amends 7878a88aa638da63b8a2ec2200bbe18882277d21.
Pick-to: 6.6 6.5
Fixes: PYSIDE-2509
Task-number: PYSIDE-1334
Change-Id: I92fc4021054b1473bd6769ffb9ff0e6803b5439e
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By Python 3.12, there is now an official way to extend
heap types by custom extra data.
In order to make that most effective, we can no longer
accept every type in PepType_SOTP, but keep the types
carefully apart. This is done with SbkObjectType_Check,
which is very rarely necessary.
Change-Id: I9cc4b594f2f676712ba92bf7733c4321b717f252
Pick-to: 6.6
Task-number: PYSIDE-2230
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
Do the connect/disconnect within allow-threads.
Fixes: PYSIDE-2367
Pick-to: 6.6 6.5
Change-Id: I95c908d438a4a6c9cd0a23d3fce31a53e02ea19d
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Modern QML registration code is based on QMetaClassInfo, which uses
QByteArray; so, this will avoid conversions in the future.
As a drive-by, shorten some code and move getGlobal*() helpers to the
top for future changes.
Task-number: PYSIDE-2484
Change-Id: Iceadca5a42b5fb7cee330e61d543ca712b521ab3
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Change it to operate on a list of key/value pairs instead of a QMap
(no use in enforcing sorting) and extract a setter for setting
QMetaClassInfo data on a PyTypeObject of a QObject.
To be used for QML decorators.
As a drive-by, fix some static analysis warnings about implicit bool
casts.
Task-number: PYSIDE-2484
Change-Id: Ia759bb42740ed279f36c0850306ebd9bee526ecf
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|