| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Factor out a function for checking the bindings generation
and use that in getInheritedOverloads() as well.
Amends b1b2cc2ebed2fcf6e31c1fbbdd3638216e34717b, which caused
some modified-removed functions to be generated in derived
classes.
Pick-to: 6.1
Change-Id: Iddb2f868c360da5397279cc3058cb554f5e51b42
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
| |
Checks for the number of arguments were not generated in some cases.
Pick-to: 6.1 5.15
Change-Id: If414cdd2eb4190966e847232128600d61a4769f6
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
Use a const & when converting C++ non-primitive types, which
protects against undesired detaching of Qt's shared classes (like
containers).
Change-Id: I55da06cd107083740b8263e07cb2e0bfefe2a6ff
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
| |
Remove the sequence types that are equivalent to list.
Remove the hash types that are equivalent to map.
Remove some functions that were left-over from Java.
Task-number: PYSIDE-1605
Change-Id: If28344d39d44ac7ccf25dbc12a3a60a3693fc67d
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
The function does not return an error. Since class FileOut
also creates the directory and throws on failure, it is not needed.
Pick-to: 6.1
Change-Id: I5ad78e9789cb194df262342fb3aed6bd00dfb455
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][PySide6] The tr() translation method of QObject
has been changed to be a class method. This makes it
possible to use tr() on a class without instantiation.
The tr() method of QObject should be a class method.
- Build class method support into apiextraktor.
- Use the new functionality in the tr() method.
Listing of tr() in QtCore.pyi will be solved in an extra check-in.
Task-number: PYSIDE-131
Task-number: PYSIDE-1252
Change-Id: Iecb6535b13074f042e34ce04b6672baa266d29f3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][PySide6] The type extension macros are replaced by
normal function calls. This is not only a pre-requisite for PyPy
support but also an improvement of type safety.
PyPy cannot stand macro extensions to type objects,
because we are unable to patch the object size during
initialization.
This suggested to re-implement the type extension in
a clean way using functions.
The first idea was to keep the macro version for the
limited API, while the function version would be for PyPy
and no limited API, but the function version is much nicer
and allows further refinements.
The enum/flag alias problem is solved. Unfortunately, this
still does not fix the PYSIDE-229 problem.
Task-number: PYSIDE-535
Change-Id: I39270c6d326cb7d54bd58ceed601f5e1e9b0a8d6
Pick-to: 6.1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][shiboken6] operator bool can now be used
for bool conversions (nb_bool) besides Qt-style isNull()
methods.
Add a command line option --use-operator-bool-as-nb_nonzero
similar to use-isnull-as-nb_nonzero, enabling the use of
operator bool for bool conversions.
Make it possible to override both settings in typesystem XML.
Task-number: PYSIDE-1334
Change-Id: I9c567e1b2cb97b22b41b3d9918046d793632160e
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
| |
Task-number: PYSIDE-1602
Change-Id: Ic9e77553a9063c69971af9cd0edd5fdda993b7f4
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
| |
Complements f7901b0b29e831a3799bd7fc39dbdf5e67271ae8.
Change-Id: I1d04ffd8f4b28c095b2def08075068dcdebba099
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This message became pointless in PySide6 because the word
"iterator" no longer creates clashes in shiboken and PySide.
Thanks for checking this, Friedemann!
Change-Id: Ib0496039ab194049fd1f09867de1bbcfeb47d21e
Pick-to: 6.1
Fixes: PYSIDE-498
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
of abstract classes
Amends 71d940b4d426e19b39843e773e345a5147cf9cc5.
Pick-to: 6.1
Task-number: PYSIDE-1568
Change-Id: I6b3dc4bd01a2cf561a4b85116c853e15aa9ee2c1
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make it possible to directly specify the type, overriding
the modified type and the original type. This helps for
example to enclose a pointer return value within Optional[].
[ChangeLog][shiboken6] It is now possible to specify a
function argument type to appear in the .pyi files.
Task-number: PYSIDE-1329
Task-number: PYSIDE-1467
Task-number: PYSIDE-1588
Change-Id: I7a62059c1f85d09f6f607a4a8d3536894460b751
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Add AbstractMetaFunction::minimalModifiedSignature() to be used
in the overload decisor comments and split the formatting helpers
accordingly. No caching is required as it is called only once.
Task-number: PYSIDE-1588
Pick-to: 6.1
Change-Id: I29b7d6ba33bfe3f4348234697ef1ef8112f86ac9
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a preparation step for PYSIDE-1499, but in
effect it is solving a lot of old problems where
signatures hat to guess what was changed, and failed.
Task-number: PYSIDE-1588
Change-Id: Ib20f78e8f79e8928b5ec16b733f22fd85c3a1155
Pick-to: 6.1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Generate a separate, private module header containing classes marked
as "private" in the typesystem. This can be used for classes that are
not used in dependent modules and helps to prevent propagation of for
example private headers required for them.
Task-number: PYSIDE-802
Change-Id: If7f19c152d007c689bf719e13292107dceb802da
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For classes that have increment/decrement operators
(++/--), shiboken6 generated operators +=/-= ( __iadd__/__isub__)
by calling them n times. This was mainly intended for iterators.
However, when both operator++/-- and operator+=/-= were present (as
introduced by qtdeclarative/f8f31dd0e1f9425ba272691c79e719ebc4bcfb94
for QJSPrimitiveValue), duplicate code and errors were generated.
This requires filtering of the operator functions.
Introduce a separate function type for increment/decrement operators
and remove them if operators +=/-= were found. Also, when
both prefix and postfix version of the increment/decrement operators
are found, remove one.
Extend existing class IntWrapper from libsample for testing.
Add explanatory comment and use prefix increment.
Pick-to: 6.1
Change-Id: I0f8a0c79a6f74974ba327d21f35fff74962ffd3a
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the need to remove the constructors in the typesystem.
Amends 1d044f467070a040713c9566a8a8de3a56c571e7.
Task-number: PYSIDE-1568
Pick-to: 6.1
Change-Id: I2e2312b01c160b420c637a0eb7ddb049a7f596af
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
| |
This showed up when working on unrelated pathlib stuff.
Change-Id: I230be79183c3dc41fa25abb276b1fdceb7df1630
Pick-to: 6.1
Task-number: PYSIDE-1499
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"disable-wrapper"
Factor out a helper function to return the class name
for which Shiboken::callCppDestructor<> is to be called
and handle the case.
As a drive-by, fix nullptr in class register.
Amends 1d044f467070a040713c9566a8a8de3a56c571e7.
Task-number: PYSIDE-1568
Pick-to: 6.1
Change-Id: I22e5596c066422274c3c994cc398311fc99f1709
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TypeEntry had a string member for conversion rules (besides
the nested "target-to-native" and "native-to-target" attributes)
that was populated from the "file" attribute depending on the "class"
attribute ("target"/"native"). Remove code path and flags for "native"
since they were not used. Rename the member to targetConversionRule()
for clarity and add a warning and FIXME comments.
Pick-to: 6.1
Change-Id: I2a991d438e48c1cc0519d077cb3c0599f9800eb7
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In ArgumentModification, replace the
QHash<TypeSystem::Language, TypeSystem::Ownership>
by 2 getters and setters for native and target language.
Rename InvalidOwnership to UnspecifiedOwnership.
Pick-to: 6.1
Change-Id: I4f1a6bd67f50a7c2064b7543df197f580ffb73ca
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Registering static fields invokes converters, which
can cause crashes for uninitialized types (see also
2ac1870053370e017567ae53e62cd1155a01c88f). To solve
this problem, move the static field initialization
to the end of the module initialization function
to ensure all converters are available.
Pick-to: 5.15 6.0
Fixes: PYSIDE-1529
Change-Id: If40c6faf049077db8afcdee2069f4441c21beaa4
Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extract all implicit conversions and write them as typing.Union[].
The optional_replacer was fixed, build_brace_pattern needed
a separator to be able to continue.
Missing mappings are added.
Task-number: PYSIDE-1520
Change-Id: I2d8e4e7b8f1586036cc3ec9cf469a27e693e7312
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The author of this patch is Kay Hayen. He writes:
* Add support for compiled methods to the bindings manager.
* For slots, implement lookup of code objects for compiled methods
and functions with a new function avoiding code duplication.
* Look up attributes of slots, e.g. code objects that Nuitka also has
as well, methods have "im_func" and "im_self".
* Sometimes calling "tp_descr_get" Python object slot is the
universal thing to do, covering all types.
* Detect compiled methods as receiver targets too.
Task-number: PYSIDE-1523
Change-Id: I0277b583840710476198ed5e1ccaaccd672e7638
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
| |
Remove from code as well as from the generator.
Change-Id: Ia863788bfa57d52258836c1cbcccb8c9815b7421
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
- Add type information to the comment
- Add missing newline
Task-number: PYSIDE-1438
Change-Id: I5f7866e21d599e284967c40a4efa3c6cf5d25bdd
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
shiboken has some fatal errors which are too deeply nested to
catch with return values. Introduce exception handling to
handle this.
Add an exception class and replace the existing qFatal() calls
by a exceptions. Wrap a try/catch around main() and the tester
helper.
Change-Id: I03243849dc299f7696ef73d9d4123480ac5cbd66
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shiboken::AutoDecref is an increadible handy tool to simplify
reference counted code.
One missing spot was to be able to declare an AutoDecref variable
without specifying a value for later use by reset().
A workaround was this code:
static PyObject *_dummy{};
Shiboken::AutoDecref errCode(_dummy);
...
errCode.reset(someVar);
We now allow AutoDecref without an expression and can write
Shiboken::AutoDecref errCode{};
...
errCode.reset(someVar);
That construct is used to further simplify the generated code quite much.
Change-Id: I2ae8f2214c0fbaae0a935aa0b8d69b4a7922a6c8
Task-number: PYSIDE-1499
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove AbstractMetaAttributes as a base class of
AbstractMetaFunction and AbstractMetaClass.
Split the Attributes enumerations into those applying
to classes and functions, respectively and add them
to AbstractMetaFunction and AbstractMetaClass.
Change-Id: Ie60517876af4096fd6234479ee7dc7fbcca1eda6
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Introduce a check function to ShibokenGenerator to ensure it is
pass-by-value or pass-by-const-ref to prevent dereferencing the
parameters in case they are passed by pointer (see
QHelpContentItem::childPosition(QHelpContentItem *)).
Change-Id: I385e2bd5c0dfc34ce1ba75cb0c6eebde7ea9c68a
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The modified path is partially undone by supporting the
old structure as well. This is done in the build and install
dir, because the directory structures are compatible, now.
This patch should be undone when 6.2 starts.
Task-number: PYSIDE-1497
Change-Id: I2978ff9594977ef7104fccfa17a46cabfca70f45
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Disable the C++ wrapper generation for classes with
private destructors for these compilers.
Fix one additional condition overlooked by
1d044f467070a040713c9566a8a8de3a56c571e7.
With that, it is in principle possible to build
with g++ and --avoid-protected-hack except for
the PrivateDtor shiboken test, which tests accessing
protected methods for classes with private destructors.
Task-number: PYSIDE-1202
Task-number: PYSIDE-504
Change-Id: Ie40ad56c913dd544303aa7d795e80282afb43705
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case the protected hack is disabled, make protected
enums publicly accessible by writing a "using" directive
into the wrapper class.
The module init code still needs the surrogate enum for the
conversion functions.
Change-Id: I81977c0e181b06af3c0ab67ed37486639a163bc4
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
| |
In case the protected hack is disabled, make protected fields
publicly accessible by writing a "using" directive into the
wrapper class instead of generating accessor functions. They
can thus be treated like normal fields accessed via wrapper
class, saving some generated code.
Change-Id: I44854a0cb324d0d4e27bb56b0c5f5a879af04701
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The "disable-wrapper" attribute introduced
by 1d044f467070a040713c9566a8a8de3a56c571e7
was not working in case the protected hack was disabled
due to inconsistent, duplicated checking of conditions.
Move the wrapper check into AbstractMetaClass and let
it return a flags type that indicates whether the wrapper
is needed for protected functions or virtual methods.
Task-number: PYSIDE-1202
Change-Id: I56c0ed58a70d36e53fdd8a9c76f5eff0a832f469
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switching was quite complete, but when the module with
a feature selection created a new object, no switching
of the new object happens.
This was a pretty hard to find bug, but the solution was trivial.
Task-number: PYSIDE-79
Fixes: PYSIDE-1478
Change-Id: I663a562d4d9512b627b3add37df0908f9d785e1f
Pick-to: 6.0
Pick-to: 5.15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
| |
Apply the fix created by clang tidy'
-wreadability-convert-member-functions-to-static
warning with some manual correction.
Change-Id: I394bd96881fa25dbcb7a725b79d10395fcbb8676
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
checkers
- Remove unused variables
- Fix potential memory leak in type system parser
- Initialize return values
- Use const ref to avoid copies
- Integer conversions
Change-Id: Ib84236d58849143e9ae6af0079985503b773bca3
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
The cache can then be used by all generators and
buildAbstractMetaTypeFromTypeEntry() and some dependent functions
can be made static.
Change-Id: Ied8e683f20fe80915d3c81fffb4b39a80c7cd0d5
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>
|
|
|
|
|
| |
Change-Id: Ief8aa743f47216e728a241a7cd4de360271c5568
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
It cannot entirely be avoided in the case of the scriptable
application example. Generate code checking on the global
variable.
Pick-to: 6.0
Task-number: PYSIDE-487
Change-Id: I12bcd9df37c39f78f1d7edc63e16b3c6a9525011
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Pick-to: 6.0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
| |
- Rename CPython types to cPy*
- Use them where applicable
Change-Id: Iea05f7d7de5402b9de6d8a614da899b0b67811dc
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
| |
Add the missing overloads of AbstractMetaClass::findClass()
and adapt some types.
Pick-to: 6.0
Change-Id: I65851248b4b6a2e1d4f57fc58ecaf75fb4c00b29
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Separate the generators from ApiExtractor by introducing
a class ApiExtractorResult storing the results of an ApiExtractor run.
Move some query functions there.
With that, some generator functions can already be made static by
passing the ApiExtractorResult and OverloadData can be decoupled from
the generator.
Pick-to: 6.0
Change-Id: Iaba3ebff4aecb722eec4a606423738260983d905
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The list of classes was first sorted topologically, then
alphabetically in the AbstractMetaBuilder and finally again
topologically in the CppGenerator with an additional dependency
QObiect/QMetaObject.
Move the sort functionality taking the QObiect/QMetaObject
dependency into account from the generator to the AbstractMetaBuilder.
Move all sorting functionality to helper sortLists().
The classesTopologicalSorted() helper is then no longer needed by
the generators and can be removed from the ApiExtractor.
Pick-to: 6.0
Change-Id: I03c799118296393bdd0f3de84427b50ab29153b0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
overload ids
Insert the missing break; statement into the switch on
overload id.
Fixes: PYSIDE-1448
Pick-to: 6.0
Pick-to: 5.15
Change-Id: I1990c7fbf66e9945c520759b40b8dfb4453a5dd8
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For functions like
QDataStream &operator>>(QDataStream &, [enum] QCborSimpleType &),
the QCborSimpleType argument was treated like an object.
Add a check to treat it like a value.
Pick-to: 6.0
Change-Id: Ic2bb8a806b7fe941d8eab3543f21afa0577dd1a0
Reviewed-by: Christian Tismer <tismer@stackless.com>
|