aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
Commit message (Collapse)AuthorAgeFilesLines
* Add QObject.findChildren(QRegularExpression)Friedemann Kleint2020-06-263-11/+20
| | | | | | | | | 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-262-5/+5
| | | | | | | | | 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>
* | Further build fixes for Qt 6Friedemann Kleint2020-06-222-0/+7
| | | | | | | | | | Change-Id: I2463997f1eb2012cbbd0192a019ca57beaf55d5b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | libpyside: Port away from deprecated QRegExpFriedemann Kleint2020-06-221-8/+10
| | | | | | | | | | | | Task-number: PYSIDE-904 Change-Id: I0280de35578f72ab4616170115c5afed9d6d7488 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Friedemann Kleint2020-06-191-4/+7
|\ \
| * | 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>
* | | doc: Add widget styling tutorialCristian Maureira-Fredes2020-06-198-0/+288
|/ / | | | | | | | | | | | | | | | | | | Usage of the 'setStyleSheet' function and loading '.qss' files. Task-number: PYSIDE-841 Change-Id: I905025488c75cf379c7d77427da93d217169c604 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Implement the QEnum/QFlag decorator, V2Christian Tismer2020-06-1511-19/+599
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-112-1/+3
|\| | | | | | | Change-Id: I6cf604e1ae7234ce4f0d99169e9269a7dde07a4a
| * Fix leaking reference in PySide2 property getterFriedemann Kleint2020-06-091-1/+0
| | | | | | | | | | | | | | | | | | Remove Py_INCREF on result obtained from PyObject_CallObject() in getValue(PySideProperty*,*source). Change-Id: Ic070df29be0fd0eadcd37bc0210339205f957c8f Fixes: PYSIDE-1321 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * 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>
* | Fix some leaks in enumeration creationFriedemann Kleint2020-06-081-7/+7
| | | | | | | | | | | | | | | | Create the PyType_Spec on the stack. Task-number: PYSIDE-1321 Change-Id: Ie340dffe1915f99f81caec74432cff9359764001 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Clean the build/install output a bitCristián Maureira-Fredes2020-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Adding STATUS or WARNING to a couple of message() calls. * Replacing some print() by log.info() * Changing some '*' by '-' * Align configuration outputs to check paths easily * Adding big message to check when shiboken2/pyside2 is being built. * Including the cmake_minimum_required() function instead of an 'if'. Change-Id: Idb6c5797286d400192d083403063e2ae582e3fe6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Doc: Add import statement for QIODeviceNico Vertriest2020-06-051-1/+1
| | | | | | | | | | | | Task-number: QTBUG-84270 Change-Id: If196369012fa740b90293ede2f7b2740657fbec9 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@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: Fix a typo and a broken linkVenugopal Shivashankar2020-06-041-2/+2
| | | | | | | | | | Change-Id: Ic3515aea317d4b8e2d0286b60a5c3b68bd20bbdf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Doc: Enable doc builds using the offline templateVenugopal Shivashankar2020-06-0414-40/+2156
| | | | | | | | | | | | | | | | | | | | A new command-line option, --doc-build-online, enables to choose online builds, otherwise offline docs are built by default. Change-Id: I34ef8a22ef3bd321bd972c4f2873e4321c9c336a Fixes: PYSIDE-1292 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | docs: fix item list in tutorial/expensesCristian Maureira-Fredes2020-06-031-6/+6
| | | | | | | | | | Change-Id: I0f8d6784cfc567ac3a502df52e26413abec92a59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Doc: Fix typo in the module pageVenugopal Shivashankar2020-06-021-1/+1
| | | | | | | | | | Change-Id: Icc09814ca6f8c08b6903f2b00fdd95812cfcd54a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Doc: Document QtUiTools.loadUiType functionVenugopal Shivashankar2020-05-282-25/+36
| | | | | | | | | | | | | | | | | | | | | | | | 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-263-0/+89
| | | | | | | | | | | | | | | | | | 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>
* | QtSerialPort improved unit testsAndreas Buhr2020-05-261-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | Support for QtSerialPort was added to PySide2 recently. However, only very few unit tests were added at that time. This change replicates a part of the C++ unit tests of QtSerialPort in PySide/Python. Change-Id: I7e7a1ee7a521b952a6c0860cd8cceacb3b0b7e57 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-05-2612-20/+336
|\| | | | | | | Change-Id: I9c7163094bc934f481002adcea78ef4928ed26be
| * Add QtUiTools.loadUiTypeCristian Maureira-Fredes2020-05-253-0/+249
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sbkenum: Fix refcounting leakChristian Tismer2020-05-182-5/+17
| | | | | | | | | | | | | | | | | | | | | | sbkenum had a wrong deallocator and some other errors. Found while developing pickling on enums. At the same time, a wrong Python 3.8 condition was removed. There are currently no additional bugs in Python 2.7, 3.7 and 3.8. Change-Id: I4abccf3b84a3738bba7781ea3dfd00e98ae63ea1 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Support pickling of Qt Enum objectsChristian Tismer2020-05-181-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pickling for types exists in most cases. Pickling of Qt Enum objects works fine. Pickling of Qt Enum types is supported, but does not work because the builtin type pickling intercepts and then fails.. This problem is now solved because PySide supports now __qualname__. So pickling of nested types works now without any extra code in Python 3. Python 2 is not supported since it would require too strange patches to Python itself. Fixes: PYSIDE-15 Task-number: PYSIDE-1286 Change-Id: I346bde07a63afcf2555a3324fcca04efe25e704a 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>
| * Implement __qualname__ and correct __module__ for classesChristian Tismer2020-05-165-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PyType_FromSpec breaks the name "A.B.C.D" in module "A.B.C" and name = qualname = "D". We fix that for PySide: module = "A.B" qualname = "C.D" name = "D" and for other prefixes like Shiboken: module = "A" qualname = "B.C.D" name = "D" This had quite some impact on the signature modules. Change-Id: Ie94971ba737107b15adbfc2517e1ed32b65fda39 Fixes: PYSIDE-1286 Task-number: PYSIDE-15 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Rename pre_release_version_type to release_version_typeSimo Fält2020-05-251-2/+2
| | | | | | | | | | | | | | | | Renaming pre_release_version_type to release_version_type to match its future usage to differentiate between wheel/package types. Change-Id: I70a2361f639a36b17f63b7f76d8c231a144bd825 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Rename and update some snippetsCristian Maureira-Fredes2020-05-2523-774/+984
| | | | | | | | | | | | | | | | | | | | | | | | | | * Renaming a few .cpp files into .py * Replacing the use of SIGNAL() and SLOT() * Fixing Python syntax * Removing C++-isms from translated Python code * Including the snippets from QStackedLayout Task-number: PYSIDE-691 Fixes: PYSIDE-1309 Change-Id: I431be3d930b2adc36a22118901baa6799581adb2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | doc: add tutorial for using qrc filesCristian Maureira-Fredes2020-05-2211-2/+172
| | | | | | | | | | | | | | | | | | We currently have only a tutorial for .ui files, and the .qrc case was missing. Task-number: PYSIDE-841 Change-Id: Ic12e8e77cb1ee042bc118fab74c97b3f6ba54ff4 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | PySide2: Prepare for Qt 6Friedemann Kleint2020-05-192-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | pyside2: Prepare build system for Qt 6Friedemann Kleint2020-05-1858-388/+444
| | | | | | | | | | | | | | | | | | | | | | - Introduce a version variable to the CMakeLists. - Emulate the Qt5Core_INCLUDE_DIRS, Qt5Core_LIBRARIES variables by retrieving them from the INTERFACE - Raise the language level Task-number: PYSIDE-904 Change-Id: Ie4e43e7e6a9a2631d666038b80f306e2d9af47b1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | doc: add more videos from Qt eventsCristian Maureira-Fredes2020-05-171-1/+66
| | | | | | | | | | | | Task-number: PYSIDE-841 Change-Id: I1d64fe659a7651a4da2f537368d19d731d5c1e54 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add support for QSerialPortAndreas Buhr2020-05-154-0/+146
| | | | | | | | | | | | | | | | | | | | | | QSerialPort is part of Qt since Qt 5.1. PySide2 so far had no support for QSerialPort. At the same time, QSerialPort was not listed as unsupported. Task-number: PYSIDE-487 Change-Id: I88d4282a206dadf6f398c3f0e5740f02641724b6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-05-158-32/+28
|\| | | | | | | Change-Id: I302699433b1a9d11b5134b43703a775556bbee14
| * shiboken: Prepare for introduction of __qualname__Christian Tismer2020-05-148-32/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | To remove the groundwork from the next checkin, the step of replacing PyType_FromSpec with SbkType_FromSpec is extracted. This change introduces a packageLevel number that is generated as a name prefix in the class creation but does not use it, yet. Change-Id: Ic9061231708b546dbd3620d148bca24c27df60a5 Task-number: PYSIDE-1286 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | libpyside: Remove deprecated APIFriedemann Kleint2020-05-139-243/+0
| | | | | | | | | | | | | | | | | | Remove deprecated functions and class DestroyListener, which had hard-coded Qt 5 specific meta object data. Task-number: PYSIDE-904 Change-Id: Idce86cd5df12dc918335f043c8d7a5f0a95db990 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-05-063-6/+22
|\| | | | | | | Change-Id: If256dd2b05ef2e31592cf50327ec9a2d6fb742bb
| * 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>
| * qareaseries: keep references of lower/upper seriesCristian Maureira-Fredes2020-05-041-1/+12
| | | | | | | | | | | | | | | | | | Increasing the refcount since otherwise the objects will be GCd. Fixes: PYSIDE-1285 Change-Id: I9bb03c64f6ba9385de4ee892ce370bb2f827d79e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * QMutexLocker allow-thread in constructorCristian Maureira-Fredes2020-04-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the improvement to the GIL treatment inside PySide to avoid UI freezing issues, many functions need an entry on the typesystem to allow thread explicitly, this was the case of the report, where a QMutexLocker was initialized. The initialization was done inside a QThread run method, so the lack of allow-thread was generating a deadlock. The nogil section of the code (from Cython) was not related to the issue, since replacing the content with any instruction produced the deadlock anyways. Fixes: PYSIDE-1271 Change-Id: Ib1fd1ebd923c3f9dc9ae390228bcf40b5b878019 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>