aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.14.2"Friedemann Kleint2020-04-1727-108/+425
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.14.2Friedemann Kleint2020-04-1659-249/+968
| |\| | | | | | | | | | Change-Id: I1c48ecc24ff07e760415cea1d7ed512a99c838a1
| | * doc: fix error in shiboken getting startedCristian Maureira-Fredes2020-04-121-2/+2
| | | | | | | | | | | | | | | | | | Fixes: PYSIDE-1266 Change-Id: Ia0aafb1f0e91b5baf070c018d4583e64f2c92f8c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * shiboken: Fix race condition with unprotected Py_INCREFsChristian Tismer2020-04-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signalmanager module contains a PyObjectWrapper object into which PySide::SignalManager::qt_metacall calls via many hard-to-track indirections. Finding this problem was quite tricky. It was done by modifying the Py_INCREF and Py_DECREF macros of a debug Python interpreter and using the new PyGILState_Check function to provoke a crash if the GIL was not held. See the online documentation for details. Change-Id: Ida8246c97dcf6443ff057d206a42d22e462f1913 Fixes: PYSIDE-813 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Fix alloc-dealloc-mismatch in MetaObjectBuilderMilian Wolff2020-04-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMetaObjectBuilder::toMetaObject uses malloc to allocate the space for the returned QMetaObject. As such, we need to use free instead of delete, otherwise ASAN will report an error: ``` 39: ==1537629==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x61200006cf40 39: #0 0x7f7952f00960 in operator delete(void*) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:165 39: #1 0x7f7930c4d8d4 in void qDeleteAll<__gnu_cxx::__normal_iterator<QMetaObject const* const*, std::vector<QMetaObject const*, std::allocator<QMetaObject const*> > > >(__gnu_cxx::__normal_iterator<QMetaObject const* const*, std::vector<QMetaObject const*, std::allocator<QMetaObject const*> > >, __gnu_cxx::__normal_iterator<QMetaObject const* const*, std::vector<QMetaObject const*, std::allocator<QMetaObject const*> > >) /usr/include/qt/QtCore/qalgorithms.h:320 39: #2 0x7f7930c4cf98 in void qDeleteAll<std::vector<QMetaObject const*, std::allocator<QMetaObject const*> > >(std::vector<QMetaObject const*, std::allocator<QMetaObject const*> > const&) /usr/include/qt/QtCore/qalgorithms.h:328 39: #3 0x7f7930c4a847 in PySide::MetaObjectBuilder::~MetaObjectBuilder() ../3rdParty/PySide2/sources/pyside2/libpyside/dynamicqmetaobject.cpp:143 39: #4 0x7f7930c54c8f in PySide::GlobalReceiverV2::~GlobalReceiverV2() ../3rdParty/PySide2/sources/pyside2/libpyside/globalreceiverv2.cpp:208 39: #5 0x7f7930c54ccf in PySide::GlobalReceiverV2::~GlobalReceiverV2() ../3rdParty/PySide2/sources/pyside2/libpyside/globalreceiverv2.cpp:223 39: #6 0x7f7930c54f63 in PySide::GlobalReceiverV2::decRef(QObject const*) ../3rdParty/PySide2/sources/pyside2/libpyside/globalreceiverv2.cpp:271 39: #7 0x7f7930c553fc in PySide::GlobalReceiverV2::qt_metacall(QMetaObject::Call, int, void**) ../3rdParty/PySide2/sources/pyside2/libpyside/globalreceiverv2.cpp:338 39: #8 0x7f7941d2e251 (/usr/lib/libQt5Core.so.5+0x2db251) 39: #9 0x7f7941d28bef in QObject::destroyed(QObject*) (/usr/lib/libQt5Core.so.5+0x2d5bef) 39: #10 0x7f7941d2c8d6 in QObject::~QObject() (/usr/lib/libQt5Core.so.5+0x2d98d6) 39: 39: 0x61200006cf40 is located 0 bytes inside of 264-byte region [0x61200006cf40,0x61200006d048) 39: allocated by thread T0 here: 39: #0 0x7f7952efdd48 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:153 39: #1 0x7f7941d1d742 in QMetaObjectBuilder::toMetaObject() const (/usr/lib/libQt5Core.so.5+0x2ca742) 39: #2 0x7f7930c4bb88 in PySide::MetaObjectBuilder::update() ../3rdParty/PySide2/sources/pyside2/libpyside/dynamicqmetaobject.cpp:425 39: #3 0x7f7930c54a85 in PySide::GlobalReceiverV2::GlobalReceiverV2(_object*, QSharedPointer<QMap<QByteArray, PySide::GlobalReceiverV2*> >) ../3rdParty/PySide2/sources/pyside2/libpyside/globalreceiverv2.cpp:195 39: #4 0x7f7930c50a70 in PySide::SignalManager::globalReceiver(QObject*, _object*) ../3rdParty/PySide2/sources/pyside2/libpyside/signalmanager.cpp:313 39: #5 0x7f792ec3b257 in getReceiver 3rdParty/PySide2/sources/pyside2/PySide2/QtCore/PySide2/QtCore/qobject_wrapper.cpp:155 39: #6 0x7f792ec3b67f in qobjectConnectCallback 3rdParty/PySide2/sources/pyside2/PySide2/QtCore/PySide2/QtCore/qobject_wrapper.cpp:205 39: #7 0x7f792ec3e5b9 in Sbk_QObjectFunc_connect 3rdParty/PySide2/sources/pyside2/PySide2/QtCore/PySide2/QtCore/qobject_wrapper.cpp:944 39: #8 0x7f7943a66250 in PyObject_Call (/usr/lib/libpython3.8.so.1.0+0x13c250) ``` Change-Id: I8c5a745fab9785425c0844129731c7c8a17b8d21 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Relax the build_scripts for macOS and designerChristian Tismer2020-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The build_scripts are able to build Designer, optionally. For macOS, the optional status was forgotten. Instead of always patching the build_scripts, I finally fixed that buglet ;-) Change-Id: Iaa62e27253ec7035f0eebde17f0f2b8c4593be67 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * pep384impl.cpp: Make the implementation more statelessChristian Tismer2020-04-061-36/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pep384impl.h part is quite readable and stateless concerning the state of Py_LIMITED_API. The pep384impl.cpp part is stateful, which means there is no clear separation between parts of the implementation. This had led to unnecessary confusion in the past. To avoid that in future, the #ifdef status of Py_LIMITED_API will no longer be carried over multiple sections. Also, checks which are for the limited API only are no longer executed by default. Further, PyDict_GetItem is replaced by PyDict_GetItemWithError, where we do not expect a real error. Change-Id: Ia51e551216c76f82b701ebc45c40e2d1412cabf5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| | * Revert "shiboken: Add XML attribute to turn off method caching"Friedemann Kleint2020-04-065-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fcbbab0a6b5949b5c3726214ed87898b5fbcebcc. This is no longer required after a fix generating the property code into the setattro methods of QObject-derived classes. Task-number: PYSIDE-803 Task-number: PYSIDE-1255 Change-Id: I9e989c0592eaaf25aa55a1db49537daa4bdb2a57 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * ci: pin numpy version for Python 2.7Cristian Maureira-Fredes2020-04-061-1/+2
| | | | | | | | | | | | | | | | | | | | | Numpy 1.16.6 was the last version that supports Python 2.7 Change-Id: I43f401a6da350b874b2b25114fdc6d9fd07f69ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * shiboken: Support Clang version 10Friedemann Kleint2020-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adapt the version check of the internal include directory to parse the entire directory (typically named like 9.0.0) as version number instead of just checking the first digit. Change-Id: I7e09c36fd523328e962c7f2acbc8385787e94998 Fixes: PYSIDE-1259 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| | * shiboken: Fix Qt properties not working in classes inheriting QObjectFriedemann Kleint2020-04-053-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fixes for PYSIDE-803 caused setattro methods to be generated for many classes, resulting in QObject's setattro method no longer being called. Generate property code in each class inheriting QObject. Task-number: PYSIDE-803 Fixes: PYSIDE-1255 Change-Id: I56f52fb43c4ddc77914090ac122776050354ddbe Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * PySide2: Fix lockups in QMetaObject.invokeMethod with BlockingQueuedConnectionFriedemann Kleint2020-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add allow-thread. Change-Id: I7feba9761a52c273cf4500a42dfbea0463d6040f Fixes: PYSIDE-1253 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Adapt UI files tutorial to newly added UiLoader exampleFriedemann Kleint2020-04-031-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | Amends cf8e0d98821cc7e6f0fc48b56a0a16ad88cd881b. Task-number: PYSIDE-841 Change-Id: Iea6ab04e2ce8c4fb77d7d5c770dc45005f2635dc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| | * shiboken: Fix dict access without GILChristian Tismer2020-04-025-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In PYSIDE-803 we used an optimization that accessed a dictionary without holding the GIL. This turned out to be not correct, because PyDict_GetItem works with thread state to maintain the global error variables. PyDict_GetItemWithErrors can be used instead in a way that allows releasing the GIL. Task-number: PYSIDE-803 Task-number: PYSIDE-813 Change-Id: Ifb0cbb20c21ca9c8b3d099fff1db5410eb6824b4 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * shiboken: Update sbkstring to use PyUnicode_GetLength rev. 2Christian Tismer2020-03-311-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Minor edits. Augments d77a90d4ef30d311dea39a7f4c3399e4363cc1b7 Task-number: PYSIDE-813 Change-Id: I3a24b1f49a22f4681d2c4e2457cda7110bd7b4f1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * shiboken: Update sbkstring to use PyUnicode_GetLengthChristian Tismer2020-03-307-14/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * Refine pep384impl.cpp a bitChristian Tismer2020-03-303-37/+39
| | | | | | | | | | | | | | | | | | | | | | | | This patch replaces NULL with nullptr, replaces type casts and simplifies a helper function further to avoid string creation. Change-Id: If06cf739eef5836e615e4ff9beb1bca40c791f9e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Add an example for QUiLoaderFriedemann Kleint2020-03-301-0/+71
| | | | | | | | | | | | | | | | | | Task-number: PYSIDE-841 Change-Id: I3aae15ae88f94f62eb7e11dd9942834ef92c55ad Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * doc: add clarification to examples pageCristian Maureira-Fredes2020-03-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New users are getting confused by the phrasing of the page, and believe we only have two examples in our codebase. Adding a paragraph to clarify this situation will solve the misconception. Change-Id: I2a18d99771eee82af3181a997c137109840edbec Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge branch '5.14' into 5.14.2v5.14.2Cristian Maureira-Fredes2020-03-3029-137/+539
|\ \ \ | | |/ | |/| | | | Change-Id: I3f76bc2b1d401d901d6ac5bc74874b0894bf3df9
| * | Update changelog for 5.14.2Cristian Maureira-Fredes2020-03-291-7/+21
| | | | | | | | | | | | | | | Change-Id: Id1eddc70d95b12299678ab08b7de6b4fb9fc0fea Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | Pin setuptools to v44 for Python 2Cristian Maureira-Fredes2020-03-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | setuptools v45 removed support for Python 2, so this will unlock the current 5.15 CI status. Change-Id: I87fce4d80ca656412aa5682c07f8b453bac430d1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | Remove qApp import from chartthemes examplesCristian Maureira-Fredes2020-03-261-1/+1
| | | | | | | | | | | | | | | Change-Id: I3edb414046dc46c5f55c6b3a9980644ba2d0235a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | Add doc getter for PropertyCristián Maureira-Fredes2020-03-251-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to access the doc attribute from Properties when set: >>> p = Property(int, doc="some doc") >>> p.__doc__ some doc >>> p = Property(int) >>> p.__doc__ None Fixes: PYSIDE-135 Change-Id: Idf3e6c6632c775a50cfc8ecf03de3d2dc485f9f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * | 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-253-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | TabbedBrowser example: Fix most flake8 warningsFriedemann Kleint2020-03-247-77/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix indentation, shorten lines where possible. Fix documentation URL. Amends 90c1c767095e583d0315e87c0592597020858246. Change-Id: I9b61cb27c7c336b706b418d4cd1ed1d3b80c7be3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * | Add functions with callback of QWebEnginePageFriedemann Kleint2020-03-244-8/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | shiboken: Enable flags types in added functionsFriedemann Kleint2020-03-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a search for flags entries to translateType(AddedFunction::TypeInfo). Task-number: PYSIDE-946 Task-number: PYSIDE-1241 Change-Id: I8f0092ad2dd546fdf8678864e49ad2940e7bb8dc Reviewed-by: Christian Tismer <tismer@stackless.com>
| * | shiboken: Improve error messages about invalid types of added functionsFriedemann Kleint2020-03-234-25/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change translateType() to pass up the error instead of aborting so that the error is printed in traverseFunction() along with the name. The abort in case of failure will then occur in fillAddedFunctions(). Task-number: PYSIDE-946 Task-number: PYSIDE-1241 Change-Id: Iee9ca478b28c8f82d9c4b6c5165f3028bf1e0d08 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * | Improve wheel_tester script a bitChristian Tismer2020-03-201-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wheel_tester forces installation of "shiboken2_generator". This is not needed for compile_using_pyinstaller, but building modules with cmake. This was not clear. In effect, just the log messages were made a bit more verbose and a clarifying comment was added. Change-Id: I7d7d9ce1e9911461d087d685ab5c1cb66c94aa27 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | shiboken: Fix classes with virtual destructors not being considered polymorphicFriedemann Kleint2020-03-204-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the polymorphic attribute was set in AbstractMetaClass::addFunction() depending on hasVirtualDestructor(). This does not work when the destructor is the last function traversed. Modify setHasVirtualDestructor() to set the hasVirtuals and polymorphic attributes, too. Fixes: PYSIDE-1246 Change-Id: If7b32a05110f96b5c4befde5f1d37475c9a5f240 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * | Avoid a signature warning in Python 3.6Christian Tismer2020-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regular expressions which can evaluate to an empty string result in a warning in Python 3.6 if you try to re.split() on that pattern. The generated pattern for the signature parser was enhanced to avoid the unintended empty pattern. This change was not very large, actually only a single bit (but the right one). :-) >>> bin(ord("*")) '0b101010' >>> bin(ord("+")) '0b101011' Change-Id: I15ba6ef6f108c51afba59b4004261bede26c4a74 Fixes: PYSIDE-1247 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * | Examples: Remove qApp importFriedemann Kleint2020-03-166-6/+6
| |/ | | | | | | | | | | | | | | | | Amends 5d34d60418b15d4d6837d0a1333f2b57631309eb, d579912b31d7cfa7b0b216916fbbf3eb632a9d9d. Task-number: PYSIDE-571 Change-Id: I214d7bf1770667eaa9abaea0f96b5e507b4c32f7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Cleanup version string for 5.14.2 releaseSimo Fält2020-03-232-4/+4
| | | | | | | | | | Change-Id: I06edd224896ef82fe20480469a67e34b49045333 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Examples: Remove qApp importFriedemann Kleint2020-03-166-6/+6
|/ | | | | | | | | | | Amends 5d34d60418b15d4d6837d0a1333f2b57631309eb, d579912b31d7cfa7b0b216916fbbf3eb632a9d9d. Task-number: PYSIDE-571 Change-Id: I214d7bf1770667eaa9abaea0f96b5e507b4c32f7 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit cf059117c3926081bee79d9223017147613649a4) Reviewed-by: Simo Fält <simo.falt@qt.io>
* Add 5.14.2 changelogFriedemann Kleint2020-03-131-0/+52
| | | | | Change-Id: I74212eeaf28285beb3a6bb1ea34b80129d4725e7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Change the default of allow-thread to falseCristián Maureira-Fredes2020-03-133-7/+10
| | | | | | | | | | | | | | | | | | | | This process introduced many unnecessary calls to the Py_BEGIN/END_ALLOW_THREAD macro to PySide, which had a negative impact on the overall behavior when studying the responsiveness of UIs with threads. Some tests were adapted to include the new allow-thread behavior. [ChangeLog][shiboken] The default of the "allow-thread" attribute has been changed to false as it was observed to cause performance issues when using threads. Task-number: PYSIDE-803 Change-Id: I2cd67c86340f7bf7a2c5694869d17fe2027a0abb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Adjust the allow-thread behaviorCristián Maureira-Fredes2020-03-139-118/+122
| | | | | | | | | | | | | | | | | 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>
* dumpcodemodel: Qualify function argumentsFriedemann Kleint2020-03-092-1/+30
| | | | | | | | Amends d1604053e9ae354963a2b2447b3d196fc5dda73e. Task-number: PYSIDE-1240 Change-Id: I27882de3077fcd11fc98b10b8ddbd469990b77c4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Avoid the GIL in SignalManager::retrieveMetaObjectChristian Tismer2020-03-092-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After massive GIL savings in the generated code, there still exists a place where a lot of repeated GIL acquirements are done. It was observed that up to 24 consecutive calls to retrieveMetaObject(self) were made, all with the same value for 'self'. The code in question was: (1) Shiboken::GilState gil; (2) MetaObjectBuilder *builder = metaBuilderFromDict( \ reinterpret_cast<SbkObject *>(self)->ob_dict); (3) if (!builder) (4) builder = &(retrieveTypeUserData(self)->mo); (5) (6) return builder->update(); An exact analysis of the code showed that the GIL usage (1) could be moved out of the function into a deeper function that does updates in a branch (6). Function retrieveTypeUserData does not involve the Python interpreter at all (4). It took some time until it was proven that access to some special Python dictionary cannot reach the Python interpreter and therefore does not need the GIL as well (2). This replaces the abandoned effort to write a "Lazy GIL". It worked great for the example program, but had problems with some never finishing tests. After all, this solution is much simpler and works perfectly well. More effort seems not to be necessary to handle the GIL. Task-number: PYSIDE-803 Change-Id: I439009ff933fc6f498beb0c7f1523b6f985afda8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add QDeadlineTimerFriedemann Kleint2020-03-062-0/+5
| | | | | | | | | | | | | The class will replace timeout parameters in Qt 5.15 as introduced by qtbase/72f57cc84244633ca69ede9a1fd510b9b1881c1d, causing warnings like: Stripping argument #1 of bool QThread::wait(QDeadlineTimer) due to unmatched type "QDeadlineTimer" with default expression "QDeadlineTimer(QDeadlineTimer::Forever)". Stripping argument #2 of bool QWaitCondition::wait(QMutex*,QDeadlineTimer) due to unmatched type "QDeadlineTimer" with default expression "QDeadlineTimer(QDeadlineTimer::Forever)". Stripping argument #2 of bool QWaitCondition::wait(QReadWriteLock*,QDeadlineTimer) due to unmatched type "QDeadlineTimer" with default expression "QDeadlineTimer(QDeadlineTimer::Forever)". Change-Id: I51655ef19d8276b95c2a759d5ba44287a4b6d91b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Change the dumpcodemodel tool to output typesystem XMLFriedemann Kleint2020-03-053-11/+148
| | | | | | | | Make the previously existing debug output an option and output typesystem XML by default. Change-Id: I3d95bdb56446097377880e1ca0b54d3b8b93ea24 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add Python to Qt/C++ conversion toolFriedemann Kleint2020-03-059-0/+1201
| | | | | Change-Id: I275e776248bd55c3c38f5fedd83088bf475a1cf9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Accept EnumMeta as a valid Signal typeCristián Maureira-Fredes2020-03-043-1/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | Including a check for Python EnumMeta types to not consider them as a normal PySequence allows the decision to use the default PyObject wrapper case. Using the 'object' type is currently the workaround, so this allow the users to use the Enum class instead of declaring the signal with 'object'. class A(Enum): a = 1 b = 1 # Workaround # signal = Signal(object) # With this patch signal = Signal(A) A test case was added. Fixes: PYSIDE-239 Change-Id: Ib593dba5a988eceb8b1bfae097768e9ec02be6d5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix running scriptableapplication in a virtualenv on Windows with Python 3.8Friedemann Kleint2020-03-041-4/+20
| | | | | | | | | | As of Python 3.8, Python is no longer is able to run stand-alone in a virtualenv due to missing libraries. Add the path to the modules instead. Task-number: PYSIDE-1236 Change-Id: I4ef1f02925d11900d35cc4e5fcc9f50a5e123c2f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* changelog-tool: Add handling of actual changelog entriesFriedemann Kleint2020-03-031-21/+61
| | | | | | | | | | | Scan the commit messages for entries like [ChangeLog][shiboken2] description... and prepend them to the task list. Change-Id: I4cc8599eefb18c0b2c1892b8f23682b15815d1ec Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix deprecation warnings about Qt::SplitBehaviorFriedemann Kleint2020-03-033-6/+6
| | | | | | | | | | | | sources/shiboken2/generator/shiboken2/cppgenerator.cpp:1480:95: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:1483:96: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:1931:95: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:5774:110: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/main.cpp:373:67: warning: 'QStringList QString::split(QChar, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:99:88: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] Change-Id: Iadddcc74679a71ebf803b6a2942d9a50dbeeb05e Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Add XML attribute to turn off method cachingFriedemann Kleint2020-03-034-2/+12
| | | | | | Task-number: PYSIDE-803 Change-Id: I0ba80cea5804e1b83cc55ee32163ca9d021ccd26 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Avoid the GIL in non-overridden MethodsChristian Tismer2020-03-036-18/+109
| | | | | | | | | | | | | | | | | | | | | | In order to get better performance, we try to avoid allocating the GIL when methods have no override with a Python function. Every class gets an associated bool array that records functions where no override was found. On second call of a function, the GIL is avoided by this flag. Update 2020-02-06: The result is very promising when combined with a drastic reduction of Py_(BEGIN|END)_ALLOW_THREAD macro calls. So this could become the solution when combined with a good reduction! The Python 2 bug was circumvented by not generating the additional Py_tp_setattro functions for class QQuickItem. Task-number: PYSIDE-803 Change-Id: I0fe36edc5610b2d51bbb05f1b7507beee5088c83 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>