aboutsummaryrefslogtreecommitdiffstats
path: root/ApiExtractor/typesystem.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add rejection by function return type and argument typeFriedemann Kleint2017-05-181-1/+8
| | | | | | | | Extend TypeRejection accordingly. Task-number: PYSIDE-516 Change-Id: Ibf97f3c16498b26e63f4bde5b0ae21acc3dd0c44 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* TypeRejection: Use QRegularExpressionFriedemann Kleint2017-05-181-15/+74
| | | | | | | | | | | Refactor TypeRejection to use one regular expression for the class name and one for the various strings to be matched depending on the match type enumeration instead of 4 fixed string fields. Task-number: PYSIDE-516 Change-Id: Ifb945e3be39fbedfd802c4d32de7de443cf53f49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* AbstractMetaLang/Typesystem: Replace QList by QVectorFriedemann Kleint2017-04-061-1/+1
| | | | | | | QList will be deprecated in Qt. Change-Id: I82c997366736c1f976b142cb142da39976736f49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Port to QRegularExpressionFriedemann Kleint2017-04-061-4/+8
| | | | | | | Port most QRegExp to QRegularExpression. Change-Id: Icb551f16e97c409fc979c1caa10f6496248202b2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace foreach by range-based forFriedemann Kleint2017-04-051-10/+10
| | | | | | | foreach will be deprecated in Qt. Change-Id: I8b3398bb543056de6dd11d18977928ae719819a2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* TypeDatabase: Refactor TypeDatabase::normalizedSignature()Friedemann Kleint2017-03-291-4/+4
| | | | | | | | | | | The repeated construction of a QRegExp in loops shows up in the profiler. Change the API to accept a QString and store the regular expressions in a vector. Change-Id: Ic7ac7cdcd55beb901116589083f87c87fb48a4dd Reviewed-by: Christian Tismer <tismer@stackless.com>
* TypeDatabase: Refactor API version checkingFriedemann Kleint2017-03-241-1/+1
| | | | | | | | | | | | The repeated construction of a QRegExp in the version checking loop shows up in the profiler. Change the API to accept a QString, reducing conversions and remove obsolete API. Port the version checking code to use QRegularExpression and QVersionNumber and store the regexps in a vector. Change-Id: Id3e509e065d73699f49109df1f184edbefb8a09a Reviewed-by: Christian Tismer <tismer@stackless.com>
* Implement partial QSharedPointer supportAlexandru Croitor2017-03-171-0/+61
| | | | | | | | | | | | | | | | | | This change introduces a new XML tag called smart-pointer-type which currently only supports implementations of C++ shared pointers. This allows using objects pointed to by a shared pointer inside python code. There is one known limitation at the moment. Python shared pointer objects are only created as a result of using C++ API with shared pointers in the method signature (either the return type or argument type). Thus is it is not currently possible to instantiate shared pointer objects directly, e.g. p = ModuleName.SharedPointer() will not work. Task-number: PYSIDE-454 Change-Id: Iacf9fcc8613fbf9bd94e179169d78da8aac58f45 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Refactor the character handler of the typedatabase XML parserFriedemann Kleint2017-03-171-2/+3
| | | | | | | | | | | | The function is called from the XML parser as well as with strings from an imported file. Change the function to be a template taking a QString/QStringRef and add necessary overloads to the setters. This prevents newlines and unused content in the XML files from unnecessarily being converted to a QString. Change-Id: Ifbac37c9099d799a8a334f46f78050dcbd52fad1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* TypeDatabase: Port to QXmlStreamReaderFriedemann Kleint2017-03-161-62/+99
| | | | | | | The old QtXml classes are deprecated. Change-Id: Icde985d352df5bbaca89b23e0fea1d4efe8e2fb4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* TypeDatabase: Make it possible to specify enumeration flags as ↵Friedemann Kleint2017-03-161-37/+43
| | | | | | | | | | | | | | | | | | comma-separated list Split out the code adding the flags and loop over the list. In typesystem_core_common.xml, there is currently: <enum-type name="ComponentFormattingOption" flags="ComponentFormattingOptions" flags="FormattingOptions"/> which is invalid XML. This can then be specified as: <enum-type name="ComponentFormattingOption" flags="ComponentFormattingOptions,FormattingOptions"/> Change-Id: Ia55b34fb0a72891a15f7f6e3684b41fec8d72f4b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix build with MSVC2013Friedemann Kleint2017-01-301-4/+4
| | | | | | | | | | | Use QString::fromLatin1() instead of QStringLiteral for multiline literals. Fix duplicated class name. Task-number: PYSIDE-467 Change-Id: I600482e9c55678b254b596459296925b64f588d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Code model: Rename TypeAliasModelItem to TypedefModelItemFriedemann Kleint2017-01-201-9/+9
| | | | | | | | | | | | "TypeAlias" becomes confusing as the term "Alias" gets a different meaning in C++ 11. Rename classes and related API. Also rename aliasedType to referencedType in the type database. Task-number: PYSIDE-323 Change-Id: Ic13049bde1cf94090de0dbf46e4ce484992dcbbf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add debug output to type databaseFriedemann Kleint2017-01-201-0/+37
| | | | | | Task-number: PYSIDE-323 Change-Id: I306ccbb3a1c69e00129f5cc17626b502f79ed191 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shibokengenerator: Remove some C-style castsFriedemann Kleint2017-01-121-1/+2
| | | | | | | Replace by C++ casts. Change-Id: I845873e9f95923cbbfeb7ff1f7f73e5e1ac65281 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Header cleanupFriedemann Kleint2017-01-061-11/+11
| | | | | | | | | | | | | | | Split out small headers typesystem_enums.h typesystem_typedefs.h and abstractmetalang_typedefs.h containing enumerations and typedefs from abstractmetalang.h and typesystem.h. Move enumerations Position and DocModificationMode from typesystem classes into global enumerations in typesystem_enums.h. Remove the large includes abstractmetalang.h and typesystem.h from most headers, de-inline some methods where required. Change-Id: I206acb605f86964a591057dcbc8584b9572fd810 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Refactor TemplateInstance::expandCode()Friedemann Kleint2017-01-041-6/+12
| | | | | | | | | | | | | | | Ensure a newline is added after the opening comment, right-trim the code and add a newline before the closing comment. This prevents code from being lost when writing a template in a single line: <template name="name">code</template name>. Adapt the test to cover both cases. Use hash iterators instead of iterating over QHash::keys(), avoiding the construction of a temporary container. Task-number: PYSIDE-323 Change-Id: I7116f4284b16947242357bf6aee963a29f1fb16d Reviewed-by: Christian Tismer <tismer@stackless.com>
* Enable Qt 5.5 againChristian Tismer2016-10-211-1/+2
| | | | | | | | | | | | | Qt 5.5 is gone, but it still contains the QtWebKit modules, which some companies also still use in Qt 5.6 . For simple testing, I avoided certain Qt 5.6 features. We can test the QtWebKit with Qt 5.5, which introduces 11 new errors. After fixing those errors, we will migrate the tests to QtWebEngine. Change-Id: Ic9a6fe04c6e995635b8f90ed31b66fd58532f41c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Updated license headers of the code generator partsFriedemann Kleint2016-09-231-22/+27
| | | | | Change-Id: I84f12c3d9d265da2dab807af1ddd952795d156fa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use const reference for argument in foreachFriedemann Kleint2016-09-221-4/+4
| | | | | Change-Id: Icb8a3611f387bda1bf15b1f3522330c030d47de7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Compile with QT_NO_CAST_FROM_ASCII, QT_NO_CAST_TO_ASCIIFriedemann Kleint2016-09-191-489/+502
| | | | | | | Add the define in CMakeLists.txt to enforce it in the module. Change-Id: I233e85b66c694f8242c1aec013ec8e69a73212fd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Introduce the Qt 5 logging systemFriedemann Kleint2016-09-121-23/+34
| | | | | | | | | | | Define a logging category and use that to output debug messages and warnings. All of this now goes to standard error and can be conveniently captured from there without disturbance by the progress messages. Also, message formatting can now be controlled for example to output file and line numbers. Change-Id: If0de8776d4f5b6e418c70d4fe0931d2882b36ab8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* silence a few warningsChristian Tismer2015-07-181-1/+1
|
* after many many edits, shiboken builds now.Christian Tismer2015-06-061-3/+3
| | | | | | We have to see if it also works. It is also possible that we can undo all the atomicpointer changes by a helper class, but I first wanted to be explicit.
* Refactor and improve added function resolvingMatthew Woehlke2013-09-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Add a public function to create an AddedFunction::TypeInfo from a signature string. Change translateType to use this to do full recursive resolution on template arguments. Create a new helper function to do more intelligent parsing of template type name signatures, and use this in translateType. Taken together, this means that we now recognize both multiple arguments to template types of added functions, as well as template arguments that are themselves template types. We couldn't do this before due to the use of a regular expression to attempt to separate the template type name from its arguments. The test cases are updated to test these new features. Note, however, that it is now a fatal error if the template argument type cannot be determined. (Before we would just drop it and treat the type as a non-container.) However, 1) this should not be happening in a well formed type system, and 2) it's questionable if things wouldn't have fallen apart anyway from treating the presumed container as something else. Change-Id: I23c3a7f7e311e046642d951d6ad2236571fda6b8 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Clean up styleMatthew Woehlke2013-08-061-18/+19
| | | | | | | | Change wrapping and indent of some code in Handler::startElement to improve consistency. Change-Id: I13bae6bbb732e3c5791cf0079154feed8d8dcbd1 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Replaced Nokia copyrights in headerTeemu Kaukoranta2013-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Replaced old Nokia copyrights with Digia copyrights. Removed "All rights reserved" strings without leading copyrights were removed (for example, 'Copyright SomeCompany, all rights reserved remain untouched). Did NOT touch contact details, will change them later. Excluded folders that have '3rdparty' in path. Used command: find . -path '*/3rdparty/*' -prune -o -exec grep -ilI -E '.*Copyright.*Nokia.*' {} \; | tee >(xargs sed -i -r '1,10 s/([ \t#*]*)(.*Copyright.*Nokia.*)/ \1Copyright \(C\) 2013 Digia Plc and\/or its subsidiary\(-ies\)\./I') >(xargs sed -i -r '1,10 s/(^[ \t#*]*)(all rights reserved.*)/\1/I') This excludes binary files and retains whitespace and #* characters in the beginning of the edited lines. Change-Id: I0d49f991c3dbd45d804843f185714e8681bc6c51 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com>
* Move ApiExtractor into ApiExtractor directory to ease the merge into Shiboken.Hugo Parente Lima2012-03-131-0/+2482