aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6
Commit message (Collapse)AuthorAgeFilesLines
...
* Specify meta type registration for some class hierarchiesFriedemann Kleint2022-05-043-5/+8
| | | | | | | | | | | | Register only the base classes of some hierarchies, reducing the number of meta types. Most importantly, register the meta type only for QGraphicsItem* and not the derived classes, fixing the bug. Task-number: PYSIDE-1887 Change-Id: Ie9a3d46a4ea4ef6ecf8476f00fea0cbbf9eb607e Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Change type discovery for QStyleOption to use qstyleoption_cast<>Friedemann Kleint2022-05-031-22/+22
| | | | | | | Pick-to: 6.3 Task-number: PYSIDE-1909 Change-Id: I9e318a1fef71c80ba8df81fe8c98e535df26098e Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: QLoggingCategoryShyamnath Premnadh2022-05-032-0/+3
| | | | | | | | | | - added QLoggingCategory Task-number: PYSIDE-1899 Pick-to: 6.2 6.3 Change-Id: Id4e2c270e921d83571dcf13b67df1535d7b37f6f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Add overloads with more parameters to QDBusAbstractInterface::call()Friedemann Kleint2022-05-021-0/+8
| | | | | | | | | Amends 081bafdc94d2cc81fa88517598061237cea0329d. Pick-to: 6.3 6.2 Fixes: PYSIDE-1905 Change-Id: Idb84981ce88d861be0c6518575f88d0fdbf528ea Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Add QString to UNICODE conversionFriedemann Kleint2022-04-291-4/+2
| | | | | | | | Complements dffe483604d6371112da6ef5ad40c6dfcee20f76. Task-number: PYSIDE-1898 Change-Id: I65bf5631ca2507a6488db370dfc8972b1a1e3c5f Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Add function to convert a PyTypeObject to a QMetaTypeFriedemann Kleint2022-04-282-10/+4
| | | | | | | | Move the snippet into the library for further use. Task-number: PYSIDE-1898 Change-Id: If04da23cb0a4890474810ca762cc2ee29de480f6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Move the UNICODE conversion into the libraryFriedemann Kleint2022-04-282-13/+2
| | | | | | Task-number: PYSIDE-1898 Change-Id: I8ed11bb3f46a5e26adf8bcb7aa3f083adde40628 Reviewed-by: Christian Tismer <tismer@stackless.com>
* __feature__: improve the feature module by a reset functionChristian Tismer2022-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The __feature__ tests need a stronger way to reset the feature selection reliably. Some cross-talk was observed when running multiple tests together with PyTest. This effect was hidden because our unit-tests are isolated in individual processes by CTest. - Remove all special 0x80 cases of TearDown functions - introduce a new feature module function `reset` that completely uninitializes the features, including the `pyside_feature_dict`. - drop the artificial naming of `__feature__` in favor of `feature`. This is less confusing for people examining the implementation. [ChangeLog][PySide6] Feature switching was improved by avoiding cross-talk between multiple test runs. Task-number: PYSIDE-1019 Change-Id: I28550f293763ac58df72b8ce5c0a613c2067f6ba Pick-to: 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* PySide6: Allow for embedded 0 chars in 1 byte stringsFriedemann Kleint2022-04-261-1/+1
| | | | | | | | | | | Pass the length to QString::fromLatin1(). Amends b90acad7ebd389b34465504d229552af6c8196e5. Pick-to: 6.3 6.2 5.15 Fixes: PYSIDE-1895 Task-number: PYSIDE-1882 Change-Id: Ie829e479ad4e81f691cd3564ce1640175d1cdc32 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix include conventionsFriedemann Kleint2022-04-222-2/+3
| | | | | | | | | Reorder includes such that local includes are first, followed by Qt and C/C++ system includes. Pick-to: 6.3 6.2 Change-Id: Ib801d34de7242befce4be429bfb099ccabe1f987 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup: fix PySide6.__all__ after the wheel split, augmentedChristian Tismer2022-04-201-1/+2
| | | | | | | | | | | | | | | | | | The original fix had a criterion to use the unchanged module list when a build is active. The determination if a build is in progress was too setup.py specific. Using a compiled-in variable solved in a general way. This patch can be removed completely when the wheel split method is getting aware of __all__ . Thanks to Antonio Rojas for the nice hint. Change-Id: Iaf4cb28056b7f80f2f0c9fb5604c3033bfc1aba5 Fixes: PYSIDE-1890 Pick-to: 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Write smart pointer constructors/reset methodsFriedemann Kleint2022-04-201-1/+2
| | | | | | | | | | Enable the generation and invalidate the pointee passed in in case it is a wrapped class. Task-number: PYSIDE-454 Change-Id: I4c751d9e8731a6f70e4ecc0f808cb204f010f9b2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Expose Test::qWait()/qSleep()Friedemann Kleint2022-04-191-2/+0
| | | | | | | | | | | Both functions were explicitly rejected by 8ea7551ac00a49d72ccf0d6a8fcf1e064d59e496, but that seems to be misguided. Pick-to: 6.2 6.3 Fixes: PYSIDE-1883 Change-Id: Ic272258aa2663a3927b68ebcbb26de9914ca6395 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add readBytes and writeBytes functions from QDataStreamShyamnath Premnadh2022-04-085-3/+105
| | | | | | | | | | | - along with the addition of these functions, a common.xml is created to stores all the common templates Task-number: PYSIDE-890 Pick-to: 6.2 Change-Id: I4fadfe77a38635f15a7aef04adeac949c2d61b5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QAction: Add setMenu() and menu()Cristián Maureira-Fredes2022-04-082-2/+12
| | | | | | | | | | | | | | | | | | | | After the changes in Qt6 related to moving QAction completely to QtGui, the 'on-demand' functions associated to QMenu were not properly exposed. This patch manually adds setMenu()/menu() using QObject's. A simple test case was added. [ChangeLog] QAction.setMenu() and QAction.menu() were implemented. Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Pick-to: 6.2 Fixes: PYSIDE-1627 Change-Id: Ib8102a9cf513ee2e13ff71751b1167ca0146af31 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* PySide6: Fix build after deprecation of QVERIFY_EXCEPTION_THROWNFriedemann Kleint2022-04-071-0/+1
| | | | | | | | | | qtbase/ed343669f7c219b89449762cce086cb036a9a8f2 deprecated QVERIFY_EXCEPTION_THROWN and its helper useVerifyThrowsException(). Remove the function. Change-Id: Ic6484e1b984df8f3317225fb1f9dad0fa91609ad Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add QPyQmlParserStatusFriedemann Kleint2022-04-014-1/+66
| | | | | | | | | [ChangeLog][PySide6] class QPyQmlParserStatus for handling QML parser status changes has been added. Fixes: PYSIDE-1876 Change-Id: Ic1066924ec85dc8633f959342921c1d03da1aee4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup: fix PySide6.__all__ after the wheel splitChristian Tismer2022-04-011-0/+29
| | | | | | | | | | | | | | The __all__ variable can no longer reliably be generated during compile time. - look into the FS to get a list of available modules - apply the existing __all__ order for convenience - make sure to call this function outside of a build, only. Change-Id: Ibaf300447e86127e39a98a9150b7e8b4d8ced27d Pick-to: 6.2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Fix QMetaProperty::Write(..)Shyamnath Premnadh2022-03-312-0/+10
| | | | | | | | | | | | | | | Change 108d82d2ca5323652a50706b37f829b9f0457367 introduced a regression that when enum is passed to a QVariant and that QVariant is processed from C++, it does not work as expected. This patch handles the case of enum, separately for the function under consideration. Pick-to: 6.2 Task-number: PYSIDE-1870 Change-Id: I5d002cb36f23d8763de737578af7b52d8259a306 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Windows: Enable building without QMLFriedemann Kleint2022-03-231-1/+4
| | | | | | | | | Test for existence of libpysideqml in __init__.py. Amends 8019ce52080ed51cd053d480c6c61d667469fc25. Task-number: PYSIDE-1709 Change-Id: Iaf4c05a321ced69c91a7d92d711ae6acd5a621fd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Fix crash when implementing QQuickFramebufferObject.createRenderer()Friedemann Kleint2022-03-231-0/+5
| | | | | | | | | Pass the ownership to C++. Pick-to: 6.2 5.15 Fixes: PYSIDE-1868 Change-Id: I52c0c7778a2d89b38406d6c1e15482855057fb5c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Fix comparison operators in namespacesFriedemann Kleint2022-03-221-0/+5
| | | | | | | | | | | | | | | | Change qtbase/e7fd9a9f4ab1fcc017174d6d7760c731857b89fc introduced some mixed flag operators in Qt which caused compile errors. They should be ignored by traverseOperatorFunction() since they cannot be attributed to any class, but traverseOperatorFunction() was only called for the global namespace. Fix by calling it for operator functions in namespaces as well. Task-number: QTBUG-99948 Pick-to: 6.2 Change-Id: I57419563f10f1a0d33aea027a166119f969bca5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Fix build broken by mixed flag operatorsFriedemann Kleint2022-03-191-0/+8
| | | | | | | | | | Change qtbase/e7fd9a9f4ab1fcc017174d6d7760c731857b89fc introduced some mixed flag operators which cause compile errors. Remove them. Task-number: QTBUG-99948 Change-Id: Ie3dde185e68bd972bc15eafac2875ada488dec5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add a context manager for override cursorsFriedemann Kleint2022-03-185-2/+99
| | | | | | | | | | [ChangeLog][PySide] A context manager for override cursors has been added. It is now possible to write code like: with QApplication.setOverrideCursor(Qt.WaitCursor):... Change-Id: I443ce82389b48656f21c98df17d97e1b3b3323b5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Port code to use size() instead of count() of Qt containersFriedemann Kleint2022-03-172-6/+6
| | | | | | | | | | | count() will be deprecated. Fix some integer types in loops and modernize code in changed lines. Pick-to: 6.2 Change-Id: Idf21927661ea6c8866ee36e7c623043271e21620 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Expose QtGui's qFuzzyCompare() overloadsFriedemann Kleint2022-03-041-1/+7
| | | | | | | | | | | They are declared as friend functions of the respective classes only; so, declare them in the type system file. Remove the QMatrix overload since the class was removed. Fixes: PYSIDE-1840 Pick-to: 6.2 Change-Id: Ia49eab4219918ea939df95f103d56c17519e8e4e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add QtNfcFriedemann Kleint2022-03-042-0/+101
| | | | | | | | | [ChangeLog][PySide6] QtNfc has been added. Task-number: PYSIDE-1570 Change-Id: I7c2832f8529732f1d6cc0abbb1dd2a60f59682a1 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Simplify special code handling Qt Quick type registrationFriedemann Kleint2022-03-031-111/+21
| | | | | | | | | | | | | | | | | The code used templates to ensure the QMetaTypes registered in QML matched the Qt Quick types (QQuickPaintedItem, QQuickFramebufferObject, QQuickItem). After fixing the metatypes, all that is left is to determine the correct values for QQmlPrivate::RegisterType::parserStatusCast, valueSourceCast and valueInterceptorCast by the template code. This will make the QmlAttached/QmlExtended work with Qt Quick, too. Task-number: PYSIDE-1836 Change-Id: Ic31587c9fd2dca46f6957757079b6abc56cc7416 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Implement QQmlPropertyValueSourceFriedemann Kleint2022-02-284-1/+69
| | | | | | | | | | | | | | | As is done with the other interfaces, add a class QPyQmlPropertyValueSource inheriting from QObject and QQmlPropertyValueSource. Store its offset in QQmlPrivate::RegisterType::valueSourceCast if it is found as a base class. [ChangeLog][PySide6] class QPyQmlPropertyValueSource for implementing QML value sources for properties has been added. Task-number: PYSIDE-1709 Change-Id: Icd1bd57972f339f9839ccd8d9bf6ff9e5e16ec62 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyPySide: Fix a regression with thread initializationChristian Tismer2022-02-282-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | The mandelbrot.py example worked fine on macOS, but failed to run on Windows and Linux. This did not show up on my local Windows virtual machine after building. But cloning the machine and removing the developer partition revealed the same issue on the clone. It turned out that PyPy needed a PyEval_InitThreads call. This call is already deprecated and a no-op on Python 3.9. Adding this call fixed the problem. We need to contact the PyPy group because they have a PyPython 3.9 beta, which is dependent from a deprecated function. [ChangeLog][PySide6] Threading stability was much improved by a call to PyEval_InitThreads (deprecated in Python 3.9). Task-number: PYSIDE-535 Change-Id: Ibf6d92bf0b21542be8929e12a6e02389c036ec79 Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix build with pypy on WindowsFriedemann Kleint2022-02-241-1/+1
| | | | | | | | | | | Convert path to str in __init__.py, fixing: File "build\testenv_pypy\build\pyside6\PySide6\__init__.py", line 55, in _setupQtDirectories os.add_dll_directory(dir) TypeError: expected str, got WindowsPath object Task-number: PYSIDE-535 Change-Id: I8555ad9877c995601cf023d92ee6acd3bc125c51 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix crash when implementing ↵Friedemann Kleint2022-02-231-1/+7
| | | | | | | | | | | QQuickAsyncImageProvider::requestImageResponse() Release ownership of the returned value. Pick-to: 6.2 Fixes: PYSIDE-1826 Change-Id: I9bae901a239b4f77a37585710270bec20c383f19 Reviewed-by: Christian Tismer <tismer@stackless.com>
* QAbstractOAuth - add setModifyParametersFunctionShyamnath Premnadh2022-02-222-0/+74
| | | | | | | | | | - create bindigns for setModifyParametersFunction - reddit example modified to include setModifyParametersFunction() Pick-to: 6.2 Task-number: PYSIDE-1815 Change-Id: If3573df070483f22cc46d9f95f688299e9ece420 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix QLowEnergyServiceData.chacteristics()Friedemann Kleint2022-02-171-7/+5
| | | | | | | | | | Change the data types to be value types since lists of instances are returned from the function. Pick-to: 6.2 Fixes: PYSIDE-1824 Change-Id: I7e0006f2cddef412fd26cb09c43d01474d30d54b Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix parent relationship in QWizard::setPage()Friedemann Kleint2022-02-171-0/+5
| | | | | | | | Similar to QWizard::addPage() Pick-to: 6.2 5.15 Change-Id: I4702d044551353b373ac4da9a0cd5692dd685ca9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Add QLocale::LanguageCodeTypes flagsFriedemann Kleint2022-02-171-1/+1
| | | | | | | | | | The flags were forgotten in 9f32cff389da26e667ec0f8b3c7fa9814d46a4d7. Adapt to qtbase/4f53c703e40bea3203259c212c54dc4816c08b09. Task-number: QTBUG-98129 Change-Id: I3d1226c8b154cd3075b442f04bde1e0eda9c4414 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add the QmlAttached decoratorFriedemann Kleint2022-02-162-0/+11
| | | | | | | | [ChangeLog][PySide6] The QmlAttached decorator has been added. Task-number: PYSIDE-1709 Change-Id: I0301ecc7a9bc7a1b798095e8972b2fe4addf2eaf Reviewed-by: Christian Tismer <tismer@stackless.com>
* Update license year in the generated licenseFriedemann Kleint2022-02-161-1/+1
| | | | | | | Pick-to: 6.2 5.15 Change-Id: Iaf63965069639e52e6c6d9c5c2f88cb98553e485 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix generate_pyi failing to import QtQml on WindowsFriedemann Kleint2022-02-081-1/+1
| | | | | | | | | | | | The path to the newly added libpysideqml library needs to be added to __init__.py. Amends 862948599999e4e5701452a3f479182606e16a89. Task-number: PYSIDE-1709 Change-Id: Ib3bcbe9fb834432904ca0374ecbfb9f4ac80d112 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* pyside: fix exception strJulien Schueller2022-02-041-1/+1
| | | | | | Change-Id: I7816304a293611f90a729af46a3ea26d815cf28d Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPySide: Rename interface functions and classes to simplify debuggingChristian Tismer2022-02-034-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | The names of certain interface functions are not always following a simple scheme. Especially it is not easy to see immediately if we are dealing with a method of SbkObjectType or SbkObject Do a few renamings to simplify debugging and make the code easier to understand. When a function is used in a type spec and there is no other important reason, it should be named like {Py_<tpname>: reinterpret_cast<void *>(<TypeName>_<tpname>)}, Rename also all type functions ending on "TypeF()" to end in "_TypeF()". This is not always the case. Examples: SbkObjectTpNew -> SbkObject_tp_new SbkObjecttypeTpNew -> SbkObjectType_tp_new PyClassPropertyTypeF -> PyClassProperty_TypeF Task-number: PYSIDE-535 Change-Id: Icbd118852f2ee732b55d944ed57c7a8ef7d26139 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Refactor code snippets for QByteArray::__msetitem__()/__mgetitem__()Friedemann Kleint2022-02-031-28/+21
| | | | | | | | | | | | | | Fix integer types, move variable declarations to initialization, remove superfluous variables. As a drive-by, fix spelling in the test. Pick-to: 6.2 Task-number: PYSIDE-1804 Change-Id: I7ed4e69ae850a63d7e213a31cb078aa40e597fb2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: Fix locker handling which enables MandelbrotChristian Tismer2022-02-032-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not only the QPainter, but also the QMutexLocker were not correctly modelled after PEP 343 in the examples. Since that is now fixed, we consider the PyPy project not as ready, but good enough to publish it. It also turned out that people have the expectation to use QSignalBlocker in the "as" form: with QSignalBlocker(self.double_spin_box) as blocker: self.double_spin_box.setValue(2.5) https://stackoverflow.com/questions/60384734/how-to-use-qsignalblocker-in-python But that blocker would be None. As a side effect, QMutexLocker, QReadLocker, QWriteLocker and QSignalBlocker were augmented with a default __enter__ implementation that returns the locker instance. [ChangeLog][PySide6] The Mandelbrot example needed context managers for QPainter and QMutexLocker to work in PyPy. Task-number: PYSIDE-535 Pick-to: 6.2 Change-Id: I2a62ca645a4fddcafbf11869f14a538141f32c39 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Prospective fix for broken QByteArray::__msetitem__() on big endian ↵Friedemann Kleint2022-02-031-3/+4
| | | | | | | | | | | | | architectures Remove a dubious cast from long to const char * which depends on byte order. Pick-to: 6.2 5.15 Fixes: PYSIDE-1804 Change-Id: Iee2d809d4e9362b89439b9c56a5fb18e1f91d6fd Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Convert QVariant to Enum typesShyamnath Premnadh2022-01-301-1/+1
| | | | | | | | | | | | | | | | Before this patch, the conversion from QVariant->enum in Shiboken was same as the conversion from QVariant->int. So, the user will have to explicitly convert the returned integer to the original enum type. With this patch, an enum type is considered as an Object type rather than an int type. This enables the enum type to be considered as itself. Added tests for all conversions of QVariant types. Pick-to: 6.2 Fixes: PYSIDE-1798 Change-Id: I18acc08e1f59ac7df844444d0ad6950e1d70ab21 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Add QLocale::LanguageCodeTypeFriedemann Kleint2022-01-281-0/+1
| | | | | | | | Adapt to qtbase/4f53c703e40bea3203259c212c54dc4816c08b09. Task-number: QTBUG-98129 Change-Id: I312c19057fb5419a780e0b925a400008f766ebbb Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use Opaque container for OpenGL in the hellogl2 exampleFriedemann Kleint2022-01-271-1/+1
| | | | | | Task-number: PYSIDE-1605 Change-Id: Ieefae548195c19ba9968b48c57d48a8255ed9633 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: Turn most QPainter instances into context managersChristian Tismer2022-01-261-4/+4
| | | | | | | | | | | | | | | After the new context manager is in place, most of the examples benefit from moving QPainter into a `with` statement. The comments concerning PyPy could be removed, again. [ChangeLog][PySide6] The examples are updated to use the new context manager for QPainter. Task-number: PYSIDE-535 Change-Id: Idf7e1f734d549ed663383ffbb2416297ebb1e0c7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: Implement a context manager for QPainterChristian Tismer2022-01-262-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Context managers existed in Python since 2005 (PEP 343). They were invented to support resource management for different Python implementations that cannot rely on immediate object destruction. PyPy is the first alternate Python implementation that can run PySide. QPainter does not work in PyPy without an explicit end() call. For convenience, we supply a context manager that handles this. Like in file I/O, we now prefer instead of painter = QPainter(paintable) the new indented form with QPainter(paintable) as painter: [ChangeLog][PySide6] QPainter has become a context manager. Using a with statement saves the need to call painter.end() . Task-number: PYSIDE-535 Change-Id: Ib8bebbe121dc08334d31c9663a1e5bc8042c3b62 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QFileDialog: allow threads with modal dialogsCristián Maureira-Fredes2022-01-241-0/+2
| | | | | | | | | | | The snippets that were used to get the return from a QFileDialog modal call was blocking, so we explicitly allow threads around the C++ call. Fixes: PYSIDE-1792 Pick-to: 6.2 Change-Id: Ifb06e8726fece6a9b8248bc91e7616101a8a99a2 Reviewed-by: Christian Tismer <tismer@stackless.com>