| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For enum/flags registration, the converters were registered under
invalid names like:
Shiboken::Conversions::registerConverterName(converter, "QFlags<QFlags<QUrl::ComponentFormattingOption>");
Shiboken::Conversions::registerConverterName(converter, "QFlags<ComponentFormattingOption>");
In addition, QFlags<> is not used for type names in Python. Use the
flags name as specified in the typesystem instead:
Shiboken::Conversions::registerConverterName(converter, "QUrl::ComponentFormattingOptions");
Shiboken::Conversions::registerConverterName(converter, "ComponentFormattingOptions");
Change-Id: I79525643850bf4296516dfb9576f75b51adf6414
Fixes: PYSIDE-1029
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Check on the type entry whether code needs to be generated in the
current package.
Fixes: PYSIDE-1024
Change-Id: I82132b077ac6192b96d979cb5596d0e6fecbc76b
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Renamed from "Fix scriptable application to support the qApp macro"
because qApp was improved instead of scriptable application.
The qApp macro needed some extra effort to support the
qApp "macro" which is only defined in the Python wrappers.
I took some generated code, created a QApplication instance
in Python and used then reduced generated code to get at the
object and adjust the refcount.
This solution was then rejected, because I can do better,
and in fact, scriptable application now has a correct qApp
macro too, without any change to scriptable application.
The central idea was to look into the module init function
at import time and to see if a Q*Application already exists.
I was not aware of that import. Many thanks for the rejection! :-)
Update..
--------
After many attempts to make the qApp variable correctly behave
like always, I recognized that pre-existing Q*Application instances
have no wrappers or constructors at all! With that, it is not
possible to create a sophisticated qApp macro as a singleton
variable in the desired way.
Fortunately, this is also not necessary, because a C++ Q*Application
cannot be deleted from Python, and there is no point in supporting
more that a simple variable. So in case of a pre-existing instance,
the qApp variable now gets redirected to that instance.
A small test was added to application_test.py that is triggered by
an import.
A weird effect when "qApp" was typed interactively before calling
"QApplication()" was fixed, too.
Change-Id: Ic69dd6a21c964838a90f63e316d299b62a54d612
Fixes: PYSIDE-571
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is not the proper fix for the issue. The index of the declaring
module needs to be used for this to work.
This reverts commit d2d0e397309a1b18eaff9ddee0940007f0e1c4bf.
Task-number: PYSIDE-1024
Change-Id: Idc0e859ebda1626b5e841aa96be54317a5f3d0d0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With fd126b28e1d9b02ea16c813bc392461bdb05bd1d, broken wrapper code
would still be generated for "const_QSharedPointer_QSize___&"
depending on whether the const-ref or plain value type was encountered
first when parsing.
Fix the problem by stripping the qualifiers from the metatype added to
GeneratorPrivate::m_instantiatedSmartPointers partially reverting
fd126b28e1d9b02ea16c813bc392461bdb05bd1d.
Change-Id: Ie6691e045b7d65baa3a0bc72dd8637f09eeaf111
Fixes: PYSIDE-1016
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I920a77a3a8c79bba0fd7e5e4f990facf4081ca08
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add the module name like it is done for namespaces
and containers.
Task-number: PYSIDE-1024
Change-Id: Iba8589bfe360763bc186e5129d0ba480b2fb58ae
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
pointers
Add a convenience to strip all qualifiers and use that.
This at least fixes the naming (for example, getInitFunctionName
returning "const_QSharedPointer_QSize___&"), the init function for the
type itself is missing, though.
Task-number: PYSIDE-1016
Change-Id: Id61b3c879199fc061e2846007951e3e9c82b85c4
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
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>
|
|
|
|
|
|
|
|
| |
getMultipleIheritanceFunction() -> getMultipleInheritanceFunction()
copyMultimpleheritance() -> copyMultipleInheritance()
Change-Id: If15b1ec12b6037ac8cff9941e09a281bc219fa20
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
| |
- Remove the check function hasMultipleInheritanceInAncestry(),
which is nearly identical to getMultipleInheritingClass().
- Modernize the generated code to use C++ casts, uintptr_t and streamline
Change-Id: I68f52c2cbf1a589fd31c9c73919365176c56932e
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function ShibokenGenerator::getFunctionGroups(class) is called
many times for each function during code generation and causes a
slowdown for the OpenGL version function classes, which have 1000
member functions.
Split away getGlobalFunctionGroups() for the case scope=0 and
introduce a global-static cache for class information that is more
involved to determine for use by the various generators.
Speeds up the generation of the QtGui module including the OpenGL
version functions from 420s to 90s.
Task-number: PYSIDE-955
Change-Id: I6b6aa35ef2197aa9cddbf339db9eb0220932f361
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As QtXmlPatterns is deprecated in Qt 5.14, the documentation build
needs to be changed to work with libxml2/libxslt exclusively.
Split the XML functionality into separate files for libxslt and Qt and
provide an interface for XPATH queries and XSLT transformations in
xmlutils.h.
Adapt testmodifydocumentation to work on temporary files as libxslt
cannot handle Qt resources.
Change-Id: I923f5b2e7c1d2511f15788e4b80c7721daeb2bc3
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
| |
Move the formatting of the "done" message to the report handler and
add the prefix, which is the module name.
Change-Id: I63aa1f48f02709d6e89d9a9a684d56a218e65fd3
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
| |
Change-Id: Icb2d3702972a2dc49ee296b2111811ff75b162fc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use target_* commands instead of subdirectory based commands
for adding link options, compile definitions, include directories,
etc.
Remove some non-used compile definitions.
Move around some of the find_package() and option() calls.
Simplify some of the package dependent logic.
Replace the qt include and linking variables with CMake targets.
Change-Id: I815595344e63a32dce3dc78652359beede3ff593
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
| |
QtXmlPatterns is now deprecated, and until we port to some other
library, the CI will not have XmlPatterns anymore. Change the build
system of shiboken to skip building the documentation parts if the
dependency is missing.
Change-Id: I75d38502cd1efa84f7ec148622ffbf26084d0c35
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The signature module used to use large strings with the signatures
of all functions in a class. This can lead to an overflow in MSVC,
because the maximum string length funnily still is 32K unicode
characters.
This patch solves that by using a single string per function.
Instead of a huge string, a list of strings is passed to each class.
To prevent any runtime increase, the string list creation is deferred
until the actual usage. At initialization time only a ssize_t holding
the structure address is passed.
As a result, the signature module should be even slightly faster.
Task-number: PYSIDE-955
Change-Id: I99faf942a3cca03456928b8aec5e8a4b9924b8b2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
| |
Task-number: PYSIDE-510
Change-Id: I73c441b56a19a0ac836e3598ff6fc8c9ba4d1cd2
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let Generator::packageName() return the default package name of the
type data base instead of storing it in a member variable. Instead,
use a member variable for the module name which is derived from it,
since it is queried many times.
Use the default type system entry instead of searching for it
via package name.
Change-Id: I171330b3d73d2e3ceac239e4c1c6f130e9f5ee7b
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
| |
Change-Id: I350bfb27d5f7403edbe3062895df3812728e2290
Reviewed-by: Alexandru Croitor <alexandru.croitor@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>
|
|
|
|
|
|
|
|
| |
Introduce a function for determining the init function name and
simplify the code writing the module wrapper.
Change-Id: I818f7a23902f1c9c1ce3cdad3d37dc18403006dd
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
This makes it easier to access the default type system entry,
which will always be the first one in the list.
Change-Id: Ie0844cef5fa4f0cd8bc50c28898e54a42845c830
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Extract the <brief> element from the WebXML class description and
place it at the top with an internal reference (More...) to the
detailed description. For this purpose, extend QtXmlToSphinx by a
<rst> element to be able to pass through rst elements as is, which
might come in handy for other purposes as well.
Change-Id: I8e3fd9e3ead99b205afdd5f4be948c0d34336a94
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The clangparser was already recording the exception specifier for
wrapped functions, but the code generator did not transfer the type
specifier to the wrapper function. With modern compilers this leads
to compile errors as the exception specifier is now part of the
type. Noexcept is now added whenever the clangparser determines the
source function is noexcept.
Change-Id: I1f68981d997fcf4f007569c6d682e3dcf68eca60
Fixes: PYSIDE-977
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
PySide2/QtWidgets/PySide2/QtWidgets/qgraphicsscenehoverevent_wrapper.cpp:95:12:
warning: ‘char* strncpy(char*, const char*, size_t)’ output truncated
before terminating nul copying 28 bytes from a string of the same
length [-Wstringop-truncation]
Use the correct length and use memcpy().
Change-Id: I0830cd9b499f2f49a1f3334c2407f877e79738d4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
| |
Strip the module names.
Change-Id: I7b123acc30e15e0954fe88f3a5b677e9aa736732
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
Add a deprecation note to deprecated functions and classes.
There is a standard deprecated directive, but it takes the version
as a mandatory parameter, which we are unable to obtain from Clang.
Change-Id: Ice27b297fbd86def41d99b0f3505551ed301077f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the note directive previously used for \since by the standard
versionadd directive which takes less space.
Move it below the function parameters and indent it along with the
parameters correctly as otherwise the formatting is messed up.
Change writeFunctionSignature() to return a QString which is more
convenient for indenting.
Remove the bool writeDoc parameter from
QtDocGenerator::writeFunction() and spell out the formatting in
writeConstructors() since it all needs to be indented properly (using
the new indenter helper).
Change-Id: I2294ba457ed05f431be295f9d42489aeb6805a8a
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Move it to a separate header and turn it into a non-type template with
a tabWidth parameter to make it possible to use it with arbitrary tab
widths.
Turn it into a non-type template taking the tab width.
Change-Id: Ib2b6a7379ce66d1a22e73b4cb6a4a9a9b457014d
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
After the bug found in PYSIDE-928, the contextlib problem of
Python 3.5 also vanished.
What remains is the crash on shutdown which is caused by
module 'testbinding'.
Task-number: PYSIDE-953
Change-Id: I07f18fa468fdb0758ee4e4b7663c3a42bec42822
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
| |
While converting smart pointers do not initialize the object with
default/minimal constructor.
Change-Id: Ie9400d8487accc0c90b0f0b31b855038ae698b5c
Task-Id: PYSIDE-947
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python 3.5 has a bug that crashes the build.
See the description in the issue tracker.
The cure is to use a more recent contextlib.py and to avoid
a PySide cleanup function that creates the crash.
The problem is not solved for Python 3.5, and it is not clear
if the testbinding module has a hidden bug, too.
But this fix seems to be good enough for the moment.
We should decide if we are going to fix Python 3.5 or abandon
it altogether.
Change-Id: Iacf2237de1f34d2b3cd1d68f1fb5833bdca3fdc2
Fixes: PYSIDE-953
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
| |
Use the cppName when looking for metatype while generating smart
pointer getter function
Change-Id: Ib3a632dd7f667a6bf7c487cfb673f0e55cbddde9
Fixes: PYSIDE-948
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|