aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2
Commit message (Collapse)AuthorAgeFilesLines
...
| * Set proper parent when overloading QUiLoaderCristian Maureira-Fredes2019-02-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a couple of methods of QUiLoader, we had a parent override leaving the methods without the proper parent. setParent(pyArgs[0], pyResult) # Correct setParent(self, pyResult) # Wrong override Defining the ownership to the target class corrects this issue and just leaves the "Correct" approach. Fixes: PYSIDE-938 Change-Id: Id20d74756e14c58caba2ab4c65484d15da88df16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Add common QPrintSupport typesystem for QWebEngineCristian Maureira-Fredes2019-02-255-3/+55
| | | | | | | | | | | | | | | | | | | | | | Moved around the files so we have a general QPrintSupport typesystem that we can include in other modules that need it, like QWebEngine. Change-Id: Ic277c37e6b0c08b370102d1bef18cd1375239169 Task-number: PYSIDE-946 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-02-1248-185/+12
|\| | | | | | | Change-Id: Iafe51380b453ee1849ed65f5342d79c76c21d28d
| * Return PyObject wrapper when not valid QVariantCristian Maureira-Fredes2019-02-081-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When resolving the meta type of QVariant we did not have a fallback case. So we had a NoneType when none of the converters worked. These changes allow to return a PyObjectWrapper of the object instead of NoneType. This allow users to use any type as QVariant. Change-Id: I18da3f10f6839975fdc0bf2ac62f6bd7063312df Fixes: PYSIDE-45 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Modernize cmake buildAlexandru Croitor2019-02-0746-179/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Type Hints: Handle Container Types Correctly: AddendumChristian Tismer2019-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The correction to container types has a small bug which does not exist in reality, but could give a problem in the future: - We need not only avoid instantiation in Missing, but generally in all _NotCalled classes. Otherwise, when called during processing of container types, they would loose their (Missing, Default, ...whatever) tag. Change-Id: I4eb154100da6f3067b816c190af314b2a710ff39 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-02-064-48/+34
|\| | | | | | | Change-Id: I59ee5389321478ed42dcef3319ffa82fa0423a02
| * typesystem_gui_common.xml: CleanupFriedemann Kleint2019-02-061-30/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
| * Type Hints: Handle Container Types CorrectlyChristian Tismer2019-02-051-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An error was reported that we had a bug in this .pyi line: def parseErrors(self) -> PySide2.QtScxml.QScxmlError: ... which actually had to be a list like def parseErrors(self) -> typing.List[PySide2.QtScxml.QScxmlError]: ... A deeper look revealed that we had very many other examples, also in the argument lists, were we did not handle containers properly. (For example, 90 times in QtCore!) This is a leftover from the type error messages which were generated in C++, and never really understood. This is now a clean rewrite of the C++ part to expose all information and an extension of the Python parser that systematically uses the container types from the typing module. The implementation became a bit more complex because of Python 2: We need to provide our own copy of the public typing module, because it is not safe to assume that this module can be loaded. Importing it from support.signature gave a problem because we now need to find the names of instances to produce List[...], which needed to be implemented in the loader. Implemented the "Pair" type now as a native generic type. This is more correct than the former implementation and shorter in the .pyi files. Additionally, an own definition of "Char" was provided for brevity. This was not important to implement and could also be done with "int", but it is helpful for the future to know how to implement own types (and it was fun). Task-number: PYSIDE-921 Task-number: PYSIDE-795 Change-Id: I0e565b38d7b4fff39dd606950f9f8d97c45acbf5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * PySide2/QtSxcml: Support bool *ok in some of the models' evaluateTo() functionsFriedemann Kleint2019-02-042-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add yet another version of the fix_args,arg,bool template, fixing: There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type 'bool *' of argument 2 in function 'QScxmlDataModel::evaluateToBool(int id, bool * ok)'. 'QScxmlDataModel::evaluateToString(int id, bool * ok)'. 'QScxmlDataModel::evaluateToVariant(int id, bool * ok)'. 'QScxmlEcmaScriptDataModel::evaluateToBool(int id, bool * ok)'. 'QScxmlEcmaScriptDataModel::evaluateToString(int id, bool * ok)'. 'QScxmlEcmaScriptDataModel::evaluateToVariant(int id, bool * ok)'. 'QScxmlEcmaScriptDataModel::evaluateToVoid(int id, bool * ok)'. 'QScxmlNullDataModel::evaluateToString(int id, bool * ok)'. 'QScxmlNullDataModel::evaluateToVariant(int id, bool * ok)'. Change-Id: Idfda2adc0875a4626797a92240fa5267016d04bb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-02-049-15/+36
|\| | | | | | | Change-Id: I22fe4e58477f979cab347f2d6303472f97a53860
| * PySide2/QtGui: Add more array modifications for const (unsigned) int * ↵Friedemann Kleint2019-02-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parameters Fix warnings: There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type 'const unsigned int *' of argument 5 in function 'QOpenGLExtraFunctions::glDebugMessageControl(unsigned int source, unsigned int type, unsigned int severity, int count, const unsigned int * ids, unsigned char enabled)'. 'const int *' of argument 3 in function 'QOpenGLExtraFunctions::glSamplerParameterIiv(unsigned int sampler, unsigned int pname, const int * param)'. 'const unsigned int *' of argument 3 in function 'QOpenGLExtraFunctions::glSamplerParameterIuiv(unsigned int sampler, unsigned int pname, const unsigned int * param)'. 'const int *' of argument 3 in function 'QOpenGLExtraFunctions::glTexParameterIiv(unsigned int target, unsigned int pname, const int * params)'. 'const unsigned int *' of argument 3 in function 'QOpenGLExtraFunctions::glTexParameterIuiv(unsigned int target, unsigned int pname, const unsigned int * params)'. 'const unsigned int *' of argument 2 in function 'QOpenGLFunctions::glShaderBinary(int n, const unsigned int * shaders, unsigned int binaryformat, const void * binary, int length)'. Change-Id: I764823352fc4360d167acb07e8502a1dc8c060dc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * PySide2: Remove enumeration AbstractPhysicalDevice::DeviceStatusFriedemann Kleint2019-02-011-3/+1
| | | | | | | | | | | | | | | | Fix warning: enum 'Qt3DInput::QAbstractPhysicalDevice::DeviceStatus' is specified in typesystem, but not declared Change-Id: I2d241e6c524cce84fc090fec3eca4595beb998d0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * QtGui: Fix warning about <array> modificationFriedemann Kleint2019-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | Extend the regexp for the <array> modification of glClearBufferXX() to actually check for '*' so that only the overloads with arrays match, fixing warning: glClearBufferfi(uint,int,float,int): Cannot use parameter 3 as an array: Type does not have indirections. Change-Id: Ic1cd24ca3d66ea7eac593b4a2d3b1a759ab1af18 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * PySide2/Widgets: Add overload of QInputDialog::getDouble()Friedemann Kleint2019-01-312-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Add modification and new variant of the fix_arg template, fixing warning: There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type 'bool *' of argument 8 in function 'QInputDialog::getDouble(QWidget * parent, const QString & title, const QString & label, double value, double minValue, double maxValue, int decimals, bool * ok, QFlags<Qt::WindowType> flags, double step)'. Change-Id: I02ee5c477d74698bd5dda23bbec01f39775d5c6d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * PySide2: Remove non-existent or moved Qt3D classesFriedemann Kleint2019-01-312-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | Fix warnings: (3dcore) type 'Qt3DCore::QAbstractEngine' is specified in typesystem, but not defined. This could potentially lead to compilation errors. (3dcore) type 'Qt3DCore::Quick::QQmlAspectEngine' is specified in typesystem, but not defined. This could potentially lead to compilation errors. (3drender) type 'Qt3DRender::AssimpImporter' is specified in typesystem, but not defined. This could potentially lead to compilation errors. (3drender) type 'Qt3DRender::GLTFExporter' is specified in typesystem, but not defined. This could potentially lead to compilation errors. (3drender) type 'Qt3DRender::GLTFImporter' is specified in typesystem, but not defined. This could potentially lead to compilation errors. Change-Id: Iee873d69214e8195bfbd72bb664b691dd01d6877 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * PySide2: Fix some build warningsFriedemann Kleint2019-01-313-1/+3
| | | | | | | | | | | | | | | | | | - Add enum QJSValue::ErrorType - Add enum QWebEngineDownloadItem::DownloadType - Adapt suppressed warnings in XML class Change-Id: I0d598b256cf8f83253cdb7684dc4f8c3050a76e2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-01-305-6/+123
|\| | | | | | | Change-Id: I2ff686b941af97eca2d056f691530c969a7de701
| * Add classes QWebEngineHistory, WebEngineHistoryItemFriedemann Kleint2019-01-302-5/+3
| | | | | | | | | | | | | | Fixes: PYSIDE-906 Change-Id: I612a8881d530bb098d9e2991fd47a15bc454b2d6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Add QtRemoteObjects classesFriedemann Kleint2019-01-302-0/+118
| | | | | | | | | | | | | | | | | | | | | | 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>
| * QtCore snippets: Fix warning about printf() format in generated codeFriedemann Kleint2019-01-301-1/+2
| | | | | | | | | | | | | | | | | | | | Add a cast to int for value_length and slicelength, fixing: qbytearray_wrapper.cpp:5288:158: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘Py_ssize_t {aka long int}’ [-Wformat=] PyErr_Format(PyExc_ValueError, "attempt to assign %s of size %d to extended slice of size %d",Py_TYPE(_value)->tp_name, value_length, slicelength); Change-Id: I4bd2e5d43a26c73c21a6121b469f5ec1c76994b2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-01-232-1/+18
|\| | | | | | | Change-Id: I61b563bce41b43dda2b03ea46a456228435bc294
| * Run generate_pyi After Generation of All BinariesChristian Tismer2019-01-221-1/+15
|/ | | | | | | | | | | | | | | | | | | | In COIN, there is a racing condition under Windows: Python opens as many modules as it can, while the build process is not yet done. This can lead to the situation that a module is loaded by Python before the Windows Manifest Tool has been run, and that creates a crash. We therefore wait when COIN is run, until all binaries have been created. That means that we are the last process, and the tool must have been already run. In non-COIN builds it is more convenient when in case of errors the generator crashes early. Task-number: PYSIDE-735 Change-Id: I060dbd54432778f14f74830596f28b4db83a0692 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix a crash when overriding ↵Friedemann Kleint2019-01-141-2/+4
| | | | | | | | | | | | | | QAbstractNativeEventFilter.QAbstractNativeEventFilter() long * result is nullptr for the custom message WM_USER + 1 internally used by Qt (cf QEventDispatcherWin32::processEvents()). Add a check for that. Amends 899b3cfed8e1c3513f8d3001c53b0bb0cc1af548. Task-number: PYSIDE-790 Change-Id: I4c55cfb17aa95d79f728f43a9030d1f1cbb1d024 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix snippet typoCristian Maureira-Fredes2019-01-111-1/+1
| | | | | Change-Id: Ic38aa8ba9a2470c97eb5cbd83b7d227322207db9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Produce TypeError Messages Using the Signature ModuleChristian Tismer2019-01-101-0/+1
| | | | | | | | | | | | | | | 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>
* [reg] Remove createIndex method that uses PyObject*Cristian Maureira-Fredes2019-01-082-0/+43
| | | | | | | | | | | | | | | | | | | | | | 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>
* libpyside: Use helper function for accessing the meta object in quick type ↵Friedemann Kleint2019-01-081-4/+3
| | | | | | | | | | | registration Fix an oversight of bbd32e9e52bda460dd1cb75d128dd1165d1fd152. Task-number: PYSIDE-784 Change-Id: Ic48fbed24bc86a848accda46602fd3f5cb27d411 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix a rare type hint racing conditionChristian Tismer2019-01-061-0/+2
| | | | | | | | | | | | | | | | | | | | When building type hints during the PySide build, it can happen that the QtMultimedia module already exists, but the QtMultimediaWidgets module is not yet built. Since during the build also directories exist alongside with the not yet existing modules, it can happen that such a directory is picked up by Python 3, which supports namespace modules without __init__.py . This case was already handled by the mapping modules, but QtMultimediaWidgets was directly imported and not checked. Now the check code has been extracted from the mapping reloader, and there is no more unchecked module left. Task-number: PYSIDE-735 Change-Id: I1a1f53525417651005d0759e417082fe71b02773 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Pyside2: Add free functions from namespace QtQmlFriedemann Kleint2019-01-042-0/+4
| | | | | | Change-Id: Ib4a9e8be733a3c8012e19c509ed98f87aad7cb6d Fixes: PYSIDE-892 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Complete The Signature IntrospectionChristian Tismer2018-12-221-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* PySide2: Add QWebEngineUrlScheme for 5.12Friedemann Kleint2018-12-212-0/+10
| | | | | | Change-Id: I72ae6d0af284dc85e9f36faafd9b9d3bf27c7962 Fixes: PYSIDE-878 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Refine .pyi MessagesChristian Tismer2018-12-171-5/+15
| | | | | | | | | | The generation of .pyi files talks too much when "--reuse-build" is used and actually no files are created at all. This patch guarantees that only one message comes out. Change-Id: I41f1aada0da27f0fab880ad51838f8615d61b08c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* generate_pyi.py: Add --quiet optionFriedemann Kleint2018-12-111-0/+3
| | | | | | Task-number: PYSIDE-735 Change-Id: I864270454bf4f7eee1a28b55ed06ffbf1c60d74d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix typo on templateCristian Maureira-Fredes2018-12-111-3/+1
| | | | | | | Old template typo that was transformed into a snippet. Change-Id: I58dfcde3d7f0bf7b769d76b51fea659d98aac5ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix locking in generate_pyi.pyChristian Tismer2018-12-101-73/+47
| | | | | | | | | | | | | | | | The file locking was written for Windows in mind. But file operations are quite different on Linux. This was no problem during normal builds, but showed up das a possible racing condition when using the "--reuse-build" flag. This version uses a directory to create a lock and has no platform specific code. Task-number: PYSIDE-735 Change-Id: I9f27839b0697b49b4dbfea26d6f6949ec466c9d5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Friedemann Kleint2018-12-071-6/+0
|\ | | | | | | Change-Id: Iea80162c5b4a1a9692680d5e85760d2ecfdb4e17
| * Revert QAbstractVideoSurface patch5.11.3Cristian Maureira-Fredes2018-12-071-11/+0
| | | | | | | | | | | | | | | | | | | | | | This will re-open PYSIDE-794, but it was a wrong solution that was breaking the other setVideoOutput signatures, causing a sefault on the `player` example. Change-Id: I31d7449ff11e4e44e8494b98d7e9ec58a636c8e4 Fixes: PYSIDE-864 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Make it hard to use the create_pyside_module function incorrectlyAlexandru Croitor2018-12-0745-347/+293
| | | | | | | | | | | | | | | | | | | | | | | | Rewrite the function to use keyword arguments instead of ordered arguments. Also add error detection when required arguments are not passed, or have a typo in them. Adjust all the module cmake files to use keyword arguments. Change-Id: I7bb0c6561d7dca1e7f673e29eb457da50ae5df04 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Avoid DeprecationWarning in Python 3Cristian Maureira-Fredes2018-12-051-1/+1
| | | | | | | | | | | | | | | | | | The re.match(...) string raised a DeprecationWarning due to the escaped '\(' inside the pattern in Python 3. Using a raw-string instead solved this issue. Change-Id: Ib7f6c66bfdaa03f154ce086abf7ca9bd0baaeb47 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Cast PyLongs to WIdCristian Maureira-Fredes2018-12-042-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | QScreen.grabWindow and QWindow.fromWinId have an WId as an argument. WId is treated as a PyLong internally, but with methods that need a WId we need to manually transform them to long. Change-Id: I97651704f37ae268455990a13884b92e8f1b643c Fixes: PYSIDE-863 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Generate Hinting Stubs AutomaticallyChristian Tismer2018-12-032-56/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Move code to snippets and templatesCristian Maureira-Fredes2018-11-308-105/+143
| | | | | | | | | | | | | | | | | | | | | | There was still leftover code on the typesystems but not all could be translated to snippets, so it was replace by templates. Task-number: PYSIDE-834 Change-Id: I7dbe2f15171ce6a60137be970312dc80622219c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Move old glue code to snippets filesCristian Maureira-Fredes2018-11-3025-1315/+821
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the old glue code was directly injected into the typesystem, so it was possible to add them as snippets. There are still a couple of header files that will remain there, because the include tag does not have the file/snippet tags. A few lines of code were modified in favor of "modern" C++, and good practices. Task-number: PYSIDE-834 Change-Id: I3072298b16d7280550c6a7f6abae045250663ba6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Move add-conversion and native-to-target codeCristian Maureira-Fredes2018-11-295-275/+361
| | | | | | | | | | | | | | | | | | | | | | Now we are able to include snippets for the previously mentioned typesystem's tags, so this patch removes the current C/C++ code from the typesystems. Task-number: PYSIDE-834 Change-Id: I2929020fa1dc0859db780dffb12fa292627697b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Place templates per moduleCristian Maureira-Fredes2018-11-2819-685/+868
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a main template file that hosts most of the code-templates we use in the typesystems, but there were still several templates written in each module-typesystem file. The templates that are used on different typesystem are now placed in: sources/pyside2/PySide2/templates/core_common.xml Additionally, the templates used only by a certain module, are placed next to it, e.g.: sources/pyside2/PySide2/templates/widgets_common.xml Some simple templates were moved to the snippets files too. Task-number: PYSIDE-799 Change-Id: I4f355cf2ae983aba9e85414e910550189cd18dcb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Install snippets glue codeCristian Maureira-Fredes2018-11-286-9/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | The module-specific glue files as well as the standalone glue files are now installed into the PySide2 package. The glue files are now also listed as dependencies for the shiboken generator run, which means that modifying those files will now correctly force a shiboken re-run for the relevant modules. Change-Id: I545c7ada379fafb7f225d0b0f5ce495bf6d4795d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | QApplication::setStyle ownership transferCristian Maureira-Fredes2018-11-282-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Exclude reverse operations from shift hackCristian Maureira-Fredes2018-11-272-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Add documentation related QPixmap.loadFromDataCristian Maureira-Fredes2018-11-271-0/+12
| | | | | | | | | | | | Task-number: PYSIDE-840 Change-Id: I637186335123500013a265b8a6f6554dfdceb225 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>