aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/glue
Commit message (Collapse)AuthorAgeFilesLines
* Rename PySide2 to PySide6Friedemann Kleint2020-11-0217-4208/+0
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* remove traces of Python2 from C codeChristian Tismer2020-10-271-34/+0
| | | | | | | | | | | | It will be assumed that Python is always Python 3. All checks for Python 2 are removed. This is the second part of cleaning up the C code from references to Python 2. Task-number: PYSIDE-904 Change-Id: I3006412c2a5bb65402101b0aac5a5f2fc79ce2f8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Remove deprecated QVariant::TypeFriedemann Kleint2020-10-271-34/+0
| | | | | | | | | Usage of the enum causes deprecation warnings. In addition, it is not clear why the type was there given that QVariant is not exposed. Remove the converters. Change-Id: I5b1f12ee0f869a63e6b7d82afdcb58a5d7062ce6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide snippets: Fix deprecation warnings about constructing a QVariant from ↵Friedemann Kleint2020-10-271-34/+28
| | | | | | | | | a type id Rewrite the helper QVariant_resolveMetaType() to return a QMetaType. Change-Id: Ifa3994ea0c23149bd925e4a422f19e98e742d97f Reviewed-by: Christian Tismer <tismer@stackless.com>
* QtQml: Implement QmlElementMaximilian Goldstein2020-10-221-0/+4
| | | | | | | | Equivalent to QML_ELEMENT in C++, this enables users to register classes for use in QML by using the QmlElement decorator. Change-Id: I697e486ef58b18cce4c310e4b556e28735a16d45 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Adapt to recent changes in qtbaseFriedemann Kleint2020-10-021-11/+0
| | | | | | | | | | | | | | | | - Remove QProcess::pid(), adapt test (qtbase/0f8848b7e25e4d8fb9265ff6e0aa31946addd741) - Remove enum from QPrinter - Add enum GrabTransition to QPointingDevice - Remove deprecated functions from QByteArray, QXmlStreamAttributes - Adapt Qml tests - Remove fake property from QLayout Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I98cc90723cbeda15b23c5b22d026cb2ab9a358ff Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QStringView/QByteArrayViewFriedemann Kleint2020-09-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-171-0/+6
|\ | | | | | | Change-Id: I8aa48d07067c45c888c73af87314f6a88c2a6e14
| * Fix slots being invoked from the wrong threadFriedemann Kleint2020-09-161-0/+6
| | | | | | | | | | | | | | | | | | | | In case the signal connections are routed via some GlobalReceiverV2 instance, it needs to be moved to the receiver's thread. Fixes: PYSIDE-1354 Change-Id: I85926efeab157e47ec42a830fda024d299807786 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Adapt to new changes in qtbaseFriedemann Kleint2020-09-141-8/+8
| | | | | | | | | | | | | | | | | | | | | | - Remove more math functions - Renamed enum in QLibraryInfo - Use float instead of qreal in QColor Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ic3120d1776f01943e38395a1a30d62bf6f5ccc36 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Further cleanups of Python2 in C++ codeFriedemann Kleint2020-09-031-8/+0
| | | | | | | | | | | | | | Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I8b192651abe1344c1240b9867c82e558d952769f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Remove Python2 from C++ codeFriedemann Kleint2020-09-032-85/+13
| | | | | | | | | | | | | | Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I7e4ffaeabb2ac8a5ffe165d43b3475a7e5d57447 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Adapt to recent Qt 6 changesFriedemann Kleint2020-09-011-6/+9
| | | | | | | | | | | | | | | | | | | | - Removal of the statemachine framework from QtCore - Addition of QAbstractFileIconProvider - Adapt some signatures - QMetaType deprecations Change-Id: Ia51354542ad1d2f0bb5530e45ebef0d6ccdb633d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Remove QStringRefFriedemann Kleint2020-08-201-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port the remaining XML parser code in shiboken to QStringView. Remove the QStringRef type. The QStringView-related refactoring of QXmlStreamAttributes somehow exposed the value() methods of its base class (QList), which cause compilation errors. Remove them. Task-number: QTBUG-84319 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: If01516f962eddcc0591ccaff322843f2fc040549 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Fix build of qtbase modulesFriedemann Kleint2020-08-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Adapt to qtbase/2f9a294252ae44defd4d8ae1b3c09d8e36ee0612: - Removal of deprecated QSettings API - Changed signature of QLineF - Change of QVariant constructors - Introduction of new QIODeviceBase class Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I834f535af3c977164def12fc86dfd87282c240aa Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-08-171-0/+4
|\| | | | | | | Change-Id: Icee2cd5a37181070d8ef50e7143868d4f126cea5
| * feature-select: optimize feature access to the feasible maximumChristian Tismer2020-07-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ** fix: MSVC needs extra sign bit in basewrapper_p.h! Buglet? ** The new feature selection has some tiny overhead. It is about two dict accesses plus a slot access for every tp_(get|set)attro call. The introduction of an explicit `__init_feature__` call allows to optimize this overhead very nicely, because this init is done for each __feature__ import: First, we can remove that tiny overhead completely by not initializing the feature_select module at all if no __feature__ import is used. Second, we can optimize this access further by caching the current module dict. If the dict is unchanged, then the last select_id can be used. This reduces the overhead of frequent calls to a single slot access. Third, we finally cache the select id in unused SbkObjectType bits. That removes the last structure where repeated attribute lookup is used. The overhead is therefore quite small when something is changed. But typically these changes are infrequent. The majority of accesses do change nothing, and this case is now quite much optimized. Change-Id: I7d1a4611a1c19216fd9be8f04457bb18ebd52ab1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | PySide2: Add qmlRegisterUncreatableType()Friedemann Kleint2020-07-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | Extend the Quick register helper function by the bool creatable and string noCreationReason parameters, extract a QML helper taking the same parameters and add the overload. Task-number: PYSIDE-574 Change-Id: I955dbd158c7b22d2637bbac464937f9fda6d7901 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Implement qmlRegisterSingletonTypeMaximilian Goldstein2020-07-231-0/+15
| | | | | | | | | | | | Task-number: PYSIDE-574 Change-Id: I8828e22da42a5a47b207bb2e02d2f4fe67746a0b Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Initial port of Core,Gui,Widgets,Network,Qml,Quick to Qt 6Friedemann Kleint2020-07-032-10/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | Test failures: shiboken2:testmodifyfunction pyside2:QtCore::qbytearray_test pyside2:QtGui::bug_PYSIDE-41 pyside2:QtGui::deepcopy_test pyside2:QtGui::qfontmetrics_test pyside2:QtGui::qpixmapcache_test pyside2:QtWidgets::api2_test (QTBUG-85417) pyside2:QtWidgets::bug_632 pyside2:QtWidgets::bug_714 pyside2:QtWidgets::bug_785 pyside2:QtWidgets::qshortcut_test pyside2:QtQml::bug_825 pyside2:QtQml::bug_1029 pyside2:QtQml::registertype pyside2:QtQml::qqmlincubator_incubateWhile pyside2:QtQml::signal_arguments Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia43d7ed037dfdd07def0edd76bada2243e73d335 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Indicate limited API builds in QLibraryInfo::build()Friedemann Kleint2020-06-291-0/+10
| | | | | Change-Id: I55fe70da8adf6faba0f8099d4d127ae3963fa2c6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add QObject.findChildren(QRegularExpression)Friedemann Kleint2020-06-261-7/+7
| | | | | | | | | Replacing the deprecated QRegExp version in Qt 6. Merge identical code snippets. Task-number: PYSIDE-904 Change-Id: Id6f5c39379c65cf71fb6352531173d0fd7f2ae5e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Change the return type of the hash functions to Py_ssize_tFriedemann Kleint2020-06-261-4/+4
| | | | | | | | | This is the proper type and makes it clear that it it is not related to Qt's hash type (uint in Qt 5, size_t in Qt 6). Task-number: PYSIDE-904 Change-Id: I4ce0f5c845c06e5dcd0ad9744a16a995017987ef Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-06-261-0/+28
|\ | | | | | | Change-Id: I75984f35bcdeeeb3b6004a00670f1582ab522c1b
| * pthreads: Try to abandon the GIL in case a thread was terminatedFriedemann Kleint2020-06-261-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | When terminating a thread using QThread::terminate() via (pthread_cancel(), QThread::run() is aborted and the lock is released, but ~GilState() is still executed for some reason. Add a cancel handler to the thread which tells GilState to abandon the lock. Fixes: PYSIDE-1282 Change-Id: I70abd42b5a2afd49aaa8cc5e8be0a92ed63f49d3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-06-191-4/+7
|\| | | | | | | Change-Id: If40b0ab35cd2ad2bd0d982881094ce3dbf46ccf3
| * Use pyside2-uic instead of uic for the loadUiTypeCristian Maureira-Fredes2020-06-161-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we deploy the pyside2-uic wrapper inside the bin/ directory of virtual environments, that takes care of using the 'uic' binary we ship with the wheels, which is located in site-packages/PySide2/. The current implementation of loadUiType, runs 'uic -g python' but for people without a Qt installation, it has no effect since 'uic' is neither in PATH, nor in the system. Using 'pyside2-uic' instead will solve this issue. Task-number: PYSIDE-1223 Change-Id: I2c801a16c9ff4faa5cf8711bd718a634f017e592 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Implement the QEnum/QFlag decorator, V2Christian Tismer2020-06-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation allows module-level and scoped QEnums which are Python enum types. Scoped types are registered in Qt's meta object system. Usage of QEnum/QFlag with decorator or function call: from enum import Enum, Flag, auto from PySide2.QtCore import QEnum, QFlag, QObject class Compass(QObject): @QEnum class Orientation(Enum): North, East, South, West = range(4) class Color(Flag): RED = auto() BLUE = auto() GREEN = auto() WHITE = RED | BLUE | GREEN QFlag(Color) Fixes: PYSIDE-957 Change-Id: Ie15f45cbd932c816b50724a96eee0c14ae1fdee8 Task-number: PYSIDE-487 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Add QSocketDescriptor classCristian Maureira-Fredes2020-06-051-0/+8
| | | | | | | | | | | | | | | | | | | | This was required by the change in QSocketNotifier in 5.15. Additionally, an alias, DescriptorType, was required to make the constructor to work. Fixes: PYSIDE-1317 Change-Id: Ib75e6024e467eb72f374a1179cb7416b1ea8a853 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-05-262-0/+154
|\| | | | | | | Change-Id: I9c7163094bc934f481002adcea78ef4928ed26be
| * Add QtUiTools.loadUiTypeCristian Maureira-Fredes2020-05-251-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | This function will allow users to convert and load .ui files at runtime. A test case was added. Change-Id: I64a220a07955e560f61f823d0ee2c3c9ff2209c1 Fixes: PYSIDE-1223 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * PySide2: Fix conversion of quintptrFriedemann Kleint2020-05-181-0/+16
| | | | | | | | | | | | | | | | Ensure it is 64bit for 64bit systems. Change-Id: I0b4d54f2568bd70288e184a5a2d8f31532fed157 Fixes: PYSIDE-1303 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | PySide2: Prepare for Qt 6Friedemann Kleint2020-05-191-4/+12
|/ | | | | | | | | | | | | | | - Change QBasicTimer to be an object type since its copy constructor and assignment were deleted in Qt 6. It probably was never intended to be a value type. - Remove the hash function of QItemSelectionRange which according to code comment is a dummy to get QItemSelectionRange::toSet() compiled with MSVC. There is no need for it to have it in Python - Adapt the underlying string types for QString conversion Task-number: PYSIDE-904 Change-Id: Idb60b95b6bc0ce3d1272862995f3247d2f191454 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Windows: Fix encoding in custom message handlerFriedemann Kleint2020-05-061-1/+1
| | | | | | | | | | The code snippet passing the message to the Python handler used QString::toLocal8Bit() to convert the message. This is wrong as Python always requires UTF-8. Fixes: PYSIDE-1293 Change-Id: I1f16dad970aaf0d776e748110fc2054269412047 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Update sbkstring to use PyUnicode_GetLengthChristian Tismer2020-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | The unicode implementation has changed very much. PyUnicode_GET_SIZE has been used all the time, although this macro is already a quite expensive real function since Python 3.3 . The function is deprecated, and the macro PyUnicode_GET_LENGTH should be used, instead. This is relevant for cleaning things up, because in the course of fixing PYSIDE-813 we work with debug Python, which then complains that Python memory is used without holding the GIL. The usage of the right implementation was ensured by a function PepUnicode_GetLength and removing all traces of the former version. Task-number: PYSIDE-813 Change-Id: I62e94e10e14975dac3dad0ed1fffec8a1b54a0d5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Invert QTreeWidgetItem clear function loopCristian Maureira-Fredes2020-03-251-1/+9
| | | | | | | | | | | When using clear on an item with children, we rely on the childCount() function so when children with only a parent and no local reference were inside, they ended up being removed, altering the behavior of the loop. Change-Id: I111a600cd2e805eeb7110082437e666f88ff65a5 Fixes: PYSIDE-1251 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide2: Use int for QVariant conversion when possibleFriedemann Kleint2020-03-251-1/+5
| | | | | | | | | | | Check using the init limits in the QVariant long long conversion and create an int if possible. This works more smoothly with Qt and for example ensures that the correct editor is created in item views. Change-Id: I0ca2e5e7b91f309deaa81a25e70a5f894f43f841 Fixes: PYSIDE-1250 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add functions with callback of QWebEnginePageFriedemann Kleint2020-03-241-0/+157
| | | | | | | | | Provide them as user-added functions using C++ lambdas. Fixes: PYSIDE-946 Task-number: PYSIDE-1241 Change-Id: I9733bc98b3fc8b3bcf40ab4ce91ffdb84e385b93 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Adjust the allow-thread behaviorCristián Maureira-Fredes2020-03-133-24/+25
| | | | | | | | | | | | | | | | | This adds and remove the usage of: allow-thread="yes" in some typesystem entries. This also adapt the usage of the Py_BEGIN/END_ALLOW_THREAD macro inside the snippets used by other typesystem entries. The main reason is that in some cases not the whole snippet requires to be inside such state, but only when calling the C++ equivalent function. Task-number: PYSIDE-803 Change-Id: Ifa9c8cee2713c453e4d5c624aaa862e75559180c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Turn qApp into a normal Python variable, finallyChristian Tismer2020-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a long odyssey of more or less unpythonic compromizes, the qApp "macro" would finally be moved into a normal variable without surprizes. This was only possible since we removed qApp from QtWidgets and other modules. Otherwise, from PySide2.QtWidgets import * would pull qApp, being the constant "None", into main and shadow the true qApp variable in the builtins. By inserting qApp into the builtins, only, we make sure that this variable is always freshly looked up, without making it change its contents. DONE... + change the singleton code to normal + rename to MakeQAppWrapper + simplify the implementation + fix new bug concerning duplicate applications + check very much for refcounting bugs + review the rest of the implementation and further simplify Note... The Q*Application variable will not be turned back into a GC variable. This is not worth the effort. Fixes: PYSIDE-571 Change-Id: Idbd158c083318e6b0dfe48d62485c68c90e944de Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix PyBuffer interface for QByteArrayCristián Maureira-Fredes2020-02-051-1/+9
| | | | | | | | | | | | | For the limited API, properly implement the PyBUF_ND flag (shape requested). Otherwise, use the convenience function PyBuffer_FillInfo() to properly populate the view. Fixes: PYSIDE-1204 Change-Id: I2a4c81885cf49b25c89823577c0d7ee2f2707b87 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix refcount issues with QSettings glue codeCristián Maureira-Fredes2019-11-281-4/+11
| | | | | | Task-number: PYSIDE-939 Change-Id: I5bda4e2025e31bf192bf0bf70c82aa626cd19714 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.13' into 5.14Friedemann Kleint2019-10-312-13/+37
|\ | | | | | | Change-Id: I9f31a647fd9d4ad9c854a307f8b5df1be935354a
| * Fix booleans and empty list cases in QSettingsCristián Maureira-Fredes2019-10-281-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the fix for PYSIDE-1010 there were two things that were not properly understood: 1. A special case for booleans was required, 2. When a list was detected, the split was wrongly creating a list with a '0' instead of an empty one. Additonally, due to the wrong treatment we couldn't notice if the value 0 was None, the number zero, or even false, so this patch amends the previous implementation to properly treat these cases. New test cases were added. Change-Id: I41d5387bb835cfa96f94e5577e993a4b87b303f0 Fixes: PYSIDE-1130 Fixes: PYSIDE-820 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Add inject-code for QVideoFrame::bits()VaL Doroshchuk2019-10-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Since QVideoFrame::bits() returns uchar* which is not covered by conversion functions, added the same replacement as was done for QImage::bits(). It should return a buffer object to satisfy Shiboken::Buffer::checkType(). Fixes: PYSIDE-849 Change-Id: I33bdb13f3b892f325ccf3b1ef4bef59744b60f2d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Improve the NumPy Support by iterablesChristian Tismer2019-10-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Working example, by overriding cppgenerator: >>> from PySide2 import * >>> QtCore.QUrl.fromStringList(("asd", "def")) [PySide2.QtCore.QUrl('asd'), PySide2.QtCore.QUrl('def')] >>> def func(lis): ... for thing in lis: ... yield thing ... >>> QtCore.QUrl.fromStringList(func(["asd", "def"])) [PySide2.QtCore.QUrl('asd'), PySide2.QtCore.QUrl('def')] Also working, by overriding shibokengenerator >>> QtGui.QMatrix4x4(func(range(16))) And all other QMatrix sizes as well: >>> QtGui.QMatrix2x2(func(range(4))) >>> QtGui.QMatrix2x3(func(range(6))) The PySequence cases seem to be quite completely covered. Supporting lists and QVector is not yet clear and needs more research. Note.. QtOpenGLFunctions is not tested at all and nothing works on macOS, segfault. Ignored for now! A simple numpy test shows how versatile this solution is. We now need to improve signatures and error messages to optimize the experience. Task-number: PYSIDE-795 Change-Id: I195cd46cf47c2eb83276fe48fce8e6070cf30fda Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Speed: Avoid some repeated string constant initializationFriedemann Kleint2019-09-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a basic concept to avoid the repetition of string constant creation in Python by using helper functions returning static instances. There is currently no real shiboken finalization, so we postpone finalization until shiboken has one: - call the finalize_strings() function - build finalization for other stuff (all signatures etc) Initial-patch-by: Christian Tismer <tismer@stackless.com> Task-number: PYSIDE-1087 Change-Id: If3483ba91f719ee0472eb53583460ba35163bc9d Reviewed-by: Christian Tismer <tismer@stackless.com>
* | PySide: Clean up indentation, fix refcounts and improve generated codeChristian Tismer2019-09-181-2/+3
|/ | | | | Change-Id: I5795526cd9d18dda329c9d6694e2fc1269c9d771 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Allow for "auto" as target of type for CONVERTTOCPP in injected codeFriedemann Kleint2019-07-291-3/+2
| | | | | | Task-number: PYSIDE-1037 Change-Id: Idfc70fe571e4058d0c82db1bd0afea54436fe27c Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add optional support for types in QSettings::valueCristián Maureira-Fredes2019-07-171-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This add an optional named parameter to the function value() to automatically cast the type that is being returned by the function. An example of this situation could be an ini file that contains the value of a one-element list: settings.setValue('var', ['a']) The the ini file will be: [General] var=a # we cannot know that this is a list! Once we read it, we could specify if we want the default behavior, a str, or to cast the output to a list. settings.value('var') # Will get "a" settings.value('var', type=list) # Will get ["a"] The cppgenerator was modified to add a verification step before trying to get the named parameter, since it could be optional and having one named parameter was assumming that all of them were provided. Change-Id: I8f379debea86b42cf89019d432e990084c9e6614 Fixes: PYSIDE-1010 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>