aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
Commit message (Collapse)AuthorAgeFilesLines
* Fix booleans and empty list cases in QSettingsCristián Maureira-Fredes2019-10-282-16/+73
| | | | | | | | | | | | | | | | | | | | | After the fix for PYSIDE-1010 there were two things that were not properly understood: 1. A special case for booleans was required, 2. When a list was detected, the split was wrongly creating a list with a '0' instead of an empty one. Additonally, due to the wrong treatment we couldn't notice if the value 0 was None, the number zero, or even false, so this patch amends the previous implementation to properly treat these cases. New test cases were added. Change-Id: I41d5387bb835cfa96f94e5577e993a4b87b303f0 Fixes: PYSIDE-1130 Fixes: PYSIDE-820 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Doc: Use the exclude_patterns instead of exclude_treesVenugopal Shivashankar2019-10-281-1/+1
| | | | | | | | | | The extras directory should be ignored by sphinx, otherwise we'll have duplicate module pages. The exclude_trees sphinx config is deprecated since the v1.0 release. The alternative for it is the exclude_patterns. Change-Id: I2fa8a0c3d8080bc838397091dfad950a97aa697e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Doc: Add the additional and the API ref pages to the toctreeVenugopal Shivashankar2019-10-254-54/+76
| | | | | | | | | The breadcrumb does not work as expected without these pages in the toctree. In addition, changed the module page links to use the :mod: directive instead of the :doc:. Change-Id: I0fc86ae0026375d4924b870c5e20c504aea3aed1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add inject-code for QVideoFrame::bits()VaL Doroshchuk2019-10-252-0/+10
| | | | | | | | | | | | | Since QVideoFrame::bits() returns uchar* which is not covered by conversion functions, added the same replacement as was done for QImage::bits(). It should return a buffer object to satisfy Shiboken::Buffer::checkType(). Fixes: PYSIDE-849 Change-Id: I33bdb13f3b892f325ccf3b1ef4bef59744b60f2d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add support for __repr__ in QObject derived classesAndreas Beckermann2019-10-257-8/+157
| | | | | | | | | | | | | | | | | | | | | | Currently shiboken generates classes without __repr__ for QObject derived classes. However for all non-QObject classes that have an operator<<() for QDebug, it *does* add a valid repr implementation. Extend this behavior to QObject classes as well. In order for this to become more useful, also check for the indirection of operator<<(): If operator<<(QDebug, Foo*) is available, use the current non-value-type behavior, (i.e. provide cppSelf to operator<<()), but if operator<<(QDebug, const Foo&) is available instead, use the same behavior as for value-types, i.e. provide *cppSelf. This greatly increases the number of classes where operator<<() provides useful results. Also make sure to check for operator<<() in namespaces (recursively), not just at global scope. Change-Id: Ief9158455a25e332f07169f09692cafb8097078b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Release ownership in QAbstractVideoFilterWrapper::createFilterRunnableVaL Doroshchuk2019-10-241-1/+7
| | | | | | | | | | | | QAbstractVideoFilter::createFilterRunnable() is supposed to be called only from VideoOutput QML element when paint event is received, where the QML element takes the ownership of returned QVideoFilterRunnable object. Need to release the ownership, so Python will not delete the underlying C++ object. Fixes: PYSIDE-785 Change-Id: I041d9a43cafaf42d638778ea70b8a115276805b1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Doc: Minor fixes to the snippets and their orderVenugopal Shivashankar2019-10-163-2/+4
| | | | | Change-Id: Idf0bc429373180bf4c512014255eb7f6c93bd891 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Fix the broken download linksVenugopal Shivashankar2019-10-151-2/+2
| | | | | | | The links were using the the wrong directive. Change-Id: I3bbb3262d96857b66fff7d273f475514f880cb7c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Doc: Set up necessary infra. for example doc generationVenugopal Shivashankar2019-10-1510-1/+145
| | | | | | | | | Qdoc must be made aware of the .py and .pyproject file types to generate the example page. In addition, it needs the URL to the example on https://code.qt.io/pyside-setup.git to link. Change-Id: I824898831475b6fe3f66df0cd16df62a9301a69d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Doc: Add Porting guide tutorialVenugopal Shivashankar2019-10-1529-0/+2443
| | | | | | | | | Moving the content from this wiki page: https://wiki.qt.io/Qt_for_Python/Porting_guide Change-Id: Ic4ad03ccd5b65bdf08e27dbf045fe7528ec6cdb4 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix bad shutdown effect on QApplication.instance()Christian Tismer2019-09-301-0/+18
| | | | | | | | | | | | | | | | | | | | | | | When app = QtWidgets.QApplication.instance() is used before a QApplication has been created, the qApp code sees no qApp instance in C++ and assumes a shutdown. This patch keeps track of QApplication being created and behaves correctly on that aspect. It is still unsolved that QtCore.QObject.staticMetaObject gets deleted on a qApp shutdown, which is too much. I think this can be handled in another patch if at all, since the shutdown / recreate feature is undocumented and of little use. Change-Id: I140b6dba45f7cd337580373dbf72bc6d0a625fea Fixes: PYSIDE-1093 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Fix compiler warningFriedemann Kleint2019-09-251-1/+2
| | | | | | | | | | | | | Restore the warnings formatting code in helper fillQtProperties() to what it was before, (since QByteArray propName is constructed from PyObject *key), fixing: format ‘%S’ expects argument of type ‘wchar_t*’, but argument 3 has type ‘PyObject*’ {aka ‘_object*’} [-Wformat=] Amends bff242cfd8a34dcf2848a8864732eb5bdf85dbf0. Task-number: PYSIDE-1019 Change-Id: I724c5eb698327b8b6474c895f1b149b08e729bd1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"Friedemann Kleint2019-09-112-6/+1
|\
| * Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-09-112-6/+1
| |\ | | | | | | | | | Change-Id: I7f3e2a11fe744b5c868698e63cf10882c168c53f
| | * Remove extra ref on QDataStream::setDeviceCristian Maureira-Fredes2019-09-061-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the documentation the object does not take ownership of the QIODevice. Change-Id: I1a617844fd825e6420167c4a5d848fd36e90823f Fixes: PYSIDE-1007 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Bump version for 5.12.5Simo Fält2019-08-271-1/+1
| | | | | | | | | | | | | | | Change-Id: I741a7880bf87cca4a6482cc0e07e6f878e2e02b3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | | Fix formatting of the deployment documentationFriedemann Kleint2019-09-111-5/+5
|/ / | | | | | | | | | | | | | | Fix wrapping and bullet list. Fixes: PYSIDE-1089 Change-Id: Ibf4c7f6ccb5b167da6ccb4afa9cc2c51d0551c78 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Bump version to 5.13.2Simo Fält2019-09-061-1/+1
| | | | | | | | | | Change-Id: I4e65ab4e24d563372e548f426b830a9490b8e99f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Doc: Improve the documentation styleTopi Reinio2019-09-021-20/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Restyle the admonition (warning/note/seealso) paragraphs, use the same font for all link types, and separate entries with ', '. - Drop the rounded corners on multiple section titles. - Use a monospace font for enumeration tables (value column). - Restyle the <blockquote> element that is used for overload/parameter docs to separate them from the documentation 'body'. - Replace list-style-type:'' with list-style:none as the former does not work on all browsers. Change-Id: I0c37bd05448d7ce38a47af7449ca0bc9efff68b4 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | signature: Support typing.Optional[T] and refine a bitChristian Tismer2019-08-291-21/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature was missing "typing.Optional[T]" which has to be wrapped around any argument with a default value of "None". This is the only case where the repr of a type looks different than it was written, because it renders as "typing.Union[T, NoneType]". Solving that by redefining a few typing structures was way too hard and too error prone. It was finally solved by a regex replacemet that is run as a post process in generate_pyi.py . The enumerations are now even more complete, since toplevel enums are also included. This had the effect that enums with Python keywords were revealed, and so the function "createEnumItem" had to be modified. The order of creation was also changed to avoid name clashes. The overall structure was improved, and instead of parsing the generated signatures to find out if something is a class method, this is now very cleanly implemented as an inquiry to get_signature(). I tried to make sense of the flags structure that comes with many enums. PyQt5 has a standard set of "__...__" methods without useful signature information. I could mimick that as well, but that would create a whole lot of pointless extra information. We should decide later if it makes sense to include that. Right now the flags structures show the class name, only. This patch will be merged with the 5.14 branch. The additions of this patch could fortunately be placed into areas which do almost not overlap with the 5.14 signature additions. Change-Id: Ie513e15917b04d746ab597fb7a9eb1fd766f7c73 Fixes: PYSIDE-1079 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | CMake modularization: macros creationCristián Maureira-Fredes2019-08-281-180/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First step of this process that only considers the idea of encapsulate the diffrent CMake processes we currently have in all our main CMakeLists.txt files. This patch simply takes some sections of the existing cmake files and move them to a macro file. Additionally, a couple of macros were written twice in shiboken and pyside, so now they are only once. Task-number: PYSIDE-1033 Change-Id: I2c63d8a2eba3d8951097ec9c9042c782fde5dd62 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add QtCore.Slot.__signature__ and much more manuallyChristian Tismer2019-08-218-48/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature of QtCore.Slot and other classes could not automatically be generated because the function is not generated by cppgenerator.cpp . We add it manually in the C++ code into the generation process. The case of QtCore.Slot had diverse follow-up issues to be solved: - Classes which did not inherit from Shiboken were not generated. This is a long-standing omission and creates very many new simple types. - The arity of Slot has default arguments after the varargs parameter "*types". This needed an extended Python parser analysis that fixes the arguments given to the inspect module, accordingly. - The signature generation was completely new implemented and relies no longer on the restricted syntax of a Python (2) function but generates signatures directly as Parameter instances. Implemented classes with hand-made signatures: QtCore.ClassInfo QtCore.MetaFunction, QtCore.MetaSignal QtCore.Property QtCore.Signal QtCore.SignalInstance QtCore.Slot QtQml.ListProperty QtQml.VolatileBool As a side effect, many more subtypes were published. Enums are done, which concludes this work. Fixes: PYSIDE-945 Fixes: PYSIDE-1052 Change-Id: Ic09f02ece3a90325519e42e4e39719beb0c27ae9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix wrong Python init return codesChristian Tismer2019-08-205-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PySide classes had wrong return values in their init code. In case of errors, they would not show up immediately. The following modules are affected: sources/pyside2/libpyside/pysideclassinfo.cpp sources/pyside2/libpyside/pysideproperty.cpp sources/pyside2/libpyside/pysidesignal.cpp sources/pyside2/libpyside/pysideslot.cpp sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp This error exists since Nov 03 2010 . Fixes: PYSIDE-1077 Change-Id: I8cf9bf7d1d8f8dca1155274cb24408f423557bac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Docs: Add missing pysideversion codeCristián Maureira-Fredes2019-08-201-4/+18
| | | | | | | | | | | | | | | | | | The file pysideversion was removed, but the Getting Started page was still referencing it. This change add the code that used to be in pysideversion.rst Change-Id: Ie80b2cd95cac6f50e52be2556d53de209422f26e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Update docs styleCristián Maureira-Fredes2019-08-201-12/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some upgrades to improve the readability: * Reduce margins, * Remove round-corners from boxes, * Remove parameters and return type boxes and use bold instead, * Always show the Table of Contents. Task-number: PYSIDE-1067 Change-Id: Ibaa484172103eff17426ae03ee6f95c78fe51143 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | simplify the qslot_object_test to use the qApp macroChristian Tismer2019-08-151-9/+5
| | | | | | | | | | | | | | | | | | The qslot_object_test needed an adjustment, because it uses the name "qApp" without being aware that a qApp builtin variable exists for exactly that purpose. Change-Id: Ic3df95ee33ece5de573b2dcc6ec2d6e2a1ffee73 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Bump version to 5.13.1Simo Fält2019-08-151-1/+1
| | | | | | | | | | Change-Id: I88699b3231707d77014b0ee2fb1e8a710484f66e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Documentation: update QInputDialog snippetsCristián Maureira-Fredes2019-08-141-12/+12
| | | | | | | | | | | | | | | | | | | | Adapting the code, since we return a tuple (retval, ok) instead of the Qt/C++ approach of having the boolean ok as a parameter. Task-number: PYSIDE-1059 Change-Id: Ied9f99048b95c034850111135ba47ff3aad34917 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-08-143-4/+3
|\| | | | | | | Change-Id: Ibe27e8ef7edc487640bc9cf1fe113d2d27e1e291
| * correct QtPrintSupport dependencyChristian Tismer2019-07-292-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtPrintSupport was missing the XML entry QtWidgets in typesystem_widgets_common.xml, which resulted in follow-up errors in generate_pyi . With this addition, the following pointer-types patch will create a correct signature def getPageMargins(self, unit: PySide2.QtPrintSupport.QPrinter.Unit) -> typing.Tuple[float, float, float, float]: ... Task-number: PYSIDE-951 Change-Id: I0b87cc31c3b39e727aec0a433687a131f1dc1aa6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken: Allow for "auto" as target of type for CONVERTTOCPP in injected codeFriedemann Kleint2019-07-291-3/+2
| | | | | | | | | | | | Task-number: PYSIDE-1037 Change-Id: Idfc70fe571e4058d0c82db1bd0afea54436fe27c Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Alex Blasche2019-07-1840-5/+142
|\| | | | | | | Change-Id: Ic2c43ef80769e3063dac771518c803861510f72e
| * Cleanup signature module before substantial changeChristian Tismer2019-07-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were some refinements applied while developing "Support Pointer Primitive Types by Arrays or Result Tuples". This patch moves these changes out which are not essential for that patch. They include - sort all mapping groups by name - replace huge regex by a pattern generator - replace dictionary string entries by SimpleNameSpace - improve PEP 563 handling - simplify "zero(sometype)" substantially - better handling of "QGenericMatrix" (preview) A test for the generated pattern against a reference parser was added. Task-number: PYSIDE-795 Task-number: PYSIDE-951 Change-Id: I5a6b236850c63a7db77b7f7b88881486fd1e61be Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Change QtQml tests file permissions to 644Cristián Maureira-Fredes2019-07-1734-0/+0
| | | | | | | | | | Change-Id: I0447da5e1ace3f6acc930aa4296576ec447f1be5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Add optional support for types in QSettings::valueCristián Maureira-Fredes2019-07-175-5/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This add an optional named parameter to the function value() to automatically cast the type that is being returned by the function. An example of this situation could be an ini file that contains the value of a one-element list: settings.setValue('var', ['a']) The the ini file will be: [General] var=a # we cannot know that this is a list! Once we read it, we could specify if we want the default behavior, a str, or to cast the output to a list. settings.value('var') # Will get "a" settings.value('var', type=list) # Will get ["a"] The cppgenerator was modified to add a verification step before trying to get the named parameter, since it could be optional and having one named parameter was assumming that all of them were provided. Change-Id: I8f379debea86b42cf89019d432e990084c9e6614 Fixes: PYSIDE-1010 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-07-057-6/+161
|\| | | | | | | Change-Id: I3b3285a4e0315aea8da0426f179515866f53a7f8
| * Add support for parameterNames in SignalsCristian Maureira-Fredes2019-07-046-5/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were many uses cases when a proper interaction between Python and Qml was needed, one of them was the case to emit signals from Python an get those values via an argument name in QML. A simple example describing this situation can be found in PYSIDE-634: Python: sumResult = Signal(int, arguments=["sum"]) sumResult.emit(42) Qml: onSumResult: console.log(sum) // will print 42 A test case based on the same example was added. Change-Id: I0908f97d88eaadc0c02d81bc4daca936f72f6c6a Fixes: PYSIDE-634 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * PySide2/QtCore: Remove duplicated type entry for "bool"Friedemann Kleint2019-07-041-1/+0
| | | | | | | | | | | | | | Another entry with converters exists a few lines below. Change-Id: Id1de3835e42869a55e0bf865aa992f38748f2e88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-07-022-6/+1
|\| | | | | | | Change-Id: I79d2166f18d8ed941c6c34fcbc7b185c2da02f0c
| * Leave QVariantMap as a name, not a typeCristian Maureira-Fredes2019-07-022-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem happened on the QtLocation module, when the QVariantMap argument was being used in several functions, and this type was declared as a primitive-type in QtCore. An approach to change the type to a container-type failed, because since QVariantMap is a typedef, is was already registered as a name associated to the definition QMap<QString, QVariant>. The solution was to register the name at the beginning of the module (like QVariantList), and remove the type declaration, leaving it only as a name. Previously, the wrongly generated code looked like this: Shiboken::Conversions::PrimitiveTypeConverter<QVariantList>() but with this patch, it looks like: SbkPySide2_QtLocationTypeConverters[SBK_QTLOCATION_QMAP_QSTRING_QVARIANT_IDX] which is the proper name established by the code on glue/qtcore.cpp: Shiboken::Conversions::registerConverterName(SbkPySide2_QtCoreTypeConverters[SBK_QTCORE_QMAP_QSTRING_QVARIANT_IDX], "QVariantMap"); Change-Id: Id172cf5b1e3ac784bc9497359279e81fcba1d8ec Fixes: PYSIDE-1028 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>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-06-26230-23634/+74
|\| | | | | | | Change-Id: I5bfa45782938d3bf43e16164f1ecd69f53bfcf8e
| * Cleanup pointer and trailing whitespace (omissions)Christian Tismer2019-06-2523-74/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Cleanup pointer whitespace" patch was augmented by some C++11 changes. Unfortunately, this was done in the same commit, and so some old whitespace that was removed could re-appear invisibly, since it was in the original version. This fix tries to remove all trailing whitespace and also adds a few " *" corrections that were lost. The "type *" entries in XML files were changed back to "type*". Change-Id: Ic5c945ad64a47455fb15eebdf184b126af5ecd1d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Remove left-over C++ example snippetsFriedemann Kleint2019-06-25207-23560/+0
| | | | | | | | | | | | Change-Id: I15d5c647e68344ae4a05898be6d8a334cf25f3b4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-06-2438-736/+739
|\| | | | | | | Change-Id: Ia09beccd944e1276caa6aecbeb248e69917b7115
| * Cleanup pointer whitespace everywhereChristian Tismer2019-06-2438-736/+739
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Among other files to fix, basewrapper.(cpp|h) was full of uncommon pointer whitespace. After fixing that, I could not resist and fixed also libshiboken, generators, and after acceptance also PySide. Most of the time, this regex worked fine (\w\w+)([*&]+)[ ]*(?![&*]*[/=]) replaced with \1 \2 but everything was checked by hand. I did not touch the shiboken tests which are quite hairy. It turned out that inserting a space between a variable and asterisk causes a crash of shiboken, if the same line contains "CONVERTTOCPP". This was temporarily fixed by adding another space after it. Example.. sources/pyside2/PySide2/glue/qtcore.cpp line 977 QByteArray * cppSelf = %CONVERTTOCPP[QByteArray *](obj); //XXX /|\ omitting this space crashes shiboken! cppgenerator.cpp was special, since it was modified to _generate_ correct pointer whitespace. This caused a few testcases to fail, which had to be adjusted, again. This was difficult since some internal names must end on "*" and generated code normally not. Removing the last errors involved binary search on path sets... Apply C++ 11 fixits to the changed code, where applicable. Done-with: Friedemann.Kleint@qt.io Task-number: PYSIDE-1037 Change-Id: I4ac070f52c5efb296c05d581c9d46e6f397a6c81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Doc: Fix minor issuesVenugopal Shivashankar2019-06-193-6/+8
| | | | | | | | | | | | | | | | | | - Removed links to old qml tutorials - Fixed a note with overflowing text - Fixed the order of chapters list in a tutorial Change-Id: Ic42c35271dd161235ed8b08f596100e104f6139e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Doc: Fix typoVenugopal Shivashankar2019-06-131-1/+1
| | | | | | | | | | | | | | | | Change-Id: I1aebb1c1b680e92506274033285807d21c7b862b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Example: Move the SQL statementsVenugopal Shivashankar2019-06-181-29/+22
| | | | | | | | | | | | | | | | | | | | | | Moving the SQL statements into separate variables outside the scope of the 'init_db' function, improves readability. Change-Id: I716dfceef6dc343287afab17f74e8de7fae618c6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-06-195-24/+118
|\| | | | | | | Change-Id: I42955abfeb1fe8b7c6443a9b334154984286b9cc
| * Support the qApp macro in "scriptable application"Christian Tismer2019-06-172-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed from "Fix scriptable application to support the qApp macro" because qApp was improved instead of scriptable application. The qApp macro needed some extra effort to support the qApp "macro" which is only defined in the Python wrappers. I took some generated code, created a QApplication instance in Python and used then reduced generated code to get at the object and adjust the refcount. This solution was then rejected, because I can do better, and in fact, scriptable application now has a correct qApp macro too, without any change to scriptable application. The central idea was to look into the module init function at import time and to see if a Q*Application already exists. I was not aware of that import. Many thanks for the rejection! :-) Update.. -------- After many attempts to make the qApp variable correctly behave like always, I recognized that pre-existing Q*Application instances have no wrappers or constructors at all! With that, it is not possible to create a sophisticated qApp macro as a singleton variable in the desired way. Fortunately, this is also not necessary, because a C++ Q*Application cannot be deleted from Python, and there is no point in supporting more that a simple variable. So in case of a pre-existing instance, the qApp variable now gets redirected to that instance. A small test was added to application_test.py that is triggered by an import. A weird effect when "qApp" was typed interactively before calling "QApplication()" was fixed, too. Change-Id: Ic69dd6a21c964838a90f63e316d299b62a54d612 Fixes: PYSIDE-571 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>