| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was a bug in the signature function 'GetClassOfFunc' since last
November (sha1 2533dab013455bf94da2d4766e54abaf4d735e1e).
A type was returned without Py_INCREF. That happens because types are often
looked up, only, but here a normal return needed a ref.
Change-Id: I3e0956b341d2b0753da2e33dd9f557b6a693098d
Fixes: PYSIDE-928
Fixes: PYSIDE-937
Fixes: PYSIDE-943
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The signature module tries to figure out if it has to act upon
functions by examining their type.
It was too specific to check for PyCFunction, directly. A user
had built a subclass of PyCFunction and used it with 'inspect.signature',
which then revealed wrong behavior.
This patch removes that restriction.
Change-Id: I7e126ce5750ec5c308cbd1bd1bc4ca4d5eb51e17
Fixes: PYSIDE-950
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Attempts to load the module directly from Python if loading it manually from
the .py file fails. This exposes the support submodule to installers. The
loader.py module was also patched to allow direct import from installers.
Change-Id: If225ae7a2e916912a581e09d1a02c18fd3a17526
Fixes: PYSIDE-942
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ownership is always set recursively, so for each
element we check the children of the object.
When we don't have any, and also no parent
the mechanism we have fails, so for constructors
that allow having a null parent, we need to just
skip this function.
Change-Id: Iee6a81409cad7dd08c6ecbafd1b11c9a7bb0db85
Fixes: PYSIDE-922
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
|
|
|
|
|
|
|
|
|
| |
Add #ifdefs, fixing:
sources/shiboken2/libshiboken/pep384impl.cpp:413:1: warning: ‘PyObject* PepRun_GetResult(const char*, const char*)’ defined but not used [-Wunused-function]
PepRun_GetResult(const char *command, const char *resvar)
Change-Id: I5e469d6a24e95a602b882adbaad334a4ecf9af23
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The signature module will be used to generate automated
documentation by using the function signatures as docstrings.
This functionality should be low-hanging fruit. Actually, it was a
bit tricky to get this working. The crucial point was to use
PyType_Modified().
The function works fine on methods.
Supporting types needs some more effort.
It is not clear why the __signature__ attribute can be added,
but the change to __doc__ is not recognized. May be related to
the absence of Py_TPFLAGS_HAVE_VERSION_TAG ?
This will be addressed another time.
Task-number: PYSIDE-908
Change-Id: If8faa87927899f4c072d42b91eafd8f7658c6abc
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The TypeError messages can now be produced, based upon the
signature module.
As a feature under test, we produce ValueErrors instead in
certain cases. This will probably improve, later.
We are currently investigating how much can be determined,
automatically.
Task-number: PYSIDE-795
Change-Id: Ie8a648beaf8a3bed388e3c01ba501bb36859722e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The script is now automatically called in the cmake build,
as part of the create_pyside_module macro.
The script runs after every module build and tries to
generate .pyi files. This does not need to succeed, but
will generate all files in the end. The script has been prepared
to allow partial runs without overhead.
After integration of the .pyi generation into cmake, these files
are also installed into the install directory by cmake.
For wheel building, setup.py has entries, too.
Building a full project with all modules revealed a bug in the
signature module that allowed unsupported function objects.
Module enum_sig had to be changed to suppress types
which have no ancestry in shiboken.
PYTHONPATH was avoided because it was not Windows
compatible. Instead, the script was changed to accept
"--sys-path" and "--lib-path" parameters. The latter evaluates
either to PATH or LD_LIBRARY_PATH.
The necessity to create .pyi files while the project is in the
build process showed a hard to track down error condition
in PySide_BuildSignatureProps.
Simple logging was added as a start of introducing logging
everywhere.
Task-number: PYSIDE-735
Change-Id: I6b3eec4b823d026583e902023badedeb06fe0961
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Task-number: PYSIDE-852
Change-Id: If1ff8407c7f9449be278869e91104372fa86790f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
|
|
|
|
|
|
|
|
|
|
|
| |
A new version is now in use, causing:
qtattributionsscannertorst.py:122:
".../sources/shiboken2/libshiboken/bufferprocs27.h" is not a file
Change-Id: I14d9b9d8902ff7b3595b0e5b88d957a3847ecdae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|\
| |
| |
| | |
Change-Id: I3bb491686968e81382c135ab737da259d9796f52
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a type has nullptr as tp_dealloc, there apply different defaults.
Static types had object_dealloc as default, while new heaptypes
created with type_new have subtype_dealloc as default.
A problem was now that PyType_FromSpec also has
subtype_dealloc as default. But that is wrong, because a type that
was written with the static type approach is already written with
object_dealloc in mind and takes somehow care about further issues
with that type.
When we now convert this type and suddenly use subtype_dealloc
instead of object_dealloc, things get pretty wrong.
Finding that out was pretty hard and took quite long to understand.
The fix was then very easy and is the best proof:
Replacing our former (wrong) solution of supplying an
SbkDummyDealloc with a function object_dealloc works perfectly,
and the leakage completely vanished.
The documentation now is also corrected.
Task-number: PYSIDE-832
Change-Id: Ifc20c28172eb5663cd5e60dac52e0a43acfb626c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I2468031ecb8cc8a97bcb8ddf85e48101ec22eda9
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The pointers of probe_tp_name and check->tp_name are different
when using the MSVC debug runtime. Use strcmp() instead.
Fixes: PYSIDE-835
Change-Id: I8b6735a9a407bf3325986edd61a7911964802a24
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If a GUI class happens to be detected unreferenced when garbage
collecting in a non-GUI thread and is subsequently deleted, crashes
can occur for QWidgets and similar classes.
The hitherto unimplemented delete-in-main-thread" attribute should be
used.
Add the missing implementation. Add the field to shiboken's type entry
and SbkObjectTypePrivate class and pass it via newly introduced flags
to introduceWrapperType().
Defer the deletion when invoked from the background thread and store
the list of destructors in a list in binding manager run by
Py_AddPendingCall().
Task-number: PYSIDE-743
Task-number: PYSIDE-810
Change-Id: Id4668a6a1e32392be9dcf1229e1e10c492b2a5f5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
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 new clang compiler version complains when the "register" keyword
is still used. This patch suppresses this warning for Python.
The file "typespec.h" was corrected to include skbpython.h, too.
This was found after a few warnings still did not vanish.
Change-Id: I1e3299f071c6dffee4cb2596415bc195264d9a9b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove left-over from f61be404a9e197af33e169d1e81afb8df3f0546e, fixing:
shiboken2\autodecref.h(109): warning C4193: #pragma warning(pop): no matching '#pragma warning(push)'
Change-Id: I82a2b8627cd88393436568e12839a1ae988ac0dc
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: Ie4320a6ac584ec47ed8eaca538453a8e5b123c42
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
PyObject_GetBuffer will increment the reference of Py_buffer, when the
buffer is no longer being used, we should call PyBuffer_Release to
reduce the reference count.
See https://docs.python.org/3/c-api/buffer.html#c.PyBuffer_Release
Task-number: PYSIDE-140
Change-Id: Ia7c231aff317252db83b2405237031fc73af2651
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Implementing the deleteInMainThread feature requires being able to
collect a list of destructors and potentially storing it. This
requires splitting out the actual deallocation/destructor calls from
the DtorCallerVisitor and DeallocVisitor classes.
Since this is the only use of the virtual HierarchyVisitor::done()
method (and it does not really belong to the visitor pattern), remove
it.
Change the void visit() method into a bool from which true can be
returned to terminate. The finish()/wasFinished() methods can then
also be removed from HierarchyVisitor and the code simplified
accordingly.
Replace the DtorCallerVisitor and DeallocVisitor classes
by DtorAccumulatorVisitor that collects a list of DestructorEntry
structs containing destructor function and C++ instance.
Polish the code a bit, use member initialization, add override, move
implementations to source and some spacing for clarity.
Task-number: PYSIDE-810
Change-Id: I5e3ef6df753679ec111a5f0d1b75305bd5cf1c0c
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: Ie346fe7d7ac85ce0b82806904044680713375bf0
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Even though we are certain of the comparison,
better to get rid of the warnings.
Change-Id: Iafa51b4c59c2315b24fc9092d18792f0c9297553
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| | |
Change-Id: Ie8025300580981c5349b31d4846a7f659481991d
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Using the size() method for that purpose can be expensive for standard
containers.
Task-number: PYSIDE-727
Change-Id: I0da34e271503384a741d856fff5e84fee67bc97f
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The operators cause compiler warnings about multiple versions and
missing return types. Replace them by a reset() method (modeled after
std::unique_ptr, QScopedPointer).
This implies some changes in the templates.
Change-Id: I21a8fb9b84ecdfecf9671fa113f1bb3c6483166f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Add override
- Use = default for trivial constructors/destructors
- Delete copy and move constructors/assignment and move assignment
operators where not needed
- Use member initialization and remove constructors from simple structs
- Use explicit where applicable
Change-Id: Id293dd0008b05243e665347f12fd1dee3b1b70f7
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Remove else after return/continue/break; unindent code
or simplify return conditions
- Fix C-style casts
- Comment out unused parameter
Change-Id: Iea1106023829658cd1ce005fa02d0c8940504dfd
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: I302543eef74bc1f3dc6340cdfab7510a66ea1b6a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The signature module is an extension that generates full
introspection as a PySide feature. It is documented
in detail to make it usable and extensible for other developers.
Special care was taken about the interaction with the rest of
the project, related code that is based upon this module, and
the interaction with the COIN module.
Task-number: PYSIDE-510
Change-Id: I7b3052da71a6fe3bd6d9cb8cc47443cdf976d3b0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After the signature module has been around for quite a while,
there is no longer a reason to leave it optional.
At the same time, we set the minimum Python 3 version to 3.5 .
Some comments are reworked as well, but nothing real changed.
Task-number: PYSIDE-510
Change-Id: I9e960f390d507d24bb45f7028838755fe23e751d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ide71a89ef173d6f3e1fa6960f7b15f1fd6cc1bf1
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Python Limited API brings certain restrictions to PySide.
This document contains an overview and all relevant changes.
Furthermore, there are appendices which show how the
type transformation of the extended types was done
and how it was verified..
Task-number: PYSIDE-768
Change-Id: Ifd6fd3740c23deaed65cce1ba12f17e5f093f18f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When types have attributes starting with two underscores but
ending with at most one, Python uses name mangling to create
a unique private variable.
PySide needs to obey this rule in the tp_getattro methods.
We implemented it as an optimized _Pep_PrivateMangle function that
solves the problem internally without exposing the _Py_Mangle
function.
Remark: I think the exclusion of the _Py_Mangle function is another
oversight in the Limited API.
Task-number: PYSIDE-772
Change-Id: I0bfc2418dae439e963a16e37443f2099c6980696
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It has been a problem to compile the file "typespec.*" when using
Python 2. For some reason, the name "slot" was not usable.
I cannot find out what it was and how it vanished, but now I could
remove the work-around without problems. Maybe it is due to some
different includes which don't define some macros?
Change-Id: If316c9c78a18cffcc5e4cac07610bd7f522db446
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Avoid potential clashes of Qt's "slots" macro when using
compilers that support the push_macro pragmas.
Change-Id: I33aaa7f4e11cb235344f3bfecd08b9d5ce434227
Reviewed-by: Christian Tismer <tismer@stackless.com>
|
|\|
| |
| |
| | |
Change-Id: I5dd997d995feae2ddf207eb213fb08233dece77c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some formatting was not ok, some ordering of methods
was not perfect, some code vanished, bufferprocs had a bad
filename, and descrobject.h did not need a patch, anymore
since things were solved in signature.cpp .
Task-number: PYSIDE-560
Change-Id: Ibd1bedf0763ebb3fbbfd33a8e7cff4b5af6fab5e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Change the ref count map to a unordered_multimap and the remaining
lists to vectors.
A linked std::list is not suitable for the lists
used in libshiboken.
Task-number: PYSIDE-727
Change-Id: Ibd65486a58cf43ac66b981bea65597df5a732b63
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|/
|
|
|
|
|
|
|
|
|
| |
Avoid repeated invocation of container.end() in the loop condition
by either assigning to a variable or use range-based-for where
possible.
Use auto for iterators to allow for changing the container type.
Task-number: PYSIDE-727
Change-Id: I5217207a3a7fb60823ccbcbf0915bf6cf21a3e4d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While trying to document the Limited API Project,
it suddenly struck me:
We can make the patch much much simpler and implement it
without the necessity to have an extra PepType!
Now I am happy to continue the documentation, because
it is now no more improvable.
This version will last as long as the layout of
PyTypeObject does not change substantially. When that
happens, then we need to rewrite stuff with the according
PyType_GetSlot() access functions.
These access functions will until then be complete enough
so that we can live without the tricks like inventing a reduced
PyTypeObject as was done in the current implementation.
Task-number: PYSIDE-560
Change-Id: I49849cc377baa6794a5b53292691e21d6e2853ab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|