| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Remove _compareAbstractMetaFunctions() msgInvalidVersion(),
fixing warnings.
Change-Id: I5f55b0de2d3c3fed2df09cb922c02569c937f7c1
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Add a search for flags entries to
translateType(AddedFunction::TypeInfo).
Task-number: PYSIDE-946
Task-number: PYSIDE-1241
Change-Id: I8f0092ad2dd546fdf8678864e49ad2940e7bb8dc
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Change translateType() to pass up the error instead of aborting so
that the error is printed in traverseFunction() along with the name.
The abort in case of failure will then occur in fillAddedFunctions().
Task-number: PYSIDE-946
Task-number: PYSIDE-1241
Change-Id: Iee9ca478b28c8f82d9c4b6c5165f3028bf1e0d08
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
| |
Remove unused code left over from previous changes
and add flags for matching value and const-ref as
equivalent.
Rename a few functions for improved clarity.
Change-Id: Ifac1414e4977643b18d31dfc63a8e4a5f89a2ddc
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Devirtualize TypeEntry::targetLangName() and replace by
QString buildTargetLangName() that walks up the hierarchy and
builds the name from the components. It populates a mutable
variable m_cachedTargetLangName.
- Implement setTargetLangName() to set m_cachedTargetLangName
directly so that it works in all classes (for target-lang-name).
- Implement a targetLangEntryName() that returns the last name
part using the same pattern.
- Remove the unused lookupName().
Fixes: PYSIDE-1133
Task-number: PYSIDE-990
Task-number: PYSIDE-1074
Change-Id: I15a6805a21584f1d7d4222e577e50907d7291841
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the previous change adding a parent pointer, this is working
towards building the target lang name by walking up the hierarchy,
prepending the names, making it possible to exclude namespaces.
Pass the unqualified name from the XML parser and build
the qualified name in the TypeEntry constructor.
For this to work, a new ConstantValueTypeEntry is added replacing the
abuse of EnumValueTypeEntry for nontype-template parameters.
As a side effect, it is no longer possible to nest types
by qualifying with "::" in XML:
<object-type name="Class"/>
<enum-type name="Class::Enum"/>
This needs to be fixed in the type system files.
[ChangeLog][shiboken] As a result of a code cleanup, it is
no longer possible to nest types by by qualifying with "::" in
the type system files. The elements need to be properly nested.
Task-number: PYSIDE-990
Task-number: PYSIDE-1074
Change-Id: I8a2f93c40d59167b0ba205ef3ff3b325d242c3d3
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This helpful when building the qualified names including
namepaces whose names may not appear (due to them being C++ inline
namespaces or generation being disabled).
With this, an accessor to the type system entry can be added,
which helps to avoid ambiguities.
Task-number: PYSIDE-990
Task-number: PYSIDE-1074
Change-Id: I7dce742770fbdbbc6ed0c3fce5120108dd12ffc4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
|
|
|
|
|
| |
Change-Id: Idf421747a41fbc7c58e8cc84023426bc12b47544
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|\
| |
| |
| | |
Change-Id: I9f31a647fd9d4ad9c854a307f8b5df1be935354a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If a derived class does not declare an explicit destructor,
AbstractMetaClass::hasVirtualDestructor() is set to false.
However this is incorrect for classes that have a base class that in
turn provide a virtual destructor.
Consequently shiboken generates incorrect code in cases where it depends
on that value (e.g. for methods that override ownership of the returned
object - instead of releasing ownership, shiboken invalidates it).
This patch considers the baseClass()->hasVirtualDestructor() after
traversing all functions (which checks for explicit destructors).
Change-Id: Ifc4a472290d835dd6ef7d702b912643c9a2b42da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently shiboken generates classes without __repr__ for QObject
derived classes. However for all non-QObject classes that have an
operator<<() for QDebug, it *does* add a valid repr implementation.
Extend this behavior to QObject classes as well.
In order for this to become more useful, also check for the indirection
of operator<<(): If operator<<(QDebug, Foo*) is available, use the
current non-value-type behavior, (i.e. provide cppSelf to operator<<()),
but if operator<<(QDebug, const Foo&) is available instead, use the same
behavior as for value-types, i.e. provide *cppSelf.
This greatly increases the number of classes where operator<<() provides
useful results.
Also make sure to check for operator<<() in namespaces (recursively),
not just at global scope.
Change-Id: Ief9158455a25e332f07169f09692cafb8097078b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Factor out a helper for applying the modifications
and use that in
AbstractMetaBuilderPrivate::traverseFunction(AddedFunction)
and
AbstractMetaBuilderPrivate::traverseFunction(FunctionModelItem)
consistently using the existing list of function modifications.
Streamline AbstractMetaBuilderPrivate::fixDefaultValue()
to handle empty expressions for simplicity.
Remove AbstractMetaFunction::replacedDefaultExpression()
and AbstractMetaFunction::removedDefaultExpression()
which are no longer needed.
Remove unused AbstractMetaFunction::argumentReplaced().
Task-number: PYSIDE-1095
Change-Id: I649d8aa4d2ecc8bd551ecf57303ab9b849757029
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
| |
| |
| |
| |
| |
| | |
This is a preparation for further extensions.
Change-Id: I5279f351f7964f17ee3ca92386c10d3b90b5d8c8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|\ \ |
|
| |\|
| | |
| | |
| | | |
Change-Id: I057084ef25f7bbe8ec62ef7893b1d44b0074d987
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Anonymous structs showed up as mysterious, empty entries in
mjb_rejected_classes.log. Output the location.
Change-Id: I0754e426a9fff3d1dac03aa587747ab0d7816df5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
For development purposes, the 5.14 branch is currently built
against Qt 5.13. Qt 5.14 deprecation fixes must be guarded
by version checks.
Change-Id: I41f7185577c612e8daf8020b9fe57d9ff2c66379
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I389468b76913ac3c8113ab89833c756a7a72e54f
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Avoid copying complex types by using const ref
- Use isEmpty() to check for container emptyness
- Use range-based for
- Use Q_DISABLE_COPY in 'public:' area
- Fix spelling error
- Use '= default' for trivial constructors/destructors
- Remove non-null checks before deletion
- Fix misleading indentation
- Fix else after return
- Simplify boolean expressions
- Fix unused parameters, streamline code
Change-Id: I8c6cadd8653e220ba8e5bdb4dd55524d13a81768
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Apply Fixits by Qt Creator with some amendments.
Remove iterator types by using auto instead.
Change-Id: I8a75323da6ae5cdcc6b67af8be9376408953986b
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| | |
Apply Fixits by Qt Creator with some amendments.
Change-Id: Ib2be1012ef7e8a2ad0e6cd130371bf1e941c4264
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| | |
Apply Fixits by Qt Creator with some amendments.
Change-Id: Ie8300ddb834adb8b649324562f2c912a4e8cf4ce
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use member initialization, use default bodies for constructors.
Initialize missing members as reported by clang.
Change-Id: Ibc51e46a37b310912ec8f274543092dfdda78e1b
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Among other files to fix, basewrapper.(cpp|h) was full of uncommon
pointer whitespace. After fixing that, I could not resist and fixed
also libshiboken, generators, and after acceptance also PySide.
Most of the time, this regex worked fine
(\w\w+)([*&]+)[ ]*(?![&*]*[/=])
replaced with
\1 \2
but everything was checked by hand.
I did not touch the shiboken tests which are quite hairy.
It turned out that inserting a space between a variable and asterisk
causes a crash of shiboken, if the same line contains "CONVERTTOCPP".
This was temporarily fixed by adding another space after it.
Example..
sources/pyside2/PySide2/glue/qtcore.cpp line 977
QByteArray * cppSelf = %CONVERTTOCPP[QByteArray *](obj);
//XXX /|\ omitting this space crashes shiboken!
cppgenerator.cpp was special, since it was modified to _generate_
correct pointer whitespace. This caused a few testcases to fail,
which had to be adjusted, again. This was difficult since some
internal names must end on "*" and generated code normally not.
Removing the last errors involved binary search on path sets...
Apply C++ 11 fixits to the changed code, where applicable.
Done-with: Friedemann.Kleint@qt.io
Task-number: PYSIDE-1037
Change-Id: I4ac070f52c5efb296c05d581c9d46e6f397a6c81
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I5aa8f69849db51c61d058b7f0197b883b7d2d4e2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce a way to specify a name for a parameter using '@'
delimiters.
Fixes: PYSIDE-1017
Change-Id: I3ae505c104a64413ca2bad628d9f9d3e04bb5b88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I38964a8efc7905afd879cd2a96e75149d5942c8a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Qt has some modules, where functions and classes are added to
namespaces of other modules. For example, QtGui adds the free
functions mightBeRichText() and convertFromPlainText() to the "Qt"
namespace and Qt3DQuick adds a namespace "Quick" to the namespace
"Qt3DCore" started in Qt3DCore. Shiboken was unable to handle this
since the name of the index constant was derived from the namespace
name and would thus clash. Also, all code model items from the base
module would be re-generated into the extended namespace.
To fix this:
- No longer join namespace code model items in clang builder.
- Search for pre-existing namespaces in traverseNamespace() before
creating a new one, continuing populating it.
- Add a "files" attribute taking a regular expression to match header
names to the namespace type entry, making it possible to restrict
code model items by files when extending namespaces (as otherwise,
all base items are again added).
- Add "extends" attribute specifying the package name of the namespace
to extend, which will be used as base type in CPython.
- Disambiguate the SBK indexes of namespaces and the init_ functions
by adding the module name.
Change-Id: Ib552e878911942fa4d52d2bb0c6695e5b2c4c341
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|/
|
|
|
|
|
|
| |
Fix warnings introduced by
qtbase/92f984273262531f909ede17a324f546fe502b5c.
Change-Id: Ic46e5c93f8dd1910742fbd0578602cca4461643b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In class ReportHandler, replace the step counting by a simple pair of
startProgress()/endProgress() functions that check for warnings and
print the appropriate terminator. Module name and timestamp are now
also printed.
Add a few more messages and give proper names to the generators.
Change-Id: I92b4ef2854b824fbba3d371417edc1f88561a2cb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Searching for the function modifications of the operator function by
signature failed due to the internally changed signature.
Store the function modification list of user-added-functions directly
in struct AddedFunction instead of the type entry of the containing
class.
In AbstractMetaFunction, replace the bool m_userAdded flag by a shared
pointer to the AddedFunction and use that to retrieve the
modifications (injected code snippets) for the user-added functions
instead of searching for them by function signature.
Task-number: PYSIDE-995
Change-Id: Ic4d0b257f141a450df26563d33beb397b6209d91
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
This is a preparatory step for storing it directly in
AbstractMetaFunction.
Task-number: PYSIDE-995
Change-Id: Ia281bb8d3d94d3d56549ec227a476d9750922323
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
For types, QObjects are equivalent to objects, there is no need to
differentiate. Remove the code trying to find whether a type is a
QObject.
Only AbstractMetaClass needs to know whether it inherits QObject. Add
a simple check recursing down the base classes.
Change-Id: I2365b451c8873f044b06c09b58aff29e2db3c5b7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
| |
It is only used for nested namespace names.
Change-Id: Id808b6db3b20c861ed3180d6df956f31702afbde
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
| |
Use a list instead of splitting and joining repeatedly.
Use splitRef() for the tokens.
Change-Id: I0519b18126ba828a00aff6e4455c45f682928ca9
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
| |
Pass the current class as function parameter instead while traversing
instead of setting and restoring m_currentClass.
Change-Id: I38391dff9a52ff99593c25208e1e2bf7d98d17d6
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
| |
Resolve the absolute file paths of the code model items against the
include paths of shiboken to reconstruct the relative paths.
Change-Id: Id0f793315b01c0fc65a4cfb26b3372f9c6688872
Fixes: PYSIDE-975
Reviewed-by: Volker Aßmann <volker.assmann@gmail.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
shiboken iterates over the code model items in 2 passes: The first one
generates a list of classes, the second one adds the members. In the
second pass, the function
AbstractMetaBuilderPrivate::currentTraversedClass() was used to find
the AbstractMetaClass instance for the code model item by name.
This is inefficient and causes problems when extending namespaces.
Therefore, replace AbstractMetaBuilderPrivate::currentTraversedClass()
by a hash associating the code model items with the AbstractMetaClass
instances.
Change-Id: I88ea5205d0fde03558db8efb8738632aa3ab6da6
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
Searching by name is more efficient and has problems when extending
namespaces. Search by type entry instead where possible.
Change-Id: I131329a6648bb7f0a02cba08a5fbbc0531e0c51f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the function parameter to be a list always, making the logic of
the inner classes clearer.
In the implementation, use a of QHash<AbstractMetaClass*, int> instead
of hashing by name, which makes it possible to disambiguate namespaces
extended in modules.
This also allows for a drastic simplification of the code trying to
determine the dependency given by parameter default values. Instead of
trying to match by name, correctly qualifying it, the matching can be
done by TypeEntry pointers.
Change-Id: Ia17bf6e109576bac029fb016e5e11309777d0735
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
| |
Change-Id: I4d76a29699867e9d4ff6138cc40fae9b1f519121
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Array modifications did not work in template specializations (like
typedef QGenericMatrix<2,2,int> QMatrix2x2> causing warnings like:
There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type
'const float *' of argument 1 in function 'QMatrix2x2::QMatrix2x2(const float * values)'.
Rewrite the array modification code to operate on AbstractMetaType
only instead of requiring code model data types and add the missing
handling to AbstractMetaBuilderPrivate::inheritTemplate().
Add a test.
Note that the warning was fixed by another change removing the array
modification since it did not take effect due to the presence of a
manually added PySequence constructor.
Change-Id: Ie4a1092fbef7237f8858790a74e2f75070ef6586
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the typesystem parser, add the allow-thread attribute to root and
complex type entry.
Rewrite the handling of allow-thread (cached) in AbstractMetaFunction
similar to the exception handling (store the modification in
AbstractMetaFunction and go down the class hierarchy if it is
unspecified).
Change-Id: I00e6e2ab25208fda63ec20522814cbfccbb8c42d
Fixes: PYSIDE-931
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Class-level exception specifications on a base class were not working
so far. This requires a larger refactoring, since the base classes are
not yet known at the point where class functions were traversed
(AbstractMetaBuilder::setupInheritance() is called at a later stage).
To fix this, store the actual type system modification in the
AbstractMetaFunction and move the logic determining whether to
generate exception handling into
AbstractMetaFunction::generateExceptionHandling(). In this function,
recurse down the base classes if the function does not have a
modification set.
This is a preparation for giving the allow-thread attribute, which can
currently only be used at a function level, a similar handling.
Task-number: PYSIDE-62
Change-Id: I28597559511d330cf860c6f6e21ffea229bfab3e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
Fix warnings in case Qt is not built with SCTP:
qt.shiboken: (network) type 'QSctpServer' is specified in typesystem, but not defined. This could potentially lead to compilation errors.
qt.shiboken: (network) type 'QSctpSocket' is specified in typesystem, but not defined. This could potentially lead to compilation errors.
Change-Id: I0352e34011f2123e08fe3330a53dcdadc468d6a9
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass the "deprecated" annotation from Clang into the meta language and
reject functions based on it when the the command line option
--skip-deprecated is set.
By default, have Python output a deprecation warning when a deprecated
function is called (which is visible when passing -Wd).
Task-number: PYSIDE-487
Change-Id: Ic28d82963fde11f258b2559b562d3f24017fe98d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ShibokenGenerator::isValueTypeWithCopyConstructorOnly()
returned false for QWebEngineHistoryItem since the check
for AbstractMetaAttributes::HasRejectedConstructor triggered
on WebEngineHistoryItem(QWebEngineHistoryItemPrivate *priv),
causing the function to bail out.
To prevent this, add a new
AbstractMetaAttributes::HasRejectedDefaultConstructor attribute
and use that in isValueTypeWithCopyConstructorOnly().
Task-number: PYSIDE-906
Change-Id: I4fee83b89f0a4c44e7e8d69e118ed7f2b03ceee1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
| |
Remove the function _NamespaceModelItem::uniqueNamespaces()
which created a QSet of_NamespaceModelItem *. Hashing by pointer
values does not have any effect.
Change-Id: I723024f0004aacecf4f06a1baa10678848d4a56b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
In the AbstractMetaBuilder, change the list of enums into a QHash with the type entry as key
since that is mostly used for searching. Streamline and simplify
the search functionality accordingly.
Task-number: PYSIDE-817
Change-Id: I205cad1f90bc26511ea6b6e9b76ddb1bae544cf1
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
| |
Task-number: PYSIDE-817
Change-Id: Id7e8fb1b18abb51d6fdf450c4069e5ba88b53285
Reviewed-by: Christian Tismer <tismer@stackless.com>
|