| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The "Cleanup pointer whitespace" patch was augmented by some
C++11 changes.
Unfortunately, this was done in the same commit, and so some old
whitespace that was removed could re-appear invisibly, since it
was in the original version.
This fix tries to remove all trailing whitespace and also adds a few
" *" corrections that were lost. The "type *" entries in XML files were
changed back to "type*".
Change-Id: Ic5c945ad64a47455fb15eebdf184b126af5ecd1d
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are signals and properties which are correctly supported
in PySide by the function "fillQtProperties". The structures are
introspected by calling "QMetaObject::indexOfSignal" and
"QMetaObject::indexOfProperty".
By allowing any property, extending the above restriction,
we break the Qt API slightly, but have the tremendous
advantage of being able to write all needed properties into
the constructor call.
This approach is a compromize that keeps the attribute calls
as they currently are. Supporting real properties where we
actually have getter and setter functions would be possible
as well, but that would break compatibility very much!
It has to be discussed if we want to support a configuration
switch that enables this incompatible change.
If we would go this far, then I would do this together with
changing mixedCase to lower_case.
A simple test case has been added.
Task-number: PYSIDE-1019
Change-Id: I8094df51d63aa767a5a9ec1c83bcf7db7b157a01
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idiom to create an application if none exists
qApp or QApplication()
did not work on Python 2. This was recognized when another
unrelated test broke that tried to use the idiom.
This patch adds the missing method to Py_TYPE(Py_None)
which Python 3 already has.
A test case was added.
Side-effect.. The warning about missing braces is gone,
after the "PYTHON_IS_PYTHON3" macro is defined. This
was forgotten in the review when when the macro was
moved out of signature.cpp .
Task-number: PYSIDE-571
Change-Id: I9b9304f407cd4cafb3ba0945ffb045802503a343
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Some use cases need direct data access for performance,
e.g. initializing QPolygonF data with numpy.frombuffer. Implementing the
Buffer Protocol as described in PEP3118 will allow direct data
access.
Change-Id: I13c46055b1cba115d099f1becb64c4cd04acdf0e
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
The OpenGL version functions produce a lot of library code, so, add
them as a separate module.
Task-number: PYSIDE-955
Change-Id: I44737f4741f0a81f46a192961173e154ae66698e
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a regular expression with the types, fixing:
qt.shiboken: (gui) signature 'setUniformValue(const char*,GLfloat)' (specified as 'setUniformValue(const char*, GLfloat)') for function modification in 'QOpenGLShaderProgram' not found.
Possible candidates:
...
setUniformValue(const char*,float,float,float,float) in QOpenGLShaderProgram
setUniformValue(const char*,int) in QOpenGLShaderProgram
setUniformValue(const char*,uint) in QOpenGLShaderProgram
...
Amends 05ae61cba5f943eb58343b44f8d474bc88bf0ce4
Task-number: PYSIDE-989
Change-Id: Ib12ca0309dfa46cca87e8deb546378b185a56b66
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
| |
Some XML tools trip over the missing character set.
Change-Id: Icbe1b2485325b70c4772b6a370a98fd529437a8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The registry had a duplication of code in the self-test that
led to an oversight.
To prevent that in the future, the error handling has been
rewritten, and an extended self-test was written that checks
the correctness of every case.
A truth table has beed added as a reference for questions.
Change-Id: I4570b2388c9b179b33c9520a484e09b9ccb68918
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Situation..
PySide works fine with normal applications. But when installers
are used to pack the application together, then the signature
extension cannot be loaded.
This is a problem that exists since the signature extension was
written. But starting with PySide 5.12.1, the signature extension
is very visible, because it is used to support the __doc__ attribute.
There have beed successful attempts to solve the problem for
PyInstaller and Py2App. But there are more packers available,
and they all need a change both in PySide and in the packer.
Solution..
To solve this problem once and for all, we embed the Python
support files in the binary shiboken package. When the Python
files are not normally accessible, they are unpacked from a ZIP
file.
Details..
- The embedded files shall only be used when the normal files
are not available,
- The signature extension should no longer be lazily loaded.
When the application starts, all files should be present.
- We drop support for shiboken2.support.signature and
use a single, independen folder 'shibokensupport' (proposal).
This avoids problems with multiple existence of the shiboken2
folder. PySide2.support.signature remains the official interface,
but it's only an alias when PySide2 exists.
- The embedding is used when the normal files cannot be
loaded for some reason. It can be enforced by a sys variable
"pyside_uses_embedding".
- Testcase is included.
- Tested with PyInstaller on macOS
Fixes: PYSIDE-932
Fixes: PYSIDE-942
Change-Id: Iaa62dc0623503a2e0943eedd10d2b2484c65cc2d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After the project split, shiboken exposed its own modules, and the
overall structure with shiboken2.support.signature and
PySide2.support.signature was already quite complicated.
When introducing embedding, it is necessary to have some support
folder that gets unpacked from a zipfile. That means, the shiboken2
root directory would be in the zip file in the embedding case.
This does not only increase the complexity, it further means
that we must make shiboken2.so available in the shiboken2
containing zipfile!
In order to avoid that, we stop the dependency from the two
support directories and use shibokensupport, instead. The
simplification of the loader and other modules is also significant.
Task-number: PYSIDE-510
Change-Id: Ic735a8d36f10f03698378f2ac9685a5955e40b0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
VoidPtr:
Add toBytes() method that return a char* representation
of the void* pointer.
QByteArray:
The current implementation only provided the Buffer Protocol
for Python2, this patch includes the getbuffer implementation
for Python3.
Having a BufferProtocol implementation for Python3 allows the
initialization of VoidPtr to get access to the internal content,
so one can go back and forward with the representation of it:
ba = QByteArray(b"Hello World")
vp = VoidPtr(ba, ba.size())
vp.toBytes() # b"Hello World"
The BufferProtocol was also changed for Python2 including the new
buffer protocol (Py_TPFLAGS_HAVE_NEWBUFFER) function `bf_getbuffer`.
A test case was included.
Fixes: PYSIDE-934
Change-Id: I8936966da91b2dcc879c582cfc35e6a35f7a60b6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type(QtWidgets.QWidget).__new__(type(QtWidgets.QWidget), "", (), {})
gave a problem in Python 2.7 after transition to PEP 384.
The reason for the problem is a check in Python 2.7 that tries to find
out if the function used to create a new object is a secure (builtin)
one. Therefore, all new types that are generated by a Python function
are filtered out. Unfortunately, Python 2.7 did that assuming that
only Python classes are heap types.
This is at least no longer true since Python 3 migrated to the new
type API where all new types are heap types.
The internal check was therefore changed to do the test for a builtin
"new" function differently. But not in Python 2.7 .
The workaround was to create the Shiboken.ObjectType as a heap type
and then remove that flag from the type. This seems to have no bad
effects, probably because the types did barely change when doing the
transition. Anyway, I will stay tuned and watch out if this later
creates a problem.
Task-number: PYSIDE-816
Change-Id: Ia596716b0e5dff3f1a7155ab6765186ef0b9d179
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a CMake super project that includes the shiboken2, PySide2 and
pyside2-tools subprojects, so that it's possible to build everything
from Qt Creator (or any other IDE that supports CMake)
with minimal set up effort, and thus inform the IDE CMake integration
of all relevant files, for easier code editing, navigation and
refactoring.
This also lays the foundation for allowing 3rd parties to use the
shiboken2 generator to generate custom modules. This is
achieved by eliminating various hardcoded paths for libraries and
include directories.
Start using CMake targets throughout the build code to correctly
propagate link flags and include dirs for libshiboken and
shiboken2 executable targets. Same for the libpyside target.
Generate two separate cmake config files (build-tree / install-tree)
that can be used with find_package(Shiboken2), to make sure that
the PySide2 project can be built as part of the super project build.
This is currently the only way I've found to allow the super build
to work.
Note that for the build-tree find_package() to work, the
CMAKE_MODULE_PATH has to be adjusted in the super project file.
The generated config files contain variables and logic that allow
usage of the installed shiboken package in downstream projects
(PySide2). This involves things like getting the includes and
libraries for the currently found python interpreter, the shiboken
build type (release or debug), was shiboken built with limited
api support, etc.
Generate 2 separate (build-tree and install-tree) config files
for PySide2, similar to how it's done for the shiboken case, for
pyside2-tools to build correctly.
Install shiboken2 target files using install(EXPORT)
to allow building PySide2 with an installed Shiboken2 package
(as opposed to one that is built as part of the super project).
Same with PySide2 targets for pyside2-tools subproject.
Make sure not to redefine uninstall targets if they are already
defined.
Add a --shorter-paths setup.py option, which would be used by
the Windows CI, to circumvent creating paths that are too long,
and thus avoiding build issues.
Output the build characteristics / classifiers into the generated
build_history/YYYY-MM-DD_AAAAAA/build_dir.txt file, so it can be
used by the test runner to properly filter out blacklisted
tests. This was necessary due to the shorter paths options.
Fix various issues regarding target includes and library
dependencies.
Remove certain duplicated cmake code (like limited api check and build
type checks) in PySide2, given that that information will now be
present in the exported shiboken2 config file.
Include a short README.cmake.md file that describes how to build
the super project.
References used
https://rix0r.nl/blog/2015/08/13/cmake-guide/
https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/
https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
https://cliutils.gitlab.io/modern-cmake/chapters/basics/functions.html
https://cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html
https://github.com/ComicSansMS/libstratcom/blob/master/CMakeLists.txt
Abandoned approach using ExternalProject references:
https://cmake.org/cmake/help/latest/module/ExternalProject.html
https://stackoverflow.com/questions/44990964/how-to-perform-cmakefind-package-at-build-stage-only
Fixes: PYSIDE-919
Change-Id: Iaa15d20b279a04c5e16ce2795d03f912bc44a389
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove duplicate modifications of
QOpenGLExtraFunctions::SamplerParameteri/fv()
that are covered by the below regular expression
- Remove QMatrix4x2::copyDataTo() as is done for the other QMatrix<N>x<M>
classes, fixing:
There's no user provided way (conversion rule, argument removal, custom code,
etc) to handle the primitive type 'float *' of argument 1 in function
'QMatrix4x2::copyDataTo(float * values) const'.
- Remove the array modifications of the QMatrix<N>x<M> constructors
(specializations of QGenericMatrix). They don't work since the
handling is not implemented in shiboken's
AbstractMetaBuilderPrivate::inheritTemplate(). This can be fixed,
but has no effect here since the manually added constructor from a
PySequence always takes preference. This fixes:
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)'.
'const float *' of argument 1 in function 'QMatrix2x3::QMatrix2x3(const float * values)'.
'const float *' of argument 1 in function 'QMatrix2x4::QMatrix2x4(const float * values)'.
'const float *' of argument 1 in function 'QMatrix3x2::QMatrix3x2(const float * values)'.
'const float *' of argument 1 in function 'QMatrix3x3::QMatrix3x3(const float * values)'.
'const float *' of argument 1 in function 'QMatrix3x4::QMatrix3x4(const float * values)'.
'const float *' of argument 1 in function 'QMatrix4x2::QMatrix4x2(const float * values)'.
'const float *' of argument 1 in function 'QMatrix4x3::QMatrix4x3(const float * values)'.
Change-Id: Iea9ced35158b31fb006d038cd5c307d5feec839e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
For starters, add the classes so that ready-made classes like
QAbstractItemModelReplica can be used. Actually implementing repc
requires another step.
Task-number: PYSIDE-862
Change-Id: I28adb1d45c262f298f0ad1926198ec6a3013542f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even though we have support for Void*, having to import
it as an additional class to be able to call a separate
function, is adding too much complexity so something
that should be easy to do, like creating an index
for an itemmodel.
The regression is a change that replaced the way of doing:
QAbstractItemModel.createIndex(0, 0, PyObject*)
to
QAbstractItemModel.createIndex(0, 0, VoidPtr(PyObject*))
which is not really intuitive, and is generating other issues.
Included modification in the registries too.
Change-Id: Ie6112c6baeb4fc3b22fc78e7edeb66aa4a17c22b
Fixes: PYSIDE-883
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
| |
Change-Id: Ib4a9e8be733a3c8012e19c509ed98f87aad7cb6d
Fixes: PYSIDE-892
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Use METH_STATIC only when there are no instance methods in the same class.
Unearthed by a clash of QPlainTextEdit::find() and static QWidget::find(WId).
Change-Id: I891c678e004a0abc3937437b0cac26e8094853de
Fixes: PYSIDE-886
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the <class>_PTR_CppToPython_<class> converter function (written by
CppGenerator::writeConverterFunctions()), the generated code
used typeid(*ptr).name() to retrieve the name to use for the
SbkObjectTypes. This construct returns the name of the outermost
class (for example, "QWidget" for a QWidget-type paint device returned
by QPainter::device()), as opposed to "QPaintDevice *" returned by
typeid(ptr).name(). This caused a crash with multiple inheritance
since QWidget inherits QObject and QPaintDevice and the "QWidget"
type was associated with the QPaintDevice pointer.
To fix this:
- Add API to libshiboken to obtain the SbkObjectType* by name
and check for the presence of a special cast function (multiple
inheritance).
- Generate the code of <class>_PTR_CppToPython_<class> as follows:
Check whether the outermost type obtained by typeid(*ptr).name()
has a special cast function. If that is the case, use the
type name obtained by typeid(ptr).name() (base class) to create
the wrapper.
Change-Id: I8ee6b4c084e9dafa434623433661809b83aedee5
Fixes: PYSIDE-868
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
| |
After the existence test war activated, the newly generated
files are ready for checkin.
Change-Id: I5118b83fab1a1c52c56166aaf4e8b026722966e0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
There have been a lot of changes and enhancements when
recursive classes were enabled and type hinting was created.
When these patches are stable and checked in, this follow-up
should be activated and all signature files re-created.
Task-number: PYSIDE-735
Change-Id: I0c80c7986a5e02e380760d0a6b89faa7be2be2ba
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The signature module has been quite far developed.
In the course of making things fit for the TypeErrors with
the signature module, now also all signatures from all
shiboken modules are queried.
Instead of writing an extra signature existence test for
shiboken, it made more sense to extend the existing
init_platform.py by the shiboken modules.
In fact, by this query a corner case was exploited that
worked on Python 2 but assertion-crashed on Python 3.
The mapping.py modules were also completed to support
all new PySide2 modules.
Special care had to be taken because the "shiboken2" module
exists both as directory and as binary module. The fix was
tricky, and I will add a task that replaces such workarounds
by a better design.
Task-number: PYSIDE-510
Change-Id: Ibf8e322d1905976a0044a702ea178b7f98629fb4
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
| |
Change-Id: I083fbeace177b627caef02fce1e738163461f91a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to the nature of the qApp singleton,
it was not enough to add the refcount of the style
via the typesystem, as usual.
An additional step of getting a reference to the qApp
to set the parent of the style was required.
A test case was included.
Change-Id: I5e60983e961e7d3d310b1e1c2f6f9b80ee095308
Fixes: PYSIDE-861
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An old fix for a QDataStream bug was performing
an additional step related reverse operations,
to make sure we call them if they were implemented
in other classes.
This was intended for shift operations.
Classes like QVector*, QTransform, and others
which include reverse operations like __radd__,
and __rmul__ will include this patch too.
When implementing a class that inherits from these types,
this becomes an infinite loop, which can be solved
applying this patch only for shift operations.
Due to this change, a QMatrix and a shiboken test
needed to be adapted.
Change-Id: Ie399837b6435b2cd058648a15f4d5cdff037ac6b
Fixes: PYSIDE-192
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PySide project has been split into three pieces, including
Shiboken. This had far-reaching consequences for the signature project.
Shiboken can be run together with PySide or alone,
with tests or without. In every configuration, the signature
module has to work correctly.
During tests, the shiboken binary also hides the shiboken module,
and we had to use extra efforts to always guarantee the accessibility
of all signature modules.
This commit is the preparation for typeerrors implemented with the
signature module. It has been split off because the splitting
is not directly related, besides these unawaited consequences.
I re-added and corrected voidptr_test and simplified the calls.
Remark.. We should rename shiboken to Shiboken in all imports.
I also simplified initialization. After "from PySide2 import QtCore",
now a simple access like "type.__signature__" triggers initialization.
Further, I removed all traces of "signature_loader" and allowed
loading everything from PySide2.support.signature, again. The
loader is now needed internally, only.
Also, moved the type patching into FinishSignatureInitialization
to support modules with no classes at all.
The "testbinding" problem was finally identified as a name clash
when the same function is also a signal. A further investigation
showed that there exists also a regular PySide method with
that problem. The test was extended to all methods, and it
maps now all these cases to "{name}.overload".
Updated the included typing27.py from https://pypi.org/project/typing/
from version 3.6.2 to version 3.6.6 .
Task-number: PYSIDE-749
Change-Id: Ie33b8c6b0df5640212f8991539088593a041a05c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation of the enum operations,
wrongly assumes that the first element is always an enum.
This patch add some logic to determinate the types
we are dealing with, to allow operations like:
2 + QtCore.Qt.Key.Key_1
which were not accepted before.
Float numbers are not accepted for enum operations
and a test case was included.
Some tests were adapted since they were wrongly
implemented.
Fixes: PYSIDE-830
Change-Id: I407dca2b7c39fc684dbdac19ad45d259403ebadd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shiboken did not have support for `nullptr_t` so the
converter was failing when encountering a `nullptr`.
A test case is included.
Fixes: PYSIDE-854
Change-Id: If5aad245e7074ed791bfc7a42a4c6a56de441d5b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch again contains a complete overhaul of the signature
module. The code was re-implemented to properly support nested
classes. Also, the code was reduced by AutoDecRef and by
adopting a concise C++ style.
Note.. We will add a shiboken signature test and complete
mapping.py after the split into three projects is done. The split
changes a lot and is needed right now!
Signatures were quite complete for PySide, but the support for Shiboken
was under-developed.
Since we are planning to generally enhance error messages by using
the Signature module, we should be able to rely on them to always
produce a signature. Therefore, a general overhaul was needed
to resolve all cornes cases for Python 2 and 3.
Nested classes are supported, as well as plain module functions.
The usage of the typing module might improve over time, but the
Signature implementation is now considered complete.
The loader will respect now the path settings which might not be
the package dir but the build dir. This is more consistens with COIN
testing.
Task-number: PYSIDE-795
Change-Id: I246449d4df895dadf2bcb4d997eaa13d78463d9b
Reviewed-by: Simo Fält <simo.falt@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have a proper `void*` treatment, so the extra
function does not seems to be necessary.
The injected code used for the interalPointer method was
also removed since is better to leave on shiboken hands
the conversion between void* and python types.
A couple of test were adapted since wrongly used ModelIndex
with Python objects.
Change-Id: I082637c7d1dd1bb0f50a3c453513e5d722f4b783
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Once the qtbase commit
(22c1a46a03bc3347afc0e7462e19558283d0e1b7) gets integrated into
the qt/qt5 repo for dev branch, we can revert the terrible
workaround fix, because it won't be needed anymore.
This reverts commit 5cd52cda24bf70bf99f4deec037039df0ab928f5.
Task-number: PYSIDE-724
Change-Id: I627c7ec945b864a1c16ba6cd7288807591f70140
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Add QAbstractNativeEventFilter. Re-add the native event filter
functions on QWindow and QWidget, modified to return a tuple
bool/long, using a modification from PySide.
Task-number: PYSIDE-790
Change-Id: I86fef1a0c168e69fb3391cd882ea05190985384d
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously whenever a typesystem XML file changed, this resulted in a
full rebuild of all cpp files generated for that particular module.
This change shifts the rules of building in such a way, that files
are rebuilt only if their content has changed.
XML modifications should generally not cause full
rebuilds anymore, unless the change is in a global header.
This is achieved in the following way, assuming a binding library
"foo" added by add_library(foo ...):
1) CMake calls shiboken via add_custom_command.
2) The OUTPUT file for the command is the generated
mjb_rejected_classes.log file, which serves as a timestamp
for when shiboken was last run.
3) All the generated cpp files are marked as "Generated" via the
add_custom_command BYPRODUCTS option. This allows the files
to have an older timestamp than that of an XML file, thus not
forcing constant shiboken re-execution.
4) A new custom target foo_generator is added via add_custom_target.
5) This target has a dependency on the mjb_rejected_classes.log file,
and the target itself is added as a dependency to the "foo" target.
6) Whenever "foo" is built, it will first try to build "foo_generator"
which will force the shiboken custom command to be run, which will
generate the cpp files and mjb_rejected_classes.txt file.
The BYPRODUCT cpp files can then be used as sources in the
"foo" target.
7) If a user modifies the XML file listed in the add_custom_command
DEPENDS option, this will re-trigger shiboken execution, which
will create a new mjb_rejected_classes.log file, which means that
the "foo" target might be rebuilt if, and only if, any of the cpp
file timestamps are new. Otherwise "foo" doesn't need to be
rebuilt.
Change-Id: I9a3844a2fa775106288acc01cb4570a903e16991
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Qt 5 introduces a new class QMetaObjectBuilder for generating dynamic
meta objects for use cases like QML. It provides an API to add methods,
properties and info and a factory method toMetaObject() to obtain
a QMetaObject snapshot reflecting the changes.
Replace the DynamicQMetaObject aggregated by TypeUserData by a class
MetaObjectBuilder wrapping a QMetaObjectBuilder with dirty-handling.
The code to create the binary data of the QMetaObject can then be
removed.
For plain Qt objects, the wrapped base meta object will be returned
(which fixes the bug).
Task-number: PYSIDE-784
Change-Id: Id8a54570aff36c75fe0f3bf2d297a12d02cd773a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the preparation for a number of planned applications
and extensions using the signature module.
This general overhaul contains:
- Extraction of signature enumerations into enum_sigs.py,
- a list of current keyword errors in arguments which are unsolved
in shiboken, but temporarily fixed in parser.py (too many for XML),
- fix spurious duplications in multiple signatures
- corrections for keyword errors in function names which cannot be
fixed by Python (quite few),
- fixing "..." arguments into "*args",
- supporting the "slot wrapper" type. This is necessary for
methods like "__add__", "__mul__" etc.
- Create an extra function "get_signature" that has a parameter to
modify the appearance, i.e. without self, without returntype, etc.
Task-number: PYSIDE-510
Change-Id: If16f7bf02c6e7cbbdc970058bb630ea4db2b854a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The test was written when PySide2 did not have the
"from PySide2 import *" feature. It was written with "try..except"
constructs to find the translated modules.
This did not work correctly due to the path settings in ctest.
When not all modules are selected, they are still partially importable!
For instance, PySide2.QtPrintSupport could be imported, although
it was not compiled, and then complained since a function was not found.
This is possible, because python 3 supports module directories without
an __init__.py file. (I was always against that "feature".)
Instead of adjusting the path setting, this patch uses the above feature
and does not rely on "importability".
Task-number: PYSIDE-331
Change-Id: I9aed4971f10f423918525cf411fd7ff713f40e48
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ie4320a6ac584ec47ed8eaca538453a8e5b123c42
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Linux is now renamed in a way that the Linux distributions are
recognized.
The names are a _bit_ verbose, but this works, at least :-)
Task-number: PYSIDE-510
Change-Id: Icd52cc92aa0e0b9c6e6b38e632cb89d09766c190
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After fixing non-type templates, QGenericMatrix can be
specified as their base class. The inherited functions can then
be used instead adding templates.
Change-Id: I5ec435cf04d8443626a86a78643e2ad5d29f4a5e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: I7f60b78b0c962e4faf3688581e7f550813d1a413
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
New exists_{platf}_{version}_ci.py have created, after the
registry was reset in the last commit.
We had a problem with differences between Linux versions
which led to incompatibilities.
Therefore, the platform name has been changed for Linux:
We now distinguish Linux platforms by name and version
by using platform.linux_distribution([:2]).
Example.. "Ubuntu 16.04" becomes 'ubuntu1604'.
When this checkin succeeds, we will need another last checkin.
Change-Id: I98511ee6fc3273055d1990a2cf4f2c028a430455
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ie346fe7d7ac85ce0b82806904044680713375bf0
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The extraction of exists_{platf}_{version}_ci.py has been done
by editing the testresults of COIN test by hand.
Since the beginning of the year, this has become tedious, because
COIN now surrounds everything with time stamps.
This script scans the whole website and extracts all such files.
Creation of the generated python pages becomes really easy now.
The initial scan takes below 30 minutes.
Then it will only parse new URLs.
Task-number: PYSIDE-510
Change-Id: I1273f8a77596ced16c7a3653c89736c3e1796540
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After scanning the whole COIN test website, a lot of changes were
found which we missed by manually inspectation.
This update contains the essence of all changes which accumulated
on the server. They were sorted by date, and the latest version
was taken. Then, the license headers were updated, because
that had been done already on the repository.
Update
------
This check-in did not work on 2018-09-07.
The reason was that we changed the PySide version to 5.11.2,
which was not yet in my update.
While re-doing the generation, I realized that we will not
automatically get the 5.11.2 version, because of the "fallback".
feature.
To reset the existence file, we need to remove them once.
After the checkin, all the files will be freshly created.
I propose also to disable the "fallback" feature. In the
presence of the multiple COIN testing, it is no more
necessary.
Change-Id: I43af314f7bd233a4190762c7204e8aecf81bfe72
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix warning:
CMake Deprecation Warning at tests/pysidetest/CMakeLists.txt:7 (cmake_policy):
The OLD behavior for policy CMP0020 will be removed from a future version
of CMake.
cmake should be smart enough to figure CMP0020 (automatic linking
of qtmain.lib on Windows) out by itself.
Change-Id: I3f0fb53158217be87b2c7971d84b19359998970c
Reviewed-by: Christian Tismer <tismer@stackless.com>
|