aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix random values in QFormLayout.getItemPosition()Adrian Herrmann2022-08-181-0/+5
| | | | | | | | | | | | In QFormLayout::getItemPosition() on the C++ side, *rolePtr is not set if row == -1, in which case on the Python side this gets converted to a random value outside the enum range. Fix this by setting *rolePtr to a default value in the glue code. Pick-to: 6.2 6.3 Change-Id: I0c67c771ed017f14b211fa6ccf9c89706152d214 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add support for QFormLayout::TakeRowResultCristian Maureira-Fredes2022-08-182-0/+4
| | | | | | | | | | | The struct TakeRowResult was not explicitly declared in the typesystem, leaving out some QFormLayout functions like QFormLayout::takeRow(...). Fixes: PYSIDE-1312 Pick-to: 6.2 6.3 Change-Id: I77577cb54ff9cca56435b62c4848832e79f575f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix warnings about glGet(Double|Float)i_v() in QtOpenGLFriedemann Kleint2022-08-163-20/+18
| | | | | | | | | | | | | | | | | | | | The functions are present from 4.1 onwards only, causing warnings like: QtOpenGL/typesystem_opengl.xml:266: signature 'glGetFloati_v(uint,uint,float*)' (specified as 'glGetFloati_v(unsigned int,unsigned int,float*)') for function modification in 'QOpenGLFunctions_3_0' not found. Move the modifications around accordingly. Amends 39821c9265ca15373725e408b5ede19794b9e419. Task-number: PYSIDE-2013 Task-number: PYSIDE-2017 Change-Id: I1a8c48f97a032933494f981ed92c6472c72d0a5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyEnum: Define a fixed list of Int(Enum|Flag) decisionsChristian Tismer2022-08-137-38/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was "PyEnum: Write a default Int decisor for Enum and Flag". Historically, C++ enums were all compatible with int. The new Python enums are more diverse here. There are the basic types Enum/IntEnum and Flag/IntFlag. We have tried a lot to come up with a sensible default heuristic computed from the data. In the end, this was reverted and replaced by a fixed list that was collected from similar implementations. By the move away from Int inheritance, a few classes needed extra support. Python 3.11.0b5 also required the Flag creation parameter "boundary=KEEP". It is not clear if this is correct, yet. [ChangeLog][shiboken6] Most former IntEnum/IntFlag are replaced by pure Enum/Flag classes in a generally compatible way to other implementations. Change-Id: I1dbe7b0556a3375df89eb40e9d9f495f14bf42b1 Pick-to: 6.3 Task-number: PYSIDE-1735 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add glGet(Boolean|Double|Float|Integer)i_v() to QtOpenGL's versioned functionsFriedemann Kleint2022-08-115-2/+85
| | | | | | | | | | | | | Add entities to be used in each of the classes, reusing the snippets from QtGui. [ChangeLog][PySide6] The glGet(Boolean|Double|Float|Integer)i_v() functions have been added. Task-number: PYSIDE-2013 Task-number: PYSIDE-2017 Change-Id: Ib7bde37a1456ad4a399b169cbbdd63bd2dc81d50 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add glGet(Boolean|Double|Float|Integer)v() to QtOpenGL's versioned functionsFriedemann Kleint2022-08-116-3/+250
| | | | | | | | | | | | | | | | | The functions were so far excluded by a parameter type exclusion. To make them visible, exclude the other getters explicitly by name instead by parameter. This enables adding further getters step by step. Add entities to be used in each of the classes, reusing the snippets from QtGui. [ChangeLog][PySide6] The glGet(Boolean|Double|Float|Integer)v() functions have been added. Task-number: PYSIDE-2013 Fixes: PYSIDE-2017 Change-Id: I096c9ee6428af6fc0bb6cfae3ca6f021106c3320 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix a crash when overriding QAbstractItemModel::mimeData()Friedemann Kleint2022-08-111-1/+1
| | | | | | | | | | | | Correct the signature modification, which changed due to typedefs in Qt 6, fixing: sources/pyside6/PySide6/QtCore/typesystem_core_common.xml:1511: signature 'mimeData(QModelIndexList)const' for function modification in 'QAbstractItemModel' not found. Pick-to: 6.3 6.2 Change-Id: I0798308861a5ca6161c52681919a5dac672bbad2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyEnum: Fix QKeySequence to stay correct when switching IntEnum to EnumChristian Tismer2022-08-093-14/+15
| | | | | | | | | | | | | | | | | | | | | | Most PyEnum types will no longer be compatible with int, when we change from IntEnum to Enum. This has a number of consequences and leads to improvements in type representations. The repr of QKeySequence was actually wrong and misleading, see the test qkeysequence_test.py . We change the repr and the indexing to return QKeyCombination like our competitor does since a long time. [ChangeLog][PySide6] QKeySequence returns now QKeyCombination instances when indexed and the new PyEnums are used. Change-Id: Idaaeb44ca3b6103b3e0416eaeb691ad954745f73 Pick-to: 6.3 Task-number: PYSIDE-1735 Fixes: PYSIDE-2021 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add glGet(Boolean|Integer)i_v() to QtGui's QOpenGLExtraFunctionsFriedemann Kleint2022-08-092-0/+78
| | | | | | | | | | | These functions are similar to the glGet(Boolean|Integer)v() versions, but take an additional index parameter and may return arrays of different sizes. Task-number: PYSIDE-2013 Task-number: PYSIDE-2017 Change-Id: I900ce989416ed00e7662769347e9469be313d82c Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Always use the modified pyi return type of functions for signaturesFriedemann Kleint2022-08-081-2/+2
| | | | | | | | | | | | Some void-functions are modified to return something, this was missing in the signature. Add a few missing mappings revealed by this. Task-number: PYSIDE-2013 Task-number: PYSIDE-2017 Change-Id: If49549b3f605209cd86ff56b8b4cf8a5bbd5e302 Reviewed-by: Christian Tismer <tismer@stackless.com>
* QOpenGLFunctions: Restore old overloads of glGet(Float|Integer)_v()Friedemann Kleint2022-08-081-14/+14
| | | | | | | | | | | | | | | | glGet(Float|Integer)_v() had existing array modifications for the float*/int* arrays, which were apparently an oversight. Nevertheless, restore them and add the new functions using add-function with a fixme-comment in case someone is actually using them (passing in pre-allocated, writeable numpy arrays). Amends 9fb437cd2d017648f4bfc522b47f9488b825909e. Task-number: PYSIDE-2013 Task-number: PYSIDE-2017 Change-Id: I5b509193f7b34084f16439f2454ebedb171c4a0c Reviewed-by: Christian Tismer <tismer@stackless.com>
* QtDataVisualization: Add ownership transfers for QValue3DAxisFormatterFriedemann Kleint2022-08-081-1/+13
| | | | | | | | | | | | Add ownership modifications to the setter and factory functions. Amends 966fa464d1f91292c91bede88bfaf1741acdce6e. Pick-to: 6.3 6.2 5.15 Fixes: PYSIDE-2019 Change-Id: I257af1533509d823a70aa0a8f8704d3f211b23a7 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add glGet(Boolean|Float|Integer)v() to QtGui's QOpenGLFunctionsFriedemann Kleint2022-08-052-5/+108
| | | | | | | | | | | | The function return varying numbers of return values in an array. Add a helper function to determine the number. Depending on it, a single value or a numpy array is returned, matching the behavior of PyOpenGL. Task-number: PYSIDE-2013 Task-number: PYSIDE-2017 Change-Id: I8a91e491939e668932ea03eda64d83ed08ab28b3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove QhttpServerFutureResponseShyamnath Premnadh2022-08-012-3/+1
| | | | | | | | | - this is requivalent to QFutureHttpServerResponse which is a typedef for QFuture<QHttpServerResponse> - Adapt to qthttpserver/80568a0258df1b6e72a0f2824276430e3a18e781 Change-Id: I9d0add5f2edf057f11acfd0e1781a1ec2714c65a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Shiboken: use the Python 3.11 buffer interface for Limited APIChristian Tismer2022-07-191-2/+1
| | | | | | | | | | | | | | | | | | | | Because the stable API includes now the bufferprocs, we add a warning to remove the special handling when the lowest version is 3.11 . Unfortunately, I see no other way to use the new buffer interface, because things must work with every Python runtime. But that also does no harm, since this is now in the stable API. And of course, we can remove the boring version check :) Also, an old shiboken error workaround could be removed. XXX No, the shiboken error still exists in RHEL Change-Id: I2fae8cabb2cf116a7365b9cf45618da5238c2ea7 Pick-to: 6.3 Task-number: PYSIDE-1960 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Shiboken: Move the shibokensupport initialization into the moduleChristian Tismer2022-07-071-20/+0
| | | | | | | | | | | | | | | Importing shibokensupport is now possible inside the Shiboken import. That is a prerequisite to re-order the signature initialization, which is again mandatory for the new PyEnum forgiveness feature. This allows to remove much initialization code and makes the Shiboken startup less vulnerable. Task-number: PYSIDE-1735 Change-Id: Iaed4275d7e204fb242b1466cd6d2c09ad10002b5 Pick-to: 6.3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix signal ↵Friedemann Kleint2022-07-061-0/+7
| | | | | | | | | | | QAbstractItemModel::layoutAboutToBeChanged(QList<QPersistentModelIndex>) Add a meta type registration for QList<QPersistentModelIndex>. Pick-to: 6.3 Task-number: PYSIDE-1978 Change-Id: I579926877c69a624dc709b3c0534a963b04f6901 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QtSpatialAudioFriedemann Kleint2022-06-292-0/+72
| | | | | | | | Adapt to qtmultimedia/c403e775f60a5d02e761904342ac243be1f22597. Change-Id: Id078b2a7ca46ff775fbbc543428a3208d5410981 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Adapt to Qt 6.4Friedemann Kleint2022-06-297-4/+21
| | | | | | Change-Id: I46f6291c1c363b1e509ef458e635f97f4423f81b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix returning flags from QAbstractTableModel and other modelsFriedemann Kleint2022-06-241-3/+2
| | | | | | | | | | | | | | Move the function modification from QAbstractListModel to QAbstractItemModel. Amends 20eb4f94c637d20461f1fef16942841803ada909. Pick-to: 6.3 Fixes: PYSIDE-1974 Task-number: PYSIDE-1930 Change-Id: I9adedf8340a7f0999c42147e8fd290444642abcc Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* support enum handling for headerData(...)Shyamnath Premnadh2022-06-241-0/+4
| | | | | | | | | - similar to data(...), headerData(...) also needs to support handling of enums Pick-to: 6.3 Task-number: PYSIDE-1974 Change-Id: I7fd96e267af4cd30269e5fb42102c1bf6f32b155 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove build warning qCDebug, qCWarning, qCInfo, qCCriticalShyamnath Premnadh2022-06-231-4/+4
| | | | | | | | | | | | | | | | amends 936bdcf97f8ca657531496592dfce7d9144fa977 Warning (potential error) fixed - ../PySide6/QtCore/PySide6/QtCore/qtcore_module_wrapper.cpp:947:35: warning: format string is not a string literal (potentially insecure) [-Wformat-security] qCCritical(*category, cppArg1); Pick-to: 6.3 Task-number: PYSIDE-1899 Change-Id: If488e7b0d44cb905549fc35855439dec2194a79b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QHttpServer::route()/afterRequest()Friedemann Kleint2022-06-222-1/+65
| | | | | | | | | | Complements 77e0363f0257caff13e8fe5fbb9cd1e7f948b066. Add the After Request example. Change-Id: I2d2bcd5993933e9ca133e2f451580633130ae5dc Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add the QHttpServer classesFriedemann Kleint2022-06-212-0/+65
| | | | | Change-Id: I9b58e806019ee7294da466a5fce1f1b7ed01c8a3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* fix if else in qabstractitemmodel_dataShyamnath Premnadh2022-06-201-3/+1
| | | | | | | | | - adapted to follow Qt guidelines - regression from 20eb4f94c637d20461f1fef16942841803ada909 Task-number: PYSIDE-1930 Change-Id: Idfd81e2f2f2f54937863b77951b86506f89a9a4a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyside: Modify QAbstractListModel.data(..) to consider enumsShyamnath Premnadh2022-06-152-0/+14
| | | | | | | | | | | | | | | | | | | | - The function under consideration returns a QVariant, which is used internally within the C++ code. Sometimes, the value stored in this QVariant can also be a Python enum/Shiboken enum. When such a case occurs, the returned QVariant to the C++ side is a QVariant of Python /Shiboken enum, which cannot be processed from C++ code. - This is a regression from 108d82d2ca5323652a50706b37f829b9f0457367 which needs some special handling. - The solution is the convert the python enum (Shiboken enum) to the corresponding integer type, which is stored into the QVariant and returned to the C++ side. Pick-to: 6.3 Fixes: PYSIDE-1930 Change-Id: Id4e9a1caa5a318e2410e584502c6dc6e35e3a657 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Limited_API: Fix PyIndex_Check once and for all: avoid warningChristian Tismer2022-06-031-2/+2
| | | | | | | | | | | | The Windows compiler is quite overzealous and complains if headers have different ordering in the used version, although the content seems to be identical. Instead of doing a tedious search, we simply rename the function. Task-number: PYSIDE-1797 Change-Id: I88a8eca882357ac31b9eb932c89013c51c5c75e4 Pick-to: 6.2 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Signature Module: Remove special handling of QtMultimedia, amendedFriedemann Kleint2022-06-031-6/+0
| | | | | | | | | Remove the code from generate_pyi.py as well, amending 4a3d5f9affd0ba8f6d37ad5c0cdf8d2aa52914a8. Pick-to: 6.3 6.2 Change-Id: I718ff55b9cfbe027a133083f3cd6ddd3c85fb803 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add QAudioBuffer.data()/constData()Friedemann Kleint2022-06-012-1/+20
| | | | | | | Pick-to: 6.3 Fixes: PYSIDE-1947 Change-Id: I9e1799f245b8d75f61ad9551cb847994ea59bdb9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Refactor the snippets for QByteArray::__mgetitem__/__msetitem__()Friedemann Kleint2022-05-311-74/+77
| | | | | | | | | Fix many return-after-else clang warnings Pick-to: 6.3 Change-Id: I78afb7e29cb0e6adb1d023277548c93896ded520 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Introduce an attribute for parent ownership heuristicsFriedemann Kleint2022-05-273-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | The parent ownership heuristics cause some unintended ownership transfers to be generated that can cause crashes. However, completely removing them would mean to have to explicitly specify it in each QObject-derived class constructor. To improve this, introduce an attribute to restrict the heuristics to classes to which this is applicable. For compatibility, the attribute is only honored in shiboken 6 if some class in the type system explicitly specifies it. For shiboken 7, it will be mandatory. [ChangeLog][shiboken6] An type system attribute for restricting the parent ownership heuristics to relevant classes has been introduced. The workaround 0e62c4db50472f8b581022c86a6be651158d0cd0 can then be reverted. Task-number: PYSIDE-1939 Change-Id: I0fb01e9842aecbccaa686ce71b2163b20a97cbf7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use SPDX license identifiersLucie Gérard2022-05-27135-5121/+270
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix "Internal C++ object already deleted." when using ↵Friedemann Kleint2022-05-241-0/+6
| | | | | | | | | | | | QWidget::nativeParentWidget() Prevent the return value heuristics from setting a parent relationship. Pick-to: 6.3 6.2 5.15 Fixes: PYSIDE-1893 Change-Id: Id2f71251c2d0f55072675cb36e4ec5ed9511c92d Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix a crash in QTextBlock.layout()Friedemann Kleint2022-05-231-0/+5
| | | | | | | | | Prevent the return value heuristics from setting a parent relationship. Pick-to: 6.3 6.2 5.15 Fixes: PYSIDE-1939 Change-Id: I7b8b4080f4c0c288439140c44fb9c2b896af2907 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyEnum: Implement Switchable Qt Enums Using Python EnumsChristian Tismer2022-05-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mapping from Qt Enum to Python Enum was considered to be difficult. Actually, it is easier than thought. As a minimum invasive approach, this implementation changes very little in the first place. The generation process of enums stays almost unchanged, which simplifies handling of the generated code very much. At the end of each generated Enum, we call a special function that grabs the newly generated enum, reads all items and produces a Python class that replaces the enum in-place. We don't generate Python code, but the functional API to create the new enums. There are lots of more optimizations possible, but this concept solves the issue nice and quickly. A harder problem was the need to map all QFlag structures to enum.Flag structures from Python. This caused a sometimes hacky coding because both the old and the new version are supported. This will be totally cleaned up when we remove the old implementation. Pick-to: 6.3 Task-number: PYSIDE-1735 Change-Id: I66991312f2d7b137f110a4db30702b8f3bf518dd Reviewed-by: Christian Tismer <tismer@stackless.com>
* QDBus: Use value types where possibleFriedemann Kleint2022-05-201-3/+3
| | | | | | | | | | Amends 081bafdc94d2cc81fa88517598061237cea0329d. Pick-to: 6.3 6.2 Task-number: PYSIDE-1570 Change-Id: I8f0da61fa09807b9be0033e1da0e88adf0580e5f Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Skip Q_ENUM helper functions when PySide extensions are enabledFriedemann Kleint2022-05-181-2/+0
| | | | | | | | | | | | | | | | | | The helper functions qt_getEnumMetaObject() and qt_getEnumName() defined by Q_ENUM had to be rejected in the typesystem files in each namespace. Pass the ApiExtractor flags to the meta builder to cleanly detect all Qt special functions and automatically reject them when PySide extensions are enabled. [ChangeLog][shiboken6] The Q_ENUM helper functions qt_getEnumMetaObject() and qt_getEnumName() are now automatically rejected when PySide extensions are enabled. Fixes: PYSIDE-1932 Pick-to: 6.3 Change-Id: Iceb5f0c3175ecaef657ae71adf6a5b8bf48af740 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* webenginecore - QtWebEngineProfile setNotificationPresenterShyamnath Premnadh2022-05-182-0/+20
| | | | | | | | | | | - added setNotificationPresenter(...) - added QtWebEngineWidgets Notifications example which uses setNotificationPresenter Task-number: PYSIDE-1912 Pick-to: 6.3 Change-Id: Ib8fdf7879d6e54bcae47dcc89be6bd5a861a8846 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* webenginecore: QWebEngineCookieStore setCookieFilterShyamnath Premnadh2022-05-173-1/+63
| | | | | | | | | - added tests for the setCookieFilter(...) Task-number: PYSIDE-1912 Pick-to: 6.3 Change-Id: I484725072195846e7777fc577d167ff9ed374d59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move numpyview from libpyside into libshibokenFriedemann Kleint2022-05-132-7/+7
| | | | | | | | | | libpyside then no longer depends on numpy. There is only one place left where numpy is initialized, allowing for dynamic loading. Task-number: PYSIDE-1924 Change-Id: I50d02814f8cc6eb85d8cdb5330cfff3b586656ad Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* UiTools: Remove dependency on QtXmlFriedemann Kleint2022-05-111-1/+1
| | | | | | | | | | The module only uses QXmlStreamReader/Writer. Amends 653f8c8272f3e29c784173ebd98175bc843ee3a4. Pick-to: 6.3 Change-Id: Ib71c9a712dd7c3b78b7720728b07a6d7c13351a1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Implement Q_ARG/Q_RETURN_ARG for QMetaObject.invokeMethod() with argumentsFriedemann Kleint2022-05-105-3/+396
| | | | | | | | | | | Introduce an internal type QGeneric(Return)ArgumentHolder which casts to QGeneric(Return)Argument and stores a QMetaType along with a data pointer. It is returned by Q_ARG/Q_RETURN_ARG and then handled in QMetaObject.invokeMethod(). Fixes: PYSIDE-1898 Change-Id: I229cb03d5d71c3b32a2e1eb4040f7641b8e49000 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Support Windows handle types HBITMAP, HICON, HRGNFriedemann Kleint2022-05-091-1/+29
| | | | | | | | | | | | | | | This adds functions like QImage::toHBITMAP()/toHICON(), QRegion::toHRGN(). Treat them as plain PyLong types in order to be compatible with PyWin32. [ChangeLog][PySide6] Windows handle types HBITMAP, HICON and HRGN have been added. Pick-to: 6.3 Fixes: PYSIDE-1859 Change-Id: I07a98ecdd3da52ff0b0b78db56388f579ede3e46 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: add qCDebug, qCInfo, qCWarning, qCCritical macrosShyamnath Premnadh2022-05-092-0/+32
| | | | | | | | | | | | | - added tests for the macros Only 'void debug(const char *msg, ...) const' was considered among the overloads in QMessageLogger. For more info, see the comment section of the related issue PYSIDE-1899 Task-number: PYSIDE-1899 Pick-to: 6.3 Change-Id: Ie9a28abde8556f84736de75cf4b914002094c768 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QMetaType: Add a constructor taking a PyTypeObjectFriedemann Kleint2022-05-092-0/+8
| | | | | | | | | Currently mainly used for testing, but might be generally useful. Task-number: PYSIDE-1898 Change-Id: Iffc63048d3d520def79b4bae7d08a31829bea2e5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Add QQmlContext::setContextProperties()Friedemann Kleint2022-05-092-1/+4
| | | | | | | | Pick-to: 6.3 Fixes: PYSIDE-1921 Change-Id: Id80f9c2f7533d7e2d58af0fb0f1d6d8eb586d31a Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Fix bool(QByteArray(b"")) to return FalseFriedemann Kleint2022-05-091-1/+3
| | | | | | | | | | | | | | | | bool(QByteArray(b"")) currently returns True due to QByteArray::isNull(), which is out of line with the Python convention that "" yields False. Disable the isNull() handling to fix this. [ChangeLog][PySide6] The bool cast for QByteArray has been changed to return False for empty byte arrays to match the expected behavior. Fixes: PYSIDE-1913 Change-Id: I197bf1553bd0335ded213f377f657cedc2af03fc Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Remove qHash() specificationsFriedemann Kleint2022-05-062-5/+5
| | | | | | | | | They should now be automatically generated. Amends 9c37876d6f649b3c9bd1411d3c7ffe620786f1a8. Task-number: PYSIDE-1906 Change-Id: I7551762246734ef68ef3ea3638a2abd77e0cf7f4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Introduce a function to get the type name of a polymorphic classFriedemann Kleint2022-05-052-1/+61
| | | | | | | | | | Helps for hierarchies that do not have virtual destructors where the default typeid(t).name() does not work (QStyleOption). Pick-to: 6.3 Fixes: PYSIDE-1909 Change-Id: I9ce3769a8c3550d011023597eede0ae6f8c9ad68 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add a numpy overload for QSurfaceDataProxy.resetArray()Friedemann Kleint2022-05-055-1/+204
| | | | | | Fixes: PYSIDE-1880 Change-Id: I67ab9b3d0f6132f14ef4e21d4b2f85c43242de5f Reviewed-by: Christian Tismer <tismer@stackless.com>