aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Define __STDC__ according to ANSIChristian Tismer2017-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The __STDC__ macro should not only be defined, but be 1 like in ANSI. Task-number: PYSIDE-206 Change-Id: I77cf48cad0b0b32c66d9ffd05b2478e6779fc630 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Improve Qt initialization order hackFriedemann Kleint2017-03-099-20/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In CppGenerator::finishGeneration(), the code tried to reorder the classlist such that the initialization of QMetaObject is written before the initialization of QObject by re-inserting the QMetaObject class entry in front of QObject. This does not consider the dependency of QMetaObject::Connection on QMetaObject and worked only by coincidence since the old parser did not recognize QMetaObject::Connection as an inner class due to it being forward-declared. With the Clang-based parser, which recognizes this, the initialization for QMetaObject::Connection would be called before the initialization of QMetaObject, causing a crash. Fix this by making it possible to pass additional dependencies as pairs of QString to the topological sorting functions, which then generate the correct sequence. Task-number: PYSIDE-323 Change-Id: Ia915b47131d57e71df366876a1a9f317cfd8d497 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * shiboken: Improve error messagesFriedemann Kleint2017-03-071-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove printing of version from errorPrint(), which was not used. Output the command line and call errorPrint() with a message from all places where EXIT_FAILURE is returned. Change-Id: I6bde49b461c24834be38ad9e18851a20cbe9e7bd Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * MemberModelItem: Improve debug outputFriedemann Kleint2017-03-071-1/+18
| | | | | | | | | | | | | | | | | | | | | Add static/mutable, etc fields. Change-Id: I02f547a54ecb709484fc81a452e9606d4f16d3ba Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * dumpcodemodel: Add verbose optionFriedemann Kleint2017-03-061-2/+9
| | | | | | | | | | | | | | | | | | | | | This will invoke the verbose formatting of TypeInfo. Change-Id: Ica2b02b771b029bab811cf2b50e557a0e715424e Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * CppGenerator::writeVirtualMethodNative(): Fix generating return for voidFriedemann Kleint2017-03-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code would generate return foo(); even for void functions. Fix it to generate foo(); return; Change-Id: I007adf85a52ec08e5c2ada14b0c9ba4aa3ba66f8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Further improve debug outputFriedemann Kleint2017-03-042-12/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Output accessibility and template parameters of functions. Add verbose output to TypeInfo. Fix a type in 77eefb7a42c4a96f69ac4f5af464ea3520ae4de7. Task-number: PYSIDE-323 Change-Id: Ia2eba89c35b1d2a9d41070784a9c49a88254a5c2 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * TestAbstractMetaClass::testSpecialFunctions(): Fix copy constructorFriedemann Kleint2017-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Change argument to const reference, fixing the clang parse error: main.cpp:8:12: error: copy constructor must pass its first argument by reference Task-number: PYSIDE-323 Change-Id: I53ea89f34fada52ab7eb02c78793d6a2cf0f49ce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * CodeModel/MetaBuilder: Improve debug formattingFriedemann Kleint2017-03-032-50/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Output the code model item class directly, output the line number in addition, add line breaks to some sequences. Output templates and scopes of the MetaBuilder. Task-number: PYSIDE-323 Change-Id: I523afdcce09e5756f6ad37c09239bae528654642 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Fix and refactor _fixFunctionModelItemTypes()Friedemann Kleint2017-03-023-19/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For template classes, the function was supposed to add the template parameters to the arguments and return types that take the class itself, for example: QList(const QList &) -> QList(const QList<T> &) In the old implementation, it checked only on the first part of the type's qualified name, causing void QList::erase(QList::iterator) -> void QList::erase(QList<T>) Rewrite the function to operate with QStringLists so that a full match can be performed. Task-number: PYSIDE-323 Change-Id: I27900916e864d9451cc588c3ade311fbb033665c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Generators: Exclude functions using rvalue referencesFriedemann Kleint2017-03-024-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a convenience function to check and use that in the generators. Task-number: PYSIDE-323 Change-Id: Iccd2907bb8f41d212087984a35a2b5efa7121546 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Add a test for forward-declared inner classesFriedemann Kleint2017-03-012-0/+27
| | | | | | | | | | | | | | | Change-Id: I0e670b54c978c43ccad2563e6801b6f834587da3 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * AbstractMetaType::cppSignature(): Format rvalue-references correctlyFriedemann Kleint2017-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | actualIndirections() so far ignores rvalue-references. Amends change 80fef1705ca23be01edbb12ece1b8bd49473bafe. Task-number: PYSIDE-323 Change-Id: Ieca0c4d3cac62030cb02254c8d72e9f93cb08a2b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Revert "traverseOperatorFunction(): Do not strip argument off unary member ↵Friedemann Kleint2017-02-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | operators" This reverts commit a45049999520f3981c83964db4ae81c8123e48ee. The change caused unaryoperator_test.py to fail, operator-(QPoint) no longer worked. Change-Id: I9707e6e89222fb9cfeb20689d168540dd45953de Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * AbstractMetaFunction: Make FunctionType enumeration more fine-grainedFriedemann Kleint2017-02-289-55/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add CopyConstructorFunction, MoveConstructorFunction, AssignmentOperatorFunction and MoveAssignmentOperatorFunction. Add code to determine the type at the bottom of AbstractMetaBuilderPrivate::traverseFunction(). This prevents those special functions from appearing in the list of conversions and operators, causing cyclic dependencies. Task-number: PYSIDE-323 Change-Id: I57c24024cb949dfed96341172f85b67f9f82a17c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Refactor AbstractMetaType::decideUsagePattern()Friedemann Kleint2017-02-282-78/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split out the const-part into a new function AbstractMetaType::determineUsagePattern() const to improve code clarity. Task-number: PYSIDE-323 Change-Id: I2ef66c3c828c601b1c715e4585501e231f688873 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Handle rvalue references throughoutFriedemann Kleint2017-02-2815-80/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the reference type enumeration from class TypeInfo to a common header and use that in all classes representing a type. Task-number: PYSIDE-323 Change-Id: I8eecf76efd8b5daf0230161a224e16e218ebbf8d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Add a debug operator for OverloadDataFriedemann Kleint2017-02-242-0/+41
| | | | | | | | | | | | | | | | | | Task-number: PYSIDE-323 Change-Id: I8b06870d4d7ccaab95827f068375626a501496b1 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Make error message about cyclic overload dependencies more verboseFriedemann Kleint2017-02-241-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | Collect and output all implicit conversions involved. Task-number: PYSIDE-323 Change-Id: I166cb8bd9ea157d07444772ba341195327c0061e Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Add ‘getAllValidWrappers’ test function to shibokenChristian Tismer2017-02-242-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function was developed in 2012 by John Ehresman. One of his bug reports uses this function. To be able to test the applicability of his issue PYSIDE-150, I thought it makes sense to add this function, again. Task-number: PYSIDE-150 Change-Id: Ie35b5a87ac9c0edfd303b1790eb8695a09b8d8e4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Remove memory leak in shibokenChristian Tismer2017-02-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a harder to find memory leak reported in early PySide 1 times which was still valid in PySide2. I used two scripts which were different by only one line and showed very different memory behavior. With valgrind, I ran both scripts in parallel, and after some tweaking, the valgrind logfiles of the two runs could be compared. The result was a clear indicator that some new call was never disposed of. It turned out that the error was a mis-placed ‘delete’ in basewrapper.cpp of shiboken2. Task-number: PYSIDE-205 Change-Id: I1897ec4e75e3ec887716bdbe0f4487176530e03c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * cppgenerator.cpp: Remove generation of Qt 4.7 version checkFriedemann Kleint2017-02-231-3/+2
| | | | | | | | | | | | | | | Change-Id: I8fbca647cc287e3762e54f4d9071b9a31fac376c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * traverseOperatorFunction(): Do not strip argument off unary member operatorsFriedemann Kleint2017-02-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comparison operators like bool operator==(Foo lhs, Foo rhs); are rewritten as class Foo { bool operator==(Foo rhs); and attached to the class. This handling causes existing member operators class QLine { bool operator==(QLine); to be stripped to class QLine { bool operator==(); causing crashes later on. Prevent by checking the argument count. Task-number: PYSIDE-323 Change-Id: I1d566192408404324e25a892db7094679cb81ab7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * TypeParser: Change qFatal() into error returnFriedemann Kleint2017-02-223-15/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to obtain an error message and print it from where it is used, for example: TypeParser: Unable to parse "typename QtPrivate::QEnableIf<QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1, QMetaObject::Connection>::Type": : Unrecognized character in lexer at 79 : '=' Task-number: PYSIDE-323 Change-Id: I6b6348f9087a1e0d7932daefddb2f3633d284c63 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * AbstractMetaBuilderPrivate::traverseDom(): Fix crashFriedemann Kleint2017-02-221-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AbstractMetaBuilderPrivate::traverseOperatorFunction() would crash when encountering: class QTreeWidgetItemIterator { public: inline QTreeWidgetItem *operator*() const; since it expects operator* with arguments. Rewrite the code compiling the list of operators filtering out the ones without arguments. Task-number: PYSIDE-323 Change-Id: I16fb8a15f892d385713a7487f9d996d6488954b7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Improve debug output of type databaseFriedemann Kleint2017-02-213-3/+46
| | | | | | | | | | | | | | | | | | | | | | | | Also output includes and templates. Task-number: PYSIDE-323 Change-Id: I01ad264cb3b33327446a5f52647c3d00e86c5c72 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Output file name in debug operator of _CodeModelItemFriedemann Kleint2017-02-211-0/+3
| | | | | | | | | | | | | | | | | | Task-number: PYSIDE-323 Change-Id: I6ac1fc7eef5083cdd31d8ea99c9bbbecf5936b98 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * samplebinding: Remove non-existing header "objecttypereference.h"Friedemann Kleint2017-02-171-1/+0
| | | | | | | | | | | | | | | | | | Task-number: PYSIDE-323 Change-Id: If38e5b8f1677acc0fe808a10799872426dd112f3 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * AbstractMetaBuilder: Fix type checkFriedemann Kleint2017-02-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AbstractMetaBuilderPrivate::fixReturnTypeOfConversionOperator() is supposed to apply some changes to a conversion operator like class A { operator int() const; }; The old C++ parser has a bug in that it creates this as a function of return type "A" instead of "int" and this is also checked at the top of the function. Remove the check since that causes the function to not do anything if the correct type "int" is passed. Task-number: PYSIDE-323 Change-Id: I19e5b83599dccd5737209dd2e92064e80e8a506d Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Fix unique code model itemsFriedemann Kleint2017-02-022-22/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add _NamespaceModelItem::uniqueNamespaces() returning a QSet of unique namespaces via QSharedPointer::operator< instead of repetitively sorting in AbstractMetaBuilderPrivate. Remove the sorting for classes as it is not needed. Task-number: PYSIDE-323 Change-Id: I0bc62bd8a44a99ca33a6499d64f7d5ab8f590a82 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Code model: Change _ScopeModelItem::m_classes from QHash to a QListFriedemann Kleint2017-02-014-33/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, for a template "vector<T>", two entries were made into the hash for "vector<T>" and "vector" so that the class would be found when looking up "vector" from its member methods. Replace that by a search predicate in _ScopeModelItem::findClass(). Task-number: PYSIDE-323 Change-Id: I404c096cde73154e8cbb5c2179b5b466bdd505be Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Code model: Change some QHash instances to QListFriedemann Kleint2017-02-014-83/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usage of QHash causes the order of the members to be non-deterministic and makes it hard to compare the generated code. Use QList instead where it is easily possible. Task-number: PYSIDE-323 Change-Id: I7fc139c382b254cfc73c8d770c0a4a69dc220607 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Code model: Fix coding styleFriedemann Kleint2017-02-012-276/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the m_ convention for member variables and make inline setters and getters one-liners for better readability. Task-number: PYSIDE-323 Change-Id: I59583e299bd499f7c966d20e35acfa870c6affc1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Code model: Remove unused functionsFriedemann Kleint2017-02-012-129/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused remove() functions and setters and other left-overs. Task-number: PYSIDE-323 Change-Id: Icb815da21422c8989de0103631633b63c1d65f4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * TestRemoveOperatorMethod::testRemoveOperatorMethod(): Fix argument typesFriedemann Kleint2017-02-011-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Replace signed short/int by short/int, respectively. Task-number: PYSIDE-323 Change-Id: I272b7dbff89e001de7f6e39f12ae1cd212dd4ea8 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Fix build with MSVC2013Friedemann Kleint2017-01-304-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * TypeInfo: Introduce enumeration for reference typesFriedemann Kleint2017-01-274-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace bool by an enumeration containing RValueReference as introduced in C++ 11. The old parser only handles LRValueReference. Task-number: PYSIDE-323 Change-Id: I87779a4cbf062b242e94321d59c0e0a5a9ab3cdf Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Add manual test dumpcodemodelFriedemann Kleint2017-01-274-1/+84
| | | | | | | | | | | | | | | | | | | | | | | | Add a test to dump out the code model contents of a source file. Task-number: PYSIDE-323 Change-Id: Ie74c6bbbf31595600ab4c15678d961a57b7065cf Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * Code model: Remove "auto" keywordFriedemann Kleint2017-01-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "auto" cannot be used until we switch to C++ 11. Also use begin(), end() to stay compatible with Qt 5.5.1. Amends change 4e91c0f1744288df752809e2ff1ced753dbb6b4b. Change-Id: I51af7f619c148849bc5164ea48ac1903d7443c9c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Fix compiling with Qt 5.5.1Alexandru Croitor2017-01-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | QDebug::verbosity was added in Qt 5.6, and this causes failures when compiling with Qt 5.5.1. Change-Id: I02dfc69dbbbf8088b4400cc227bc2b4644bc26fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Add debug output to the code modelFriedemann Kleint2017-01-232-0/+303
| | | | | | | | | | | | | | | | | | | | | | | | Add virtual formatting functions and debug operators. Task-number: PYSIDE-323 Change-Id: I32837d239180cef5468fc1aa718db0a8542e6e5b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Code model: Rename TypeAliasModelItem to TypedefModelItemFriedemann Kleint2017-01-2014-125/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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>
| | * Initialize _EnumModelItem::_M_anonymousFriedemann Kleint2017-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Amends change a7877f55316c5d8d07ccc0db6bbe95450505b421 Task-number: PYSIDE-323 Change-Id: Icc1a59da0603146e13c1f64015415d5dd783a7cd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Add debug output to type databaseFriedemann Kleint2017-01-204-0/+93
| | | | | | | | | | | | | | | | | | Task-number: PYSIDE-323 Change-Id: I306ccbb3a1c69e00129f5cc17626b502f79ed191 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Add verbose debug output to AbstractMetaFunctionFriedemann Kleint2017-01-202-4/+47
| | | | | | | | | | | | | | | | | | Task-number: PYSIDE-323 Change-Id: I347ba0f0bb3e9676b249524931fd2877fbcdd49a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Add a few checks to testsFriedemann Kleint2017-01-202-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Catch a few crashes in case the underlying code parser does not fully work. Task-number: PYSIDE-323 Change-Id: I91f7cc0470bc919e5e0277370de0dc4e7687aa94 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * _CodeModelItem-derived classes: Add out-of line destructorFriedemann Kleint2017-01-172-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Clang warnings about vtable being emitted into each compilation unit due to the non-existence of any out-of line virtual methods. Change-Id: Ie95f698ce5297211fcca79b37a1dceb93b83bbfc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * Fix some warnings related to class TypeInfoFriedemann Kleint2017-01-171-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Removed copy constructor due to Clang warning about missing assignment operator for usage in QList. - Moved flags member variable down to to avoid padding. Change-Id: I5e17c715cadf88b313c26a4ba2c25dedbf69abcb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * libshiboken: Remove some C-style castsFriedemann Kleint2017-01-179-64/+70
| | | | | | | | | | | | | | | | | | | | | Replace by C++ casts. Change-Id: I20d88ff021c681e63a6a4328c3402308f8c188e5 Reviewed-by: Christian Tismer <tismer@stackless.com>
| | * _CodeModelItem: Use Q_DISABLE_COPYFriedemann Kleint2017-01-161-47/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add Q_DISABLE_COPY to base class and remove private copy constructors and assignment operators in derived classes which are redundant. Task-number: PYSIDE-323 Change-Id: I25b0db500258f49d1068e27ea1785aebf469f958 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>