aboutsummaryrefslogtreecommitdiffstats
path: root/sources
Commit message (Collapse)AuthorAgeFilesLines
...
* | Move and fix some snippetsFriedemann Kleint2018-02-198-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings: While handling <snippet> in PySide2.QtQuick.QQuickImageProvider, line 20: Falling back to ".../qtdeclarative/examples/quick/imageprovider/imageprovider-example.qml" for "imageprovider/imageprovider-example.qml" [0] While handling <snippet> in PySide2.QtQuick.QQuickImageProvider, line 23: Falling back to ".../qtdeclarative/examples/quick/imageprovider/imageprovider.cpp" for "imageprovider/imageprovider.cpp" [0] While handling <snippet> in PySide2.QtQuick.QQuickImageProvider, line 25: Falling back to ".../qtdeclarative/examples/quick/imageprovider/imageprovider.cpp" for "imageprovider/imageprovider.cpp" [1] While handling <snippet> in PySide2.QtXml.QXmlSimpleReader, line 6: Falling back to ".../qtbase/src/xml/doc/snippets/simpleparse/main.cpp" for "simpleparse/main.cpp" [0] While handling <snippet> in PySide2.QtXml.QXmlSimpleReader, line 8: Falling back to ".../qtbase/src/xml/doc/snippets/simpleparse/main.cpp" for "simpleparse/main.cpp" [1] While handling <snippet> in PySide2.QtXml.QXmlSimpleReader, line 11: Falling back to ".../qtbase/src/xml/doc/snippets/simpleparse/main.cpp" for "simpleparse/main.cpp" [2] While handling <snippet> in PySide2.QtSvg.QSvgGenerator, line 5: Falling back to ".../qtsvg/examples/svg/svggenerator/window.cpp" for "svggenerator/window.cpp" [configure SVG generator] While handling <snippet> in PySide2.QtSvg.QSvgGenerator, line 8: Falling back to ".../qtsvg/examples/svg/svggenerator/window.cpp" for "svggenerator/window.cpp" [begin painting] While handling <snippet> in PySide2.QtSvg.QSvgGenerator, line 10: Falling back to ".../qtsvg/examples/svg/svggenerator/window.cpp" for "svggenerator/window.cpp" [end painting] While handling <snippet> in PySide2.QtSvg.QGraphicsSvgItem, line 8: Falling back to ".../qtsvg/src/svg/doc/snippets/src_svg_qgraphicssvgitem.cpp" for "src_svg_qgraphicssvgitem.cpp" [0] Task-number: PYSIDE-363 Change-Id: I32c73b2347e622e6594a017fde023d00bae864ec Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken/docgenerator: Handle empty snippetsFriedemann Kleint2018-02-151-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Empty snippets may actually be valid in case a single closing bracket in C++ is turned into an empty line in Python (customstyle.cpp[1]). Differentiate between those by using QString::isNull() for the fallback mechanism. Always output snippet identifier in messages. Amends 45f3126a04cd5493323b689c85a48106d0f8367e. Task-number: PYSIDE-363 Change-Id: I0391b18fafacbd4c57c4017adb08126a5e2c7c7e Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Initial fixes of the doc snippetsFriedemann Kleint2018-02-1519-48/+35
| | | | | | | | | | | | | | | | | | | | | | Fix some findings obtained by comparing to the corresponding C++ snippets. Task-number: PYSIDE-363 Change-Id: I41b8a0b12f322ea9c44d58f82cb9cd497413c9d8 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add condition to qmimedatabase_testCristian Maureira-Fredes2018-02-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An assert related to a Mimetype comment fails if the language is unset or is not English. Since this assert is not critical to the functionality of the module, we can remove it or add a simple condition to test it only when the system's language is English. The last one was applied. Task-number: PYSIDE-575 Change-Id: Ida85268e25522e406878dd6ac4e5e70852f8d8e4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken/docgenerator: Fall back to C++ snippet when Python snippet cannot ↵Friedemann Kleint2018-02-151-13/+70
| | | | | | | | | | | | | | | | | | | | be found Use the "path" attribute. Task-number: PYSIDE-363 Change-Id: I27adc86cfb58d20a90f411842c2f78de9dbe1a60 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Fix lost reference for item delegatesCristian Maureira-Fredes2018-02-143-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | After setting an item delegate for columns and rows in classes that inherit from QAbstractItemView (like QTreeView) the reference was not kept, causing a segfault. This was solved by keeping the reference of the object. A test is provided. Task-number: PYSIDE-226 Task-number: PYSIDE-219 Change-Id: I43eeb6e85a37537311d838f5abb0ee1ab10ea713 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Apply Qt guidelines to the injected code via XMLCristian Maureira-Fredes2018-02-143-139/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | There are many inconsistencies in the associated typesystem files that complement the binding generation, this is a first attempt to try to standardize it. Just Qt Coding Style were applied (when possible). In the future the process to access and manipulate Shiboken objects must also be standardized. Change-Id: Ida57d1630a893bc5b608f64119b4c8d638bb9c66 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix usage of PyCFunction_GET_FLAGS in pysidesignal.cppAlexandru Croitor2018-02-141-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using PyCFunction_GET_FLAGS is unsafe, because it does not check whether the argument given is actually a PyCFunction object. This macro needs to be replaced with the function equivalent PyCFunction_GetFlags for stable ABI patch, but this will cause a crash in PyCFunction_Call because we don't check the return value of PyCFunction_GetFlags to see if it fails. Rather than checking the return value, it is safe to preemptively add a PyCFunction_Check before calling the GetFlags function. This does not modify the logic behind signalCall function. The crashing test was homonymoussignalandmethod_test.py, so no new test is needed. Task-number: PYSIDE-593 Change-Id: Id9ac9c0dec454e8e1ce9516dc68af924372a34a9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Temporarily disable building of Qt3D for Qt >= 5.10Friedemann Kleint2018-02-131-1/+1
| | | | | | | | | | | | | | | | | | To be reverted once Qt3D/352dacc0040f77345ab2f6e9019ff68ba2ed354e reaches the dev branch. Task-number: PYSIDE-487 Change-Id: Ia17fb2ade605ba0d90c02511ffada58085178f45 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Rename code snippet for QValidator classesFriedemann Kleint2018-02-131-0/+0
| | | | | | | | | | | | | | | | | | | | qt.shiboken: (doc) Error handling <snippet> in PySide2.QtGui.QRegExpValidator, line 9: Could not resolve "code/src_gui_util_qvalidator.cpp" in sources/pyside2/doc/codesnippets/doc/src/snippets", sources/pyside2/doc/codesnippets/examples qt.shiboken: (doc) Error handling <snippet> in PySide2.QtGui.QIntValidator, line 4: Could not resolve "code/src_gui_util_qvalidator.cpp" in sources/pyside2/doc/codesnippets/doc/src/snippets", sources/pyside2/doc/codesnippets/examples Task-number: PYSIDE-363 Change-Id: Iab4e64b0d9a810dc784edcc0239251fca2f5927f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Refactor QtXmlToSphinx::readFromLocation()Friedemann Kleint2018-02-131-9/+15
| | | | | | | | | | | | | | | | | | Split out the code path for empty identifier and port to QRegularExpression. Task-number: PYSIDE-363 Change-Id: I6c0eeba1d62762e475de12d503fdc1a9d495d349 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Refactor QtDocGenerator::writeFormattedText()Friedemann Kleint2018-02-131-8/+15
| | | | | | | | | | | | | | | | | | Rewrite to use QStringRef and add some checks preventing overflow should the text contain empty lines. Task-number: PYSIDE-363 Change-Id: I850221bc6e7a6b88fc3b6078cf2cb2e01663ab15 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Fix some spelling errors in qtdocgenerator.h/.cppFriedemann Kleint2018-02-132-15/+19
| | | | | | | | | | | | Task-number: PYSIDE-363 Change-Id: I781fc0dc195bc8f3222f9fce7c863b67d3d2c568 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | QtXmlToSphinx: Improve error handling for snippetsFriedemann Kleint2018-02-132-27/+53
| | | | | | | | | | | | | | | | | | | | Change the qCDebug() to qCWarning() for snippets issues and pass the errors up so that more context can be given. Task-number: PYSIDE-363 Change-Id: I23310cd55a1cdb3b040dd785db43717fa3c4c07d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Docs: Add QtQml, QtQuickWidgets and the Qt3D modulesFriedemann Kleint2018-02-133-12/+24
| | | | | | | | | | | | | | | | | | Introduce an inner loop to doc/CMakeLists.txt allowing for handling qdocconf files that contain several modules. Task-number: PYSIDE-363 Change-Id: I71839999fe616b56fb3f2bab03bb21f49d0d1dac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-02-025-4/+79
|\| | | | | | | Change-Id: I777970f7bb17db766660d82556559eadd7293355
| * Fix QTabWidget.clear to avoid double obj removalCristian Maureira-Fredes2018-02-023-2/+69
| | | | | | | | | | | | | | | | | | | | | | Replacing shiboken call setParent with releaseOwnership so Python will not delete the underlying C++ object. A test case is provided to check that the error is not happening. Task-number: PYSIDE-213 Change-Id: Ic0f383c3d93b905885f76788d32d62ba37ed9d2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Fix QSsl classes to be picked up on LinuxAlexandru Croitor2018-02-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The compile tests that checked for QSsl classes silently failed because of two different reasons: 1) If Qt was compiled with -fPIC, but the tests weren't, we hit a compilation error. Solution is to compile with -fPIC if necessary. 2) For some reason when linking, the linker can't find the qt version tag symbol. Solution is to simply not use the version tag. Task-number: PYSIDE-599 Change-Id: If8a6ea38b45091bcaced6179a71195d25589ef18 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix signature extension disablingChristian Tismer2018-02-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature extension is a feature that can switch itself off, using the expression PY_VERSION_HEX >= 0x03040000 || \ (PY_VERSION_HEX < 0x03000000 && PY_VERSION_HEX >= 0x02070000) Unfortunately, the use of this constant when disabled became inconsistent over time. This patch corrects that and also adds a cosmetic improvement that was lost. Task-number: PYSIDE-510 Change-Id: Id1653c391d921a2c51008db2bc222d6f4bec9e90 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Registry: Trigger re-generation of files for Qt3DChristian Tismer2018-02-024-848/+911
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is phase 2. The files are generated. I only changed the date in the license section. After this check-in, the update is done. From Phase 1: The function registry does not contain the new Qt3D module. This produces no error because the test is configured to only break on missing functions but not on new unknown functions. We provoke a reaction of the system by removing of the 5.9 registry files. The system will generate an error once and produce the desired output. But because of the multiple testing, the test will succeed because the generated file exist on the second run and therefore the test will succeed as a flaky test. There is only one run necessary for all platforms at once. A second check-in will then do the update with the generated data. I also had to fix the testrunner to produce a good listing without labels. Task-number: PYSIDE-487 Change-Id: I06a73d244ce306977fd16223eec4dc491fff3429 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken/QtDocGenerator: Copy imagesFriedemann Kleint2018-02-022-7/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the doc generator would rewrite the URLs to point to QTDIR/doc/src/images where the images were located in Qt 4. Add a function to copy the images from the webxml/images directory to a matching directory under rst where they can be picked up by sphinx. Task-number: PYSIDE-363 Change-Id: I1da83a7717dd61a9c0b80a7cc18444e00a1f4c1b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | qdoc: Add more include pathsFriedemann Kleint2018-02-011-3/+9
| | | | | | | | | | | | | | | | | | | | | | Add the mkspec directory and the subdirectories containing the private module headers as is done in a standard Qt documentation build. This reduces the number of "Cannot tie this documentation to anything" warnings. Task-number: PYSIDE-363 Change-Id: I7231ada32970a0e3128bcf9ab38014025afe3751 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Remove unneeded documentation logosFriedemann Kleint2018-02-012-0/+0
| | | | | | | | | | | | Task-number: PYSIDE-363 Change-Id: Id24989eea3b47b04e37ce727c28deab4f34cefc1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Update documentation HTML templatesFriedemann Kleint2018-02-012-25/+73
| | | | | | | | | | | | | | | | | | | | | | - Fix some URLs - Add modules new in Qt 5 - Remove outdated modules - Remove outdated copyright URLs Task-number: PYSIDE-363 Change-Id: Iebdf0ee89db9f637a7317e199d71e164814c8f49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Fix error with second Qt.UniqueConnection callCristian Maureira-Fredes2018-02-012-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation was considering only Py_True as a success, but not Py_False. The else statement will enter just in case of error, as intended. Added a test case to verify the proper behavior of Qt.UniqueConnection. Task-number: PYSIDE-34 Change-Id: I5bafe0e81383022dcd7fc6251fc61d0ab5e918d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Fix CMake for local system installationsCristian Maureira-Fredes2018-02-011-3/+23
| | | | | | | | | | | | | | | | Amends 8d0ce19ca6cef467e67a49cb720fa5ed61aaca35 Task-number: PYSIDE-596 Change-Id: I4acd653d0772ddee85a06f41b5273018c3861651 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add code to invalidate objs on QListWidget.clearCristian Maureira-Fredes2018-01-312-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported on PYSIDE-264, when an item of an already cleared QListWidget was being accessed, a segfault happened when trying to access this deleted data. Due to the lack of an invalidation process of the python objects when clear() was called, the generated validation step before accessing the data had no effect. This was solved injecting code to set their parents to NULL, and invalidating them. The outcome of trying to access deleted data then will be a RuntimeError, instead of a segfault. A test case is provided. Task-number: PYSIDE-264 Change-Id: If52dd85827500c96a078a8f9d61921a275fb28f9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Remove some harmless shiboken warnings when ran on QtCoreAlexandru Croitor2018-01-311-0/+4
| | | | | | | | | | Change-Id: I1ce182621862f57ee555999cdd7a18eecc60ffe1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Suppress some anonymous enum warningsAlexandru Croitor2018-01-311-0/+8
| | | | | | | | | | | | Task-number: PYSIDE-587 Change-Id: I9f78ed0c66e4bb9db463f04fe77a8fc63413cd83 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Add more qdocconf filesFriedemann Kleint2018-01-3120-0/+40
| | | | | | | | | | | | Task-number: PYSIDE-363 Change-Id: If7b3e7157fccb0494860664505df96c946e1c402 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add Qt3DFriedemann Kleint2018-01-3123-0/+1241
| | | | | | | | | | | | Task-number: PYSIDE-487 Change-Id: I17100eda57fbe5015b6c8ff531a3c62b22e8de95 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | libshiboken: Code cleanupFriedemann Kleint2018-01-272-47/+0
| | | | | | | | | | | | | | | | Remove apparently unused/deprecated code. Change-Id: I566014bafdcbf0b3b46e9dc836c451c64d409511 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix clazy warnings in the doc generatorsFriedemann Kleint2018-01-262-8/+5
| | | | | | | | | | | | | | | | | | | | | | - Unused variables - Mixing const/non-const iterators - Signedness - Missing const ref in range-based for - Uninitialized variable Change-Id: I02e6d4c5b0416aa8462f7b9d567b562a702a5740 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Remove examples submoduleFriedemann Kleint2018-01-252-4/+1
| | | | | | | | | | Change-Id: I0e4e3472e1d5644db281fb46ce4ba4ddfc1eafae Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Shiboken: Handle private abstract methodsFriedemann Kleint2018-01-197-4/+22
| | | | | | | | | | | | | | | | | | Remove the exclusion. Required for Qt3dExtras::QAbstractCameraController::moveCamera() in 5.10. Task-number: PYSIDE-487 Change-Id: I67ae24d4cda2d90ac30c97f77457c2eaf65099ab Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken tests: Introduce overrideFriedemann Kleint2018-01-196-24/+24
| | | | | | | | | | | | | | | | Replace virtual by override where appropriate to make the code clearer. Change-Id: I143daf29f1c162b2de959411a5f4acdc43a2b253 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-01-192-5/+16
|\| | | | | | | Change-Id: I5f2e1660a27efafa445592898db4dfe3250306e0
| * qinstallmsghandler_test.py: Test qDebug() in debug builds onlyFriedemann Kleint2018-01-161-3/+4
| | | | | | | | | | | | | | Otherwise, messages are suppressed and the test fails. Change-Id: Ie7fb8192e542a09822f6e1f70392100f4cdc0f11 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Do not link shared libraries against the python shared library on UnixAlexandru Croitor2018-01-151-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to link against the python shared library (or static library) on Linux / macOS because the python symbols will already be loaded by the dynamic linker, by the time when a PySide2 module is imported. This is especially relevant on Debian distributions, which ship a statically built python interpreter, as well as a python shared library (which is not used by the interpreter). The python shared library package is intended for native application that want to embed a Python interpreter inside the application. So far PySide2 would have linked against the python shared library, which means that on Debian distributions when running a PySide2 example, the executable would load two versions of the same python symbols (one from the static interpreter, and one from the shared library), and this might cause issues. On Windows we still need to link against the python.lib import library, because otherwise the python symbols would not be resolved. Task-number: PYSIDE-522 Change-Id: I4483ded96461c04f8e7a17d39068d07f772a973c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Handle QObject-derived arguments correctly in constructor overloadCristian Maureira-Fredes2018-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Shiboken generated conditions to select which constructor overload needed to be used in an unexpected order. These conditions were incorrect, and hence produced an error. Handling QObjects in the inheritance relationship process solved the issue. Task-number: PYSIDE-203 Change-Id: Iee3a8c8fe48671cd752cc0e3d92b740c823656ad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken: replace first()/last() by constFirst/constLast()Friedemann Kleint2018-01-177-62/+59
| | | | | | | | | | | | | | | | Fix clazy warnings about possibly detaching containers. Change-Id: I3c3a229de5e0c71f17c1f26273e1b0be3b0d7e81 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken: Fix some clazy warningsFriedemann Kleint2018-01-1712-60/+45
| | | | | | | | | | | | | | | | | | | | | | | | - Mixing const/non-const iterators - Do not use operator[] on temporaries of type QVector - Remove unused nontrivial variables - Add Q_FALLTHROUGH() - Potential detach in range-based for Change-Id: I89391fdda616f119eadd7de529eb6cee69343f85 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add quotes to Shiboken cmakeCristian Maureira-Fredes2018-01-161-1/+1
| | | | | | | | | | | | | | | | | | For paths containing spaces, the lack of quotes will make the process to fail. Task-number: PYSIDE-169 Change-Id: Iee99eb4fe6ed1045b7c6053ef199c49714fab32f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix cmake scope for locally installed modulesCristian Maureira-Fredes2018-01-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If modules are installed on the system but not in the local Qt installation, cmake will find them and try to build, but this will lead to errors. Comparing the QT_INCLUDE_DIR and the path where the package was found, we can filter the modules that were found on a different directory. Change-Id: I463172b7081c191fb303387f98a495dd675e0486 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Prevent infinite loop due to bad __getitem__ implCristian Maureira-Fredes2018-01-151-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looking at PYSIDE-441 there was an issue regarding overloading the __getitem__ method on a class that inherits from QObject. The bug report showed that setting an object of the same class to be the parent of another object of the same class ended up causing an infinite loop when trying to get the parent element. Overloading __getitem__ implicitly converts the class into an iterator, and the developer *must* include a proper implementation of the method which raises a StopIteration exception when needed. Commonly, people that overload this method included access to class data structures where in most of the cases an IndexError is raised which forces the iteration to stop. Since the bug report did not include this code and also there was no access to any internal variable, no exception was raised and ended up causing an infinite loop. This can be replicated in python as folows: class A(object): def __getitem__(self, arg=None): print("getitem called:", arg) #raise StopIteration a = A() print(list(a)) This small fix avoids the infinite loop when the method __len__ is not implemented (length = -1) or when the length of the pyObj is zero. Without a proper implementation of __getitem__ (Raising IndexError or StopIteration) the infinite loop will happen. If __len__ is not implemented, then the application will complain, but does not matter since this is never checked during the iteration. Change-Id: I74e7bf1755c265dbc309bb6c5a760f11643fd7ed Task-number: PYSIDE-441 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix system header inclusions for proper support of C primitive typesAlexandru Croitor2018-01-152-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for GL types like GLint64 to be available on macOS, the macOS-specific system header "gltypes.h" has to be parsed by libclang. Before this change, shiboken skipped parsing system headers (except for gl.h) because there are issues when trying to parse C++ std headers (ostream for example). The file "gltypes.h" contains the typedef declarations for GL numeric types. A few other system headers like "cstdint" are also needed (which contain the actual typedefs from int32_t to int for example). A few different system headers are also needed on Linux (also for GL -> numeric typedefs). This system header exclusion mechanism is far from a clean solution, but it seems like current versions of libclang do not provide enough preprocessor information to be able to limit the parsing to specific chunks of code (for example everything included by gltypes.h), thus we need to limit ourselves to exclusion by file paths. Change-Id: I58c151e2cb083e16f7cafb3dc9df2d757442bb59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix system framework handling on macOSAlexandru Croitor2018-01-152-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System framework paths queried from the system clang compiler should be re-added to libclang via the -iframework command line argument instead of -F, so that they appear at the bottom of the list of candidate include search paths. This prevents issues with picking up incorrect headers, like an installed official package of Qt 4.8. Also there is no need to use CMAKE_SYSTEM_FRAMEWORK_PATH like in the 5.6 branch because it duplicates the list of includes and also causes conflicts with the same paths being added as both system and non-system include paths. It was necessary in 5.6 branch because the list of include paths was not queried from the clang compiler. Change-Id: I04b299fc5bc759842a0ab890a85170f153932e79 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Use cmake install for typesystem filesFriedemann Kleint2018-01-151-1/+2
| | | | | | | | | | | | | | | | | | | | install is better suited for distro installation due to permission issues. Amends 5d5eed53e49f4aaea85ce1638dd6fa3774a960e0. Task-number: PYSIDE-589 Change-Id: I6539b7c9957fd542a39b68e2d63a66f544414cd7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add bindings for QHelpSearchResultCristian Maureira-Fredes2018-01-154-0/+47
| | | | | | | | | | Change-Id: I256eced0fb4fcef097c63cdf63257e89953c54d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Fix return conversion for readData/readLineDataCristian Maureira-Fredes2018-01-153-6/+90
| | | | | | | | | | | | | | | | | | The proper approach is to replace the returning data as Python Strings instead of QByteArray. Task-number: PYSIDE-40 Change-Id: I554b88bb79b7ae7d36fdc8c597704e3fcadd4527 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>