aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2
Commit message (Collapse)AuthorAgeFilesLines
* Fix QAxBase::dynamicCall(const char *, QVariantList)Friedemann Kleint2020-11-041-1/+7
| | | | | | | | | | | | | | | | When invoking QAxBase::dynamicCall(const char *, QVariantList), the overload taking single QVariants QAxBase::dynamicCall(const char *, QVariant1, QVariant2,...) was chosen by the overload decisor since QVariantList can be converted to QVariant. Specify the order manually. Remove the internal protected function. Fixes: PYSIDE-1410 Change-Id: I1bcffd34486d5ceebdeea3af47f42398896e9575 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 27aa24e589ca293298f88f3fd0d027d9f95dedc5)
* Add some missing enumerations and classesFriedemann Kleint2020-10-215-1/+8
| | | | | | Task-number: PYSIDE-487 Change-Id: Ic5d15d67b821eff5cb59727ce2d749e6aa848441 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add some more classes from QtConcurrentFriedemann Kleint2020-10-164-0/+34
| | | | | | | | | This lays the foundation for adding further specializations of QFuture and QFutureWatcher to dependent modules. Task-number: PYSIDE-1202 Change-Id: I82f9940db9d50ced95d4e1388c6460c6efc0469b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add Network as dependency for WebEngineCoreCristian Maureira-Fredes2020-10-042-1/+5
| | | | | | | | | This enable to expose types like QNetworkCookie which is required for the setCookie, and deleteCookie methods. Fixes: PYSIDE-644 Change-Id: I28d0b81e59a6ca411f22e1f9afd7f4139927b1a2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Signature: Revert SbkSpecial_Type_Ready to PyType_ReadyChristian Tismer2020-09-241-2/+2
| | | | | | | | | | | | | | | The early signature module tried to minimize the visible changes to the code base. It replaced the `PyType_Ready` call by a special version which did other things as well. We replace that special call by a more intuitive function `InitSignatureStrings` that does exactly that and nothing more. The functionality of the module is unchanged. Change-Id: Ic2f9cd29b0352f0a24daa55b01420c77d103c0b2 Task-number: PYSIDE-510 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add user property QLayout::contentsMarginsFriedemann Kleint2020-09-231-1/+2
| | | | | | | | This becomes a real Q_PROPERTY only in Qt 6, so, add it here. Task-number: PYSIDE-1019 Change-Id: I98f8c674370c01605270d7c78bc199464e66642d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix crash when reimplementing QLayout.takeAt()Friedemann Kleint2020-09-231-0/+1
| | | | | | | | Mark the ownership of the C++ wrapper result as C++. Fixes: PYSIDE-665 Change-Id: I2c5410bd2ebde03a246a3c1b047d99c0a0472e76 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QColorConstants namespaceCristián Maureira-Fredes2020-09-222-0/+13
| | | | | | | | | | | The colors inside the namespace are defined: constexpr Q_DECL_UNUSED QColor Black {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101}; Fixes: PYSIDE-1224 Change-Id: I84ba5fae74e336ab01b3bac467c8fc6e2b45d14b Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Allow specifying the sequence of overloadsFriedemann Kleint2020-09-211-0/+4
| | | | | | | | | | | 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>
* Q(Plain)TextEdit::createMimeDataFromSelection(): Fix a crash when creating ↵Friedemann Kleint2020-09-211-0/+12
| | | | | | | | | | QMimeData Mark the return value as owned by C++. Fixes: PYSIDE-1082 Change-Id: Id4be45cf90bbe480839cbe3d355831bf1ddb0c16 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Add attribute for generating "using namespace"Friedemann Kleint2020-09-181-1/+1
| | | | | | | | | | | | Make it possible to turn off the generation of using namespace. This is required in Qt 6 to avoid a clash between Qt3DCore::QBuffer and QBuffer used in __repr__. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Iaaf3e67f0ffaae86e2de82b9a1b8fe7d00c74e6b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix crash when overriding QUiLoader::createWidget() in QUiLoaderFriedemann Kleint2020-09-171-0/+4
| | | | | | | | | Mark the returned objects of the create functions in native (wrapper code) as owned by C++. Fixes: PYSIDE-1070 Change-Id: I8774f2f0c9adafc73e0d969384e4c0357b7c896d Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove dependency of the QtQml module header on pysideqmlregistertype.hFriedemann Kleint2020-09-162-7/+16
| | | | | | | | | | | | | Make it possible to inject code into module headers by specifying "declaration" on type system code snippets. Use that to insert the struct definition into pyside2_qtqml_python.h and remove the include. Add the required includes via code injection into the wrapper and extra includes for the types. Fixes: PYSIDE-1381 Change-Id: I8dfda4c33d66f56e8fb516e1b174cc43664ca318 Reviewed-by: Christian Tismer <tismer@stackless.com>
* 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>
* AxContainer: Add missing enumerationsFriedemann Kleint2020-09-111-2/+6
| | | | | | Task-number: PYSIDE-487 Change-Id: Ida9e7d23bb06e5a9b76ef0b7d8e3618375c5d508 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add the QWidget *-based overloads of the QtWinExtras functionsCristian Maureira-Fredes2020-09-083-2/+14
| | | | | | | | | | | | Add a pre-header defining QT_WIDGETS_LIB so that they become visible, similar to what is done for QtSql. Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Fixes: PYSIDE-1374 Task-number: PYSIDE-487 Change-Id: I0fe1d8c6ca07a79ea9aa1acff00153239ca9a4cb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QDomElement: remove unnecesary setAttribute overloadsCristian Maureira-Fredes2020-09-041-1/+14
| | | | | | | | | | | | Removing all the different overloads that don't make much sense in Python land, leaving only one for integers (qlonglong), and one for floats (double), since in Python those are the general primitive types to handle, and having a proper transformation for uint, qulonglong, float, etc, is not really mandatory. Fixes: PYSIDE-1372 Change-Id: Iba2e3d560dd971e3ecd0146bd5e2ec47f09c16e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* signature: Use a clean init function to initialize itChristian Tismer2020-09-041-1/+2
| | | | | | | | | | | | | | | After the quick hack replacing "type.__signature__" by 'eval("type.__signature__")', we now use a clean initialization function `_init_pyside_extension` that is implanted into the __builtins__ module. This is the first of a series of improvements and simplifications that will be applied slowly with low priority. Task-number: PYSIDE-829 Task-number: PYSIDE-510 Change-Id: I9951239c73d02f47272f1a531fb4886c8181b9a7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* signature: Avoid non-existent attributes in compiled code (Nuitka)Christian Tismer2020-08-311-1/+2
| | | | | | | | | | | In standard Python, there is (yet) no attribute "__signature__". Nuitka, the compiler, knows that and raises an AttributeError without even trying. The workaround was simple: Use "eval". Change-Id: Ice9deccd7ba2fe4c376f0a151924a68f88ca020d Fixes: PYSIDE-829 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* signature: pass `self` directly from parserChristian Tismer2020-08-241-6/+6
| | | | | | | | | | | | | | | | | | The signature module took the info from the PyCFunction flags for a long time to check if something is a function, method or staticmethod. It turned out that there are functions with multiple signatures where the method/staticmethod info varies in the signatures. This invalidated the PyCFunction flag usage. Instead, we now compute that info directly from abstractmetalang.cpp which has access to the correct info. Fixes: PYSIDE-1328 Change-Id: I6ba7237efcc486de014184b1787d05d87bee5a5e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QQmlComponent: allow thread in constructorsCristian Maureira-Fredes2020-08-171-0/+6
| | | | | | | | | | | | | | The constructor of QQmlComponent uses qml threads, and their usage was producing a deadlock when using along Python classes for a urlInterceptor, mainly related to the 'allow-thread' story that we need to take care of. Since the QQmlComponent required threads, we enable all the constructors to allow them to avoid a deadlock. Fixes: PYSIDE-1349 Change-Id: I86cb97b011f483cc4142bed6fae1ea525fa0db47 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add Qt3DExtras.QNormalDiffuseMapAlphaMaterialCristian Maureira-Fredes2020-08-172-0/+2
| | | | | | | Fixes: PYSIDE-1355 Change-Id: I27a31bd2efd685f9cd3ac4dc780ab4fa7f7f5720 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: warn if the signature module fails to initializeChristian Tismer2020-08-071-1/+15
| | | | | | | | | | | There are setup errors that fail to initialize the signature module correctly. This is for instance possible if packaging puts the shiboken2 module somewhere into the path, but the binary cannot be reached, because shiboken2 also exists as a dictionary. Task-number: PYSIDE-1352 Change-Id: I679d6855c87093b946cfbaeb063c10d45b00c8ad Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* feature-select: optimize feature access to the feasible maximumChristian Tismer2020-07-312-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ** 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>
* Brush up the code related to custom widgets in the QUiLoader moduleFriedemann Kleint2020-07-211-15/+17
| | | | | | | | | | | | | | | - Modernize, use override, nullptr - Fix include conventions - Remove *Private structs. They don't make sense in a static plugin. - Add some explanatory comments - Add missing initializations of members - Most importantly: add error handling to PyCustomWidget::createWidget(), which so far would swallow all errors encountered when executing the Widget's __init__ function. Change-Id: I100a4239013f959c8fb0b0adc0d3a99f73bd4bff Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Re-add support for parsing Q_PROPERTYFriedemann Kleint2020-07-131-0/+7
| | | | | | | | | | | Following how qdoc does it, define Q_PROPERTY as a static assert with the stringified macro content in a ','-operator and parse it with clang. Task-number: PYSIDE-1019 Change-Id: Idcf53f1cd1c1cb29f4320444f446e9abad33d251 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* QByteArray::number(): Remove non-existent exclusions of number()Friedemann Kleint2020-07-061-3/+0
| | | | | | | | | | | Fixes an oversight of 157e03911ba0e2e8fd74899702588296693fd4ab, causing: typesystem_core_common.xml:1792: signature 'number(ushort,int)' for function modification in 'QByteArray' not found. typesystem_core_common.xml:1792: signature 'number(float,char,int)' for function modification in 'QByteArray' not found. typesystem_core_common.xml:1792: signature 'number(short,int)' for function modification in 'QByteArray' not found. Task-number: PYSIDE-904 Change-Id: I31b22d12235398400bc7e7a01dd9520a45538446 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QByteArray::number(): suppress small integer types as is for setNum()Friedemann Kleint2020-07-031-1/+7
| | | | | | | | Otherwise, overflow errors can occur. Task-number: PYSIDE-904 Change-Id: I42486a27bcdb8e7562d411b4519d2e61f315be1d Reviewed-by: Christian Tismer <tismer@stackless.com>
* CMake: Use the portable Qt feature propertiesFriedemann Kleint2020-06-303-4/+5
| | | | | | Task-number: PYSIDE-904 Change-Id: I15ebd4057c52c78d584de7c34e74ebb858cb0011 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Indicate limited API builds in QLibraryInfo::build()Friedemann Kleint2020-06-292-0/+13
| | | | | Change-Id: I55fe70da8adf6faba0f8099d4d127ae3963fa2c6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add QObject.findChildren(QRegularExpression)Friedemann Kleint2020-06-262-9/+15
| | | | | | | | | 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-262-1/+35
|\ | | | | | | Change-Id: I75984f35bcdeeeb3b6004a00670f1582ab522c1b
| * pthreads: Try to abandon the GIL in case a thread was terminatedFriedemann Kleint2020-06-262-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | PySide2: Add QByteArray::FromBase64ResultFriedemann Kleint2020-06-232-0/+8
| | | | | | | | | | Change-Id: I348bb01c52482059b6f6bfebcc1d15fb68b9b142 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | PySide2: Reject internal namespaces of QtFriedemann Kleint2020-06-234-0/+14
| | | | | | | | | | Change-Id: I0ef48ed4300037edcd357e167b6738d04ef5aaa4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | PySide2/Qt 6: Fix warning about redefinition of QT_ANNOTATE_ACCESS_SPECIFIERFriedemann Kleint2020-06-221-3/+3
| | | | | | | | | | | | | | | | Move QT_ANNOTATE_ACCESS_SPECIFIER before first Qt include. Task-number: PYSIDE-904 Change-Id: I82b12a79174fad93e0c7ea260e5111b997c60995 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | 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-152-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix crashes in QThread::wait(), QWaitCondition::wait()Friedemann Kleint2020-06-151-0/+3
| | | | | | | | | | | | | | | | Add allow-thread for the newly added overloads in 5.15 Fixes: PYSIDE-1332 Change-Id: I1e463203ea9914ae71991262745d803fc9001b7d Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-06-111-0/+3
|\| | | | | | | Change-Id: I6cf604e1ae7234ce4f0d99169e9269a7dde07a4a
| * Potential fix for deploying with cx_freeze using zip_include_packagesFriedemann Kleint2020-06-051-0/+3
| | | | | | | | | | | | | | | | | | In __init.py__, check for a zip archive and do not add DLL paths relative to it. Amends d9cfec8e010b48036e5e879ccc99879538a4f7d2. Change-Id: I18320bd6a8f784f20287c4a5ed65e9229989031c Fixes: PYSIDE-1257 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Add QSocketDescriptor classCristian Maureira-Fredes2020-06-053-0/+12
| | | | | | | | | | | | | | | | | | | | 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>
* | PySide2: Add QRegularExpressionValidatorFriedemann Kleint2020-06-052-0/+2
| | | | | | | | | | | | | | It replaces the deprecated QRegExpValidator. Change-Id: I18833a3f83bdaf2e72d05c529d846aa07582884c Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Doc: Document QtUiTools.loadUiType functionVenugopal Shivashankar2020-05-281-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | Removing the old inject-documentation approach from the typesystem, since the function lives in the module but does not belong to any class. Also some changes to the text were done, since there was a wrong statement regarding the PATH of uic. Change-Id: I7c8bf088f58ff9b6731ba66283ee384f6526c64b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Add QtQuickControls2Cristian Maureira-Fredes2020-05-262-0/+88
| | | | | | | | | | | | | | | | | | This exposes the C++ class QQuickStyle Task-number: PYSIDE-487 Change-Id: I5776421070362d8b3bf9556eb28a410de3c90948 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-05-266-10/+194
|\| | | | | | | Change-Id: I9c7163094bc934f481002adcea78ef4928ed26be
| * Add QtUiTools.loadUiTypeCristian Maureira-Fredes2020-05-252-0/+174
| | | | | | | | | | | | | | | | | | | | | | | | 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-182-2/+18
| | | | | | | | | | | | | | | | Ensure it is 64bit for 64bit systems. Change-Id: I0b4d54f2568bd70288e184a5a2d8f31532fed157 Fixes: PYSIDE-1303 Reviewed-by: Christian Tismer <tismer@stackless.com>