aboutsummaryrefslogtreecommitdiffstats
path: root/sources
Commit message (Collapse)AuthorAgeFilesLines
* shiboken: Replace more character #defines by char constantsFriedemann Kleint2018-09-054-203/+240
| | | | | | | | Break up macro concatenation and streamline code. Replace PYTHON_SELF_VAR by "self" since it is not going to change. Change-Id: Ibfffd12bd44eb4dc3390b0a0a2da99e003b04bdc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* libpyside/PyObjectWrapper: Fix clang-tidy warnings about class definitionFriedemann Kleint2018-09-052-5/+17
| | | | | | | | | | | | | | Rearrange definition and delete move constructor and move assignment operator. This unearthed that the (default-generated) move assignment operator was used (unintendedly) in: QDataStream &operator>>(QDataStream&,PyObjectWrapper&). Factor out a reset() method (modeled after std::unique_ptr, QScopedPointer) for this. Change-Id: I48c4f9ca1353984da870bb7eb3308a9f3374d309 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* shiboken: Replace some character #defines by char constantsFriedemann Kleint2018-09-046-37/+51
| | | | | | | | | | | | | | | Change defines to variables where possible (not used in string literal concatenations). Remove constants only used in one file from the header. Change regular expressions to raw string literals for clarity. Replace static instance of the CONVERTTOCPP regular expressions by an accessor of ShibokenGenerator. Change PATH_SPLITTER in main.cpp define to a QChar constant. Change-Id: If6766e0467ca2c635788240414c984d60feef875 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Replace QLinkedList<QObject*> by QVector<QObject*> in DynamicSlotDataFriedemann Kleint2018-09-041-4/+4
| | | | | | Change-Id: Id7b8c7ee48a3e0017d4c66fba34dff573fc59008 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Replace QLinkedList<QByteArray> by QByteArrayList in MetaObjectFriedemann Kleint2018-09-041-44/+27
| | | | | | | | Remove unused list parameter from DynamicQMetaObject::createMetaData(), adapt signatures, make const where applicable and streamline code. Change-Id: I0733382b2a6a35579d3e69280d674ad8a8f1bbc6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Fix visibility of members of the generator classesFriedemann Kleint2018-09-043-169/+172
| | | | | | | | | | Make visibility more restricted by moving definitions to the private/protected section. Remove virtual from Generator::moduleName() since it is not overridden. Change-Id: I6b43f9679741fa8a5c453b339d9bb4228d74c04c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-09-047-4/+21
|\ | | | | | | Change-Id: Ie8025300580981c5349b31d4846a7f659481991d
| * shiboken/doc generator: Add FunctionMask case to avoid warningCristian Maureira-Fredes2018-09-031-0/+2
| | | | | | | | | | | | Change-Id: I13226628db54479cc01aab215bb52063684f23c9 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken/other test: Add override to avoid warningCristian Maureira-Fredes2018-09-031-1/+1
| | | | | | | | | | | | Change-Id: Idcd2d5fcd2d6f5ab6e15b529e1f73c73a5ff29a9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * libshiboken: Use empty() to check for empty containers as clang-tidy advisesFriedemann Kleint2018-08-302-3/+3
| | | | | | | | | | | | | | | | | | 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>
| * Support for QAbstractVideoSurface in QMediaPlayerCristian Maureira-Fredes2018-08-291-0/+11
| | | | | | | | | | | | | | | | | | | | The method setVideoOutput did not have support for an QAbstractVideoSurface argument, so I included one with the same idea of the other signatures. Task-number: PYSIDE-794 Change-Id: I50c82eeb1c2c3157c21dc4eb6cff7b0c2b91f31f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * PySide2: Fix compilation with a with custom namespace specified for QtFriedemann Kleint2018-08-292-0/+4
| | | | | | | | | | | | | | | | | | | | | | Add missing QT_BEGIN/END_NAMESPACE macros. Patch as provided on bug report. Task-number: PYSIDE-635 Change-Id: I7ddb447f1aafeb8da72e7e192905bafe3809797d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | libshiboken: Replace AutoDecRef::operator= by a reset() methodFriedemann Kleint2018-08-314-22/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | libpyside: Fix clang-tidy warnings about class definitionsFriedemann Kleint2018-08-3111-37/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add override - Use = default for trivial constructors/destructors - Add Q_DISABLE_COPY where applicable - Use member initialization and remove constructors from simple structs - Use explicit where applicable (which requires adapting code snippets constructing a QVariant from PyObjectWrapper) - Fix some parameter to take a const ref or pass by value and use std::move in constructors Change-Id: I5e0d2c4ef92d20397a7daba2f8a64b507e678510 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | libshiboken: Fix clang-tidy warnings about class definitionsFriedemann Kleint2018-08-318-17/+38
| | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | libshiboken: Fix remaining clang-tidy warningsFriedemann Kleint2018-08-304-10/+8
| | | | | | | | | | | | | | | | | | | | - 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>
* | libpyside: Fix remaining clang-tidy warningsFriedemann Kleint2018-08-309-52/+48
| | | | | | | | | | | | | | | | | | | | | | - Remove else after return/continue/break; unindent code or simplify return conditions - Use isEmpty() to check for empty containers - Fix C-style casts - Pass std::size_t by value instead of const ref Change-Id: Ic997d7c39720c1cd3698c4d750e9cfc1f1654788 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Remove data fields representing unimplemented attributesFriedemann Kleint2018-08-305-174/+4
| | | | | | | | | | | | | | | | | | Remove member variables and enumeration values. Task-number: PYSIDE-743 Change-Id: Id7bff33b180e99e19d02bd895e45e4f0749dc042 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Doc: Change the snippet file extensionsVenugopal Shivashankar2018-08-2915-0/+0
| | | | | | | | | | | | | | | | | | | | | | The filename should be the same for the references in the documentation to work, but extension can change to py instead of cpp. Task-number: PYSIDE-691 Change-Id: Idca54292c67a32cdc2060314fe985bbd26f25d2f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | shiboken: Add support for const Foo* fieldsFriedemann Kleint2018-08-292-4/+25
| | | | | | | | | | | | | | | | Task-number: PYSIDE-304 Task-number: PYSIDE-672 Change-Id: Ic0e8e9ada594f27a8224adfb43847b3b8149c33d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-08-2910-183/+325
|\| | | | | | | Change-Id: I302543eef74bc1f3dc6340cdfab7510a66ea1b6a
| * Fix help display of backport_inspect (python 2.7)Christian Tismer2018-08-282-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python 2.7 has no signatures in its inspect module. We therefore add the missing stuff for the signature package using 'backport_inspect.py'. The resulting module is a bit unusual because it is assembled from different modules at runtime. When trying the code >>> from PySide2.support.signature import inspect >>> help(inspect) in Python2, we got only very little information because of some heuristics in the pydoc module that checks the module identity and finds only objects from the new one. It turned out that this heuristics can be circumvented when the "__all__" property is provided. pydoc then believes everything. We now have complete help info if the above module is used. The original inspect module is not changed at all. Change-Id: I3f24ada3b9ae9c79ec69a6280ddf3ea78735467b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Add ownership transfer to setGraphicsEffectCristian Maureira-Fredes2018-08-271-0/+5
| | | | | | | | | | | | Task-number: PYSIDE-66 Change-Id: Ifec85a5305bc196b261818bbc1b9af16fc07c927 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Document the Signature ModuleChristian Tismer2018-08-272-61/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Reduce the redundant signature_testChristian Tismer2018-08-273-89/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file signature_test.py contained together with basic signature property tests also an early form of the existence test, which is meanwhile implemented in pyside2/tests/registry/existence_test.py . This part is redundant in signature_test.py, and we remove it. The basic signature tests stay, and the module is degraded from registry to a normal test module in pyside2/tests/QtWidgets . Remark: This simplification was found when I was finishing the signature documentation. Instead of describing the intermediate state of the module, it was more straight-forward to remove the duplication. Task-number: PYSIDE-510 Change-Id: I7fbf65d6d2803926dc00485f1e82349912742942 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Make signature module unconditionalChristian Tismer2018-08-274-33/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | libpyside: Fix spelling of retrive->retrieveFriedemann Kleint2018-08-244-5/+5
| | | | | | | | | | | | | | Rename method and fix comments. Change-Id: I7765826540de0bf03ac41214d357e605d8e84bcf Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-08-249-303/+939
|\| | | | | | | Change-Id: Ide71a89ef173d6f3e1fa6960f7b15f1fd6cc1bf1
| * Enforce pure PyDict to be associated to VariantMapCristian Maureira-Fredes2018-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Classes that implement the dictionary protocol needs to be treated as PyObject and not plain dictionaries, then we can properly transform PyDicts to Variant Maps. The reason behind this is that it seems that the PyDict_Check is too permisive and allow objects that are not proper dictionaries. The default case by any other Sequence-like object will be a PyObject. Task-number: PYSIDE-82 Change-Id: I86e8a29e5b8740f69c9c6f315e9d337e599bd333 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Document the Python Limited APIChristian Tismer2018-08-212-291/+704
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Implement Proper Name ManglingChristian Tismer2018-08-217-11/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Limited API: remove the "slot_" workaroundChristian Tismer2018-08-234-38/+28
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | shiboken: Reduce generated include statementsFriedemann Kleint2018-08-222-8/+1
| | | | | | | | | | | | | | | | Remove shiboken.h from the wrappers and some unneeded headers from the module header. Change-Id: Ib05433e77686e544e3dcae27f5256ae1bbf146e1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | libshiboken: Undefine slots macros when including Python.hFriedemann Kleint2018-08-221-6/+22
| | | | | | | | | | | | | | | | 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>
* | Expose Shiboken generated Python module objectTilman Roeder2018-08-224-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | This change exposes the module object (a PyObject*) to the global namespace as Sbk[TYPESYSTEM NAME]ModuleObject. This is useful when generating bindings for cases where Python will run embedded into a host application. This variable is also included in the headers, where it is declared as `extern PyObject* Sbk[TYPESYSTEM NAME]ModuleObject;` for the convenience of developers reading the generated sources. Change-Id: Iaaa38b66b5d3aabc0fb8f995f964cd7aef2a11da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | shiboken/doc generator: Fix crash when normalizing tablesFriedemann Kleint2018-08-211-1/+7
| | | | | | | | | | | | | | | | | | Do not rely on row 0 to obtain the maximum number of columns, search all instead. Change-Id: I6ddda89c191d1823b346e9e564f31a61de523426 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
* | Clarify template error messageTilman Roeder2018-08-201-1/+1
| | | | | | | | | | Change-Id: I928ed3d07cd66393675d014050c3bf3ab2ea5c49 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-08-2012-55/+360
|\| | | | | | | Change-Id: I5dd997d995feae2ddf207eb213fb08233dece77c
| * Remove wrong ownership transferCristian Maureira-Fredes2018-08-161-5/+0
| | | | | | | | | | | | Task-number: PYSIDE-781 Change-Id: Ifd2ecbfe869e8739bfe91d17349a80c36b2823a5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| * QtLocation: add missing enumsCristian Maureira-Fredes2018-08-101-2/+6
| | | | | | | | | | | | | | Task-number: PYSIDE-487 Change-Id: I182156694d085c9a021a982b2d71ae1f25fbb9a8 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * QtDataVisualization: add ownership transfersCristian Maureira-Fredes2018-08-091-10/+302
| | | | | | | | | | | | Task-number: PYSIDE-487 Change-Id: Icfb707a3f50a7a2040946714049fa2aa178f0f0f Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Qt3DRender: add missing classesCristian Maureira-Fredes2018-08-081-6/+14
| | | | | | | | | | | | Task-number: PYSIDE-487 Change-Id: I3a6bc2d9b44844365932c52567bbecca5c0ef516 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Replace PySequence by PyList typeCristian Maureira-Fredes2018-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the issues that we have in the past were because the broad scope of PySequence. Precisely, inside the QVariant conversion related to PySequence we just deal with 'lists', then having a Sequence is too broad and misleading. The problem related to this task number was due to the wrongly assumption that a Python class that implements the sequence protocol is a list, and it's not. With this change, we verify after the PyDict case if the element is a PyList, and the last default case will be PyObject. Thus, a custom class that implements the sequence protocol is nothing else than a PySequence, not a list. I'm uncertain if we really want to also have a case for PyTuple or any other Sequence-like type. Task-number: PYSIDE-726 Change-Id: I586ba725200acf910cf7b8c01002914984f06b5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Invert return tuple order in QFont dialogsCristian Maureira-Fredes2018-08-072-2/+21
| | | | | | | | | | | | | | | | | | | | | | The return order was wrong, and since it is based in templates used by other methods, a new template needed to be created. Task-number: PYSIDE-755 Change-Id: I905529844063f7e913f264e68cfceb6ce7b45358 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix Some Minor Limited API Omissions And QuirksChristian Tismer2018-08-066-29/+16
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-08-064-40/+16
|\| | | | | | | Change-Id: I94feceebbf74afb6ad9b8f28303415df42b092bf
| * PySide2/QtGui: Fix build of Debian/armel,armh (OpenGL ES 2)Friedemann Kleint2018-08-061-4/+11
| | | | | | | | | | | | | | | | | | Add optional class checks to QtGui and use them for QOpenGLTimeMonitor and QOpenGLTimerQuery. Task-number: PYSIDE-764 Change-Id: Ib33ec1d64c40f53aa31059e4ca9422707636375d Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Doc: Remove third-pary license text and link to the Qt licenses pageVenugopal Shivashankar2018-08-063-36/+5
| | | | | | | | | | | | | | | | | | | | | | | | This avoids duplicating license information for third-party sources used by Qt. The lincence info. for such sources are listed in the Qt documentation, so a link to it from the Qt for Python doc is a better alternative. Task-number: PYSIDE-758 Change-Id: I4efd0b2b8cce5dd76ddc98c80d1ac5cd385c7398 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | shiboken: Implement template inheritance for fieldsFriedemann Kleint2018-08-033-0/+120
| | | | | | | | | | | | | | | | | | Add the fields to the typedef'ed class specializing the type similar to the functions. Task-number: PYSIDE-725 Change-Id: I2daae9bd3c8a73fbd868f495cfc3a2dfba703103 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Refactor code involved in inheriting template classesFriedemann Kleint2018-08-034-70/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a helper template to conveniently search for a MetaClass by name and convenience function to search in lists. - Remove parameter bool *ok from AbstractMetaBuilderPrivate::inheritTemplateType() and check on returned pointer instead. - In the inheritTemplate*() functions, use QScopedPointer to ensure the result is deleted on failure. - Search for a shadowing function first before creating the copy in inheritTemplate(). Task-number: PYSIDE-725 Change-Id: I3183087fb42b22a2189c17b94eaafdb4c1151f0e Reviewed-by: Christian Tismer <tismer@stackless.com>