aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/tests/libsample
Commit message (Collapse)AuthorAgeFilesLines
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-28121-10215/+0
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-163-0/+95
|\ | | | | | | Change-Id: I27beffe4a6e2fc2f818960c3b9f5ffbfaac4a670
| * Add a test for typesystem typedefsFriedemann Kleint2020-10-153-0/+95
| | | | | | | | | | | | | | | | | | Mimicks some template which might be used trying to enforce correctness of units by type checking. Task-number: PYSIDE-725 Change-Id: Ia7008d7db5638920eee3d0ef36cc32a63796b98e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-011-0/+4
|\| | | | | | | Change-Id: Idaf124ad5e1d6a41d52918cecba47499be5e7324
| * shiboken2: Generate functions from invisible namespaces into their parent ↵Friedemann Kleint2020-09-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | namespaces Add them in ShibokenGenerator::getFunctionGroupsImpl() with some helpers. Fixes: PYSIDE-1075 Change-Id: Ie627c6e12f82e40cdb4f306ddac6b682e77124c5 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken2: Generate functions from invisible top level namespaces as global ↵Friedemann Kleint2020-09-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | functions Mainly add those in ShibokenGenerator::getGlobalFunctionGroups() with some adaptions. Task-number: PYSIDE-1075 Change-Id: I6dabac72c204904e76162542b5aa3ea1ac3b56ec Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add QStringView/QByteArrayViewFriedemann Kleint2020-09-302-0/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | View types as function parameters cannot be converted in the standard way shiboken does it: QStringView cppArg0; pythonToCpp(pyArg, &cppArg0); since they reference some other data. Introduce a new "viewOn" member to type system entry for them. It causes the function arguments to be replaced by their viewed-on types (stringview->string) via metatype. Add a test in libsample and a test for QUuid::fromString(QStringView). Test returning QStringView via QRegularExpressionMatch::capturedView(). Task-number: QTBUG-84319 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Task-number: PYSIDE-487 Change-Id: Iddb4ea268a54928d290e29012e2738772fae83f0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken2: Correctly generate final classes with protected methods without ↵Friedemann Kleint2020-09-291-0/+4
| | | | | | | | | | | | protected hack Add a missing check for final class. Amends 170756fa1e5de0ce7ba33521f1eb168d70ad276d. Fixes: PYSIDE-1388 Change-Id: I6b7cd5c9a769838287ac7165bdc2d5ad63b289a1 Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Consolidate tests for invisible namespacesFriedemann Kleint2020-09-292-20/+9
| | | | | | | | | | | | Move the tests for PYSIDE-1074 from samplenamespace.h to removednamespaces.h. The latter has also a test case for an invisible namespace under a visible namespace besides the invisible top level namespace test. Task-number: PYSIDE-1074 Task-number: PYSIDE-1075 Change-Id: I5d1c6428f6ceadf929063c2c69723a7871173f4e Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Fix the tests for enums in removed namespacesFriedemann Kleint2020-09-281-21/+15
| | | | | | | | | Change the formatting for better readability and use the "visible" attribute instead of the deprecated "generate". Task-number: PYSIDE-1075 Change-Id: Ibbb33d2482c1d682f74d2edce2dd7d3bb1a50821 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Generate properties as fieldsFriedemann Kleint2020-09-282-0/+15
| | | | | | | | | | | | | | | | - Add an XML attribute specifying whether code is to be generated to the XML properties. - Split the generator functions for field setters and getters apart so that they can be used for generating property setters and getters. - Generate code for all properties from XML when the PySide extension is not used, otherwise only for those with the attribute set. Task-number: PYSIDE-1019 Change-Id: Iab2ba38b90038edc667a233c23c7113fdc6fb438 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken2: Add namespace variablesFriedemann Kleint2020-09-212-0/+4
| | | | | | | | | | They were ignored in the code parser. Take them into account and add a test. Task-number: PYSIDE-1224 Change-Id: I3baca95556129d695db294fdcc1ad92fc831672d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken2: Allow specifying the sequence of overloadsFriedemann Kleint2020-09-212-0/+16
| | | | | | | | | | | Add an attribute to specify a number by which the functions will be sorted. This deactivates the default sorting which tries to avoid implicit conversions. Fixes: PYSIDE-1366 Change-Id: I9a891e21f86152b2fdfda9a48d685f19aa936508 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Enable adding operators ==, != as functions without code injectionFriedemann Kleint2020-07-223-1/+75
| | | | | | | | | | | | | As of Qt 6, there is a trend of hiding bool returns of comparison operators of container classes behind some template expression which the clang parser cannot identify. To work arouind such cases, make it possible to add them as functions without code injection which will generate the default code. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia7bf5d583e0f80505fe1b759347955fec5dca600 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken2: Handle virtual methods returning a referenceFriedemann Kleint2020-07-142-0/+8
| | | | | | | | | | | | | | | | | | | Although it is a questionable practice, it occurs in Qt 6: virtual const QEventPoint &QPointerEvent::point(int i) const; Previously, the generated return statement return QEventPoint(); would cause a warning about returning a temporary. Fix by creating a static variable and returning a reference to it. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Id6467be22a166e99e8dcf08b2c7c14df33cd2786 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Handle default parameters of const pointersFriedemann Kleint2020-07-144-4/+19
| | | | | | | | | | | | Occurs in Qt 6: QKeyEvent(..., const QInputDevice *device = QInputDevice::primaryKeyboard()); We need a const-cast here since shiboken needs a QInputDevice * for type conversion. Change-Id: Iea1137eac44a26b7bc9cf0e1908c0e42ba2de39f Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-06-112-0/+9
|\ | | | | | | Change-Id: I6cf604e1ae7234ce4f0d99169e9269a7dde07a4a
| * shiboken: Fix default-initialized function argumentsFriedemann Kleint2020-06-112-0/+9
| | | | | | | | | | | | | | | | Specifying {} causes it to be qualified, check this. Change-Id: Idd23c8a5af01cd7fbb63a2e5a01bb349c530fe54 Fixes: PYSIDE-1325 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Enable injecting raw code for setattro/getattroFriedemann Kleint2020-05-042-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Setattro/getattro functions can be added. As shiboken also uses these functions internally, the code blocks are inserted into those implementations. As those are special functions, only raw code is injected. No macros are replaced for arguments or instances. Fixes: PYSIDE-1280 Change-Id: I207dcf70b3a9f5edc51ff6566b31a2a8aa4776ed Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Fix classes in hidden namespacesFriedemann Kleint2019-12-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an existing functionality to hide namespaces when specifying generate="no" on namespace-type which did not work for classes. In addition, it was implemented using the generation attributes of TypeEntry. This is problematic since dependent typesystems are loaded with generate="no", which actually means that no code should be generated for them. To fix this, introduce a new "visible" attribute for namespaces which also accommodates for hiding C++ 11 inline namespaces. Some projects uses the namespaces as packagename while creating python bindings, and to avoid duplicate names they ignore the original c++ namespace. For example a class like that: namespace Qt3D { class Vector; } The namespace "Qt3D" will be used as package name so the namespace "Qt3D" should be ignored during the generation, otherwise the 'Vector' type will be represented by 'Qt3D.Qt3D.Vector' and that is not what we want. Initial-patch-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com> Fixes: PYSIDE-1074 Change-Id: I3fd391ac3d839d3f8f510c6a4d4000f7d92eacff Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | libsample: Test renaming via "target-lang-name" attributeFriedemann Kleint2019-12-033-0/+97
|/ | | | | | | | | | | | | | | | | | | | | | | Rename a class and test repr and signatures of users. The test fails F ====================================================================== FAIL test (__main__.RenamingTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "renaming_test.py", line 46, in test "(self, v 'sample.RenamedValue')") AssertionError "(self, v: 'sample.ToBeRenamedValue')" != "(self, v: 'sample.RenamedValue')" - (self, v 'sample.ToBeRenamedValue') ? ---- + (self, v 'sample.RenamedValue') Task-number: PYSIDE-1133 Task-number: PYSIDE-990 Task-number: PYSIDE-1074 Change-Id: I402439fd202c33cac281c4628ceba79406198a27 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Fix handling of modified default expressionsFriedemann Kleint2019-10-042-0/+26
| | | | | | | | | | - Do not try to resolve modified default expressions (add enumeration scopes or similar) - Fix the signature parser to handle arbitrary expressions Fixes: PYSIDE-1095 Change-Id: I059c3a1f066687d7c2f0dad9ea7f0d93e292b1b5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Replace 'typedef' by 'using'Friedemann Kleint2019-06-258-12/+12
| | | | | | | | Apply Fixits by Qt Creator with some amendments. Remove iterator types by using auto instead. Change-Id: I8a75323da6ae5cdcc6b67af8be9376408953986b Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Introduce nullptrFriedemann Kleint2019-06-2522-49/+49
| | | | | | | Apply Fixits by Qt Creator with some amendments. Change-Id: Ie8300ddb834adb8b649324562f2c912a4e8cf4ce Reviewed-by: Christian Tismer <tismer@stackless.com>
* Modernize and clean up some of the shiboken build system filesAlexandru Croitor2019-04-201-2/+2
| | | | | | | | | | | | | | Use target_* commands instead of subdirectory based commands for adding link options, compile definitions, include directories, etc. Remove some non-used compile definitions. Move around some of the find_package() and option() calls. Simplify some of the package dependent logic. Replace the qt include and linking variables with CMake targets. Change-Id: I815595344e63a32dce3dc78652359beede3ff593 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Handle <array> modifications in template inheritanceFriedemann Kleint2019-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | Array modifications did not work in template specializations (like typedef QGenericMatrix<2,2,int> QMatrix2x2> causing warnings like: 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)'. Rewrite the array modification code to operate on AbstractMetaType only instead of requiring code model data types and add the missing handling to AbstractMetaBuilderPrivate::inheritTemplate(). Add a test. Note that the warning was fixed by another change removing the array modification since it did not take effect due to the presence of a manually added PySequence constructor. Change-Id: Ie4a1092fbef7237f8858790a74e2f75070ef6586 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Make constructor checks more fine-grainedFriedemann Kleint2019-01-302-10/+40
| | | | | | | | | | | | | | | | ShibokenGenerator::isValueTypeWithCopyConstructorOnly() returned false for QWebEngineHistoryItem since the check for AbstractMetaAttributes::HasRejectedConstructor triggered on WebEngineHistoryItem(QWebEngineHistoryItemPrivate *priv), causing the function to bail out. To prevent this, add a new AbstractMetaAttributes::HasRejectedDefaultConstructor attribute and use that in isValueTypeWithCopyConstructorOnly(). Task-number: PYSIDE-906 Change-Id: I4fee83b89f0a4c44e7e8d69e118ed7f2b03ceee1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Check whether enum should be converted to int for the protected hackFriedemann Kleint2018-10-012-1/+12
| | | | | | | | | | | Find the AbstractMetaEnum belonging to the type entry and perform some checks. Generally do not use int for public enums. Warn when a protected scoped enum is encountered as this cannot be converted. Task-number: PYSIDE-817 Change-Id: I02b566093b331ea2ea627bf72964aad0a1a51c83 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add exception handlingFriedemann Kleint2018-09-273-0/+113
| | | | | | | | | | | | | Add XML elements specifying an exception handling mode to type system, complex type entries (classes) and function modifications. From the mode and the exception specification as detected by Clang, deduce whether to generate try/catch code. Task-number: PYSIDE-62 Change-Id: Ib76adc21cefd81bf9f82f819a3c151056c33a3b7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Improve handling of non-type template integer parametersFriedemann Kleint2018-09-131-0/+51
| | | | | | | | | | | | | | When trying to specify the base class template<int R, int C> QGenericMatrix of the QMatrixRxN classes, clashes of the SBK..IDX enumeration values occurred since the integers were not part of the type name. Fix that by dynamically adding dummy entries of EnumValueTypeEntry for the integer values encountered on the fly. Task-number: PYSIDE-725 Change-Id: Ie6b4489b5293e04b7c2c76861341c99b136cd558 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Fix warnings about unused variablesFriedemann Kleint2018-09-131-0/+1
| | | | | | | | sources/shiboken2/tests/libsample/objecttype.cpp:283:17: warning: unused variable 'fake_child' [-Wunused-variable] sources/shiboken2/ApiExtractor/doxygenparser.cpp:71:15: warning: unused variable 'numPrefixes' [-Wunused-variable] Change-Id: I409f22e1450e9ae0f3f5924cb6dd47991d12a2ad Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Add support for type aliases (using)Friedemann Kleint2018-07-261-1/+1
| | | | | | | | | | | | | | | QAbstractRayCaster is the first class in Qt to use type aliases: using Hits = QVector<QRayCasterHit>; Treat them as typedefs if a canonical type can be obtained for them. This requires adding some simplification of the canonical types obtained for standard containers. Task-number: PYSIDE-751 Change-Id: I521a8b02d3c8cb89e4f72a817fbacc5955041570 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken/libsample: Add test case for nested containersFriedemann Kleint2018-07-232-0/+7
| | | | | | Task-number: PYSIDE-752 Change-Id: I88d8bf7598b9dc74adec9a4aaee8bd90db8ae6e9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix wrongly generated code for enums passed by const-refFriedemann Kleint2018-05-161-0/+4
| | | | | | | | | | | | | | First encountered in: QtScxmlEvent::setEventType(const EventType &); The metatype was wrongly detected as NativePointerPattern in AbstractMetaType::determineUsagePattern(). Introduce a helper for detecting plain const-ref and use that consistently. Change-Id: I6b105bc99ae63e4737c5d628e79f23b7acbcca3d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change license from all the filesCristian Maureira-Fredes2018-05-03112-112/+112
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename PySide references to Qt for PythonCristian Maureira-Fredes2018-04-27112-112/+112
| | | | | | | | | When referring to the project one should use "Qt for Python" and for the module "PySide2" Change-Id: I36497df245c9f6dd60d6e160e2fc805e48cefcae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Type system: Add attribute indicating C++ 11 enum classesFriedemann Kleint2018-02-281-0/+6
| | | | | | | | | | | | | Introduce enumeration for the type to EnumTypeEntry which can be specified by the boolean "class" attribute. For the enum classes, the value names need to be qualified by the enum name to match the C++ API. For the C++ generator, add an overload to Shiboken::createScopedEnumItem() that takes a PyTypeObject and add the enum items to the enum so that the name is in the enum scope. Change-Id: Ia0e469d13b08c196b9ddd965b9cf3cc62a38630b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Fix generated initialization code for enum classesFriedemann Kleint2018-02-261-0/+4
| | | | | | | | | | Wrap value in int(), which is required for enum classes. Add a compile test to libsample. Task-number: PYSIDE-487 Change-Id: I78f07ae66da64caad1f75722308256e40e91eded Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-02-201-1/+0
|\ | | | | | | Change-Id: If56adeea2f888d8bc34e202b697f735508896c84
| * Fix heap corruption crash on macOS 10.8 CI machineAlexandru Croitor2018-02-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macOS 10.8, PySide2 branch 5.6 integrations were misteriously failing with crashes on exit in the objecttype_test.py test, with a stack trace similar to: 0x00007fff8899e90a _sigtramp + 26 0x0000000100784710 0x0 + 4302849808 (note the 0x0 address) 0x0000000100055408 dict_traverse + 168 0x0000000100107f77 collect + 407 0x00000001001089f4 PyGC_Collect + 52 0x00000001000ef503 Py_Finalize + 259 0x00000001000eefca handle_system_exit + 250 0x00000001000ef235 PyErr_PrintEx + 469 0x00000001000efebb PyRun_SimpleFileExFlags + 299 0x00000001001071dd Py_Main + 3101 Reproducing it on a CI VM was very difficult, requring dubious manipulation of PATH, PYTHONPATH and LD_LIBRARY_PATH environment variables. In the end the issue was diagnosed to be heap corruption, and thus the difficulty in reproducing it. The testParentFromCpp test in objecttype_test.py calls the destroyCppParent method to delete its parent. Because the deletion of the parent invokes the destructor ~ObjectType(), that in turn deletes the child. This lead to head corruption, because the child "o" by destroying its parent, destroys itself, and once the "delete m_parent" is done, the next "m_parent = 0" would write to invalid (freed) memory. In a release build of the Python interpreter, this ends up in accessing the freed memory in the GC collection phase (but under a debugger this crashed in several other random places). The fix is to delete the "m_parent = 0;" statement, so that nothing is written to freed memory. Change-Id: I2d7a41b99a3255ebb300e6157b3dd0d78eb27a54 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Shiboken: Handle private abstract methodsFriedemann Kleint2018-01-193-0/+10
| | | | | | | | | | | | | | | | | | Remove the exclusion. Required for Qt3dExtras::QAbstractCameraController::moveCamera() in 5.10. Task-number: PYSIDE-487 Change-Id: I67ae24d4cda2d90ac30c97f77457c2eaf65099ab Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken tests: Introduce overrideFriedemann Kleint2018-01-195-18/+18
| | | | | | | | | | | | | | | | Replace virtual by override where appropriate to make the code clearer. Change-Id: I143daf29f1c162b2de959411a5f4acdc43a2b253 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken: Do not generate wrappers for final classesFriedemann Kleint2017-12-042-0/+37
| | | | | | | | | | | | | | Check the attributes and add test. Change-Id: I6c3d76ed32b5d20b6940849dd4895f98abd62fca Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-272-2/+13
|\| | | | | | | Change-Id: I79637555fbfbd596dee4313baf80149d03bb5206
| * shiboken: Do not generate richcompare methods for namespacesFriedemann Kleint2017-11-242-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shiboken used to generate richcompare methods for namespaces when it contained free comparison operators for classes in that namespace, resulting in compile errors. For example: namespace Qt3DRender { bool operator!=(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample) ... Add a check preventing that. Task-number: PYSIDE-487 Change-Id: If2fa1de1bfb0fdc11c9415421dab0c7e13abc500 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-061-0/+4
|\| | | | | | | Change-Id: I72583df407fc5b3caa8bf35fd997889a4ac86512
| * Implement proper void pointer (void*) supportAlexandru Croitor2017-11-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new type into the shiboken2 module which is imported by calling "import PySide2.support.VoidPtr". The type takes care of conversions from / to void* values in function signatures. Creating an instance can be done by passing either a shiboken wrapped object, or an integer representing an address, or a python object that implements the buffer interface. For example, this is useful for passing numpy arrays to C OpenGL functions that take void* parameters. First you convert the array into a bytestring (using numpy.array.tobytes(), then you instantiate a VoidPtr from that bytestring, and finally you pass it along to a GL function. One corner case that is currently not supported is void** parameters. Change-Id: I01e291d6856cb6bd8b5175adc3ead6b728036535 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * move everying into sources/shiboken2Oswald Buddenhagen2017-05-22113-0/+9478
| | | | | | in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.
* Add numpy supportFriedemann Kleint2017-08-032-0/+22
| | | | | | | | | Add simple array converters giving access to NumPy arrays. Task-number: PYSIDE-354 Task-number: PYSIDE-516 Change-Id: I2446b0f1ef98eaf12df95e4bd0e03d73e0cd7126 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add new <array> argument modification indicating array usageFriedemann Kleint2017-08-032-0/+16
| | | | | | | | | | | | The modification can be used to indicate that for example int* is meant to be used as int[]. This is reflected in the NativePointerAsArrayPattern usage pattern of AbstractMetaType. Task-number: PYSIDE-354 Task-number: PYSIDE-516 Change-Id: Icaeb3cce4be9ce06caa2cab628d4e8fc1b684819 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>