summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
Commit message (Collapse)AuthorAgeFilesLines
* moc: support nested q_namespacesBogDan Vatra2016-09-281-6/+32
| | | | | | | | Nested namespaces are quite common, therefore moc should support them. Task-number: QTBUG-55415 Change-Id: I756cab36d498eb4342b402d255836d5d30f07b30 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* moc: Fix asserts on moc on empty token preceding ## operatorOlivier Goffart2016-09-161-3/+3
| | | | | | | | | | Regression introduced in c32ef0a725c7ac9d8a9ab053407389ef2fddc64e The expansion vector can be empty, in that case it is not allowed to call constLast() Task-number: QTBUG-55853 Change-Id: I47aa8eb7507ee91662215df42b4a66eebaa32bb5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Check the context of Q_ENUM[_NS] and Q_FLAG[_NS]BogDan Vatra2016-09-151-0/+12
| | | | | Change-Id: Ifc8cb50efe3b07a79c8afbb382fba12649b602b2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Parse namespaces only for current file, add Q_NAMESPACE support to qmakeBogDan Vatra2016-09-061-1/+2
| | | | | | | Parsing the other files will (re)generate the same metaobject info in two places Change-Id: I8984ed30751a7587de870f55dd427f067d1b2495 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge dev into 5.8Oswald Buddenhagen2016-08-225-200/+285
|\ | | | | | | Change-Id: I41ee7b50534b01cf042bed8bb8824ba2e5026a29
| * Say hello to Q_NAMESPACEBogDan Vatra2016-08-195-200/+285
| | | | | | | | | | | | | | | | | | | | | | | | Q_NAMESPACE is useful to add Q_ENUM_NS/Q_ENUMS, Q_FLAG_NS/Q_FLAGS and Q_CLASSINFO to a namespace. [ChangeLog] Added Q_NAMESPACE which can be used to add Q_ENUM_NS/ Q_ENUMS, Q_FLAG_NS/Q_FLAGS and Q_CLASSINFO to a namespace Task-number: QTBUG-54981 Change-Id: Ic61b972794063e77134681fb347d6c4acddcdb44 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Support C++17 fallthrough attributeAllan Sandfeld Jensen2016-08-192-6/+6
|/ | | | | | | | | Replaces our mix of comments for annotating intended absence of break in switches with the C++17 attribute [[fallthrough]], or its earlier a clang extension counterpart. Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-011-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure 5.7 now supports clang on android; but dev re-worked configure src/gui/kernel/qevent.h One side renamed a parameter of a constructor; the other added an alternate constructor on the next line. Applied the rename to both for consistency. tests/auto/tools/moc/tst_moc.cpp Each side added a new test at the end. .qmake.conf Ignored 5.7's change to MODULE_VERSION. configure.json No conflict noticed by git; but changes in 5.7 were needed for the re-worked configure to accommodate 5.7's stricter handling of C++11. Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
| * Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-261-0/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qtemporarydir.cpp One side encapsulated a repeated piece of #if-ery in a local define; the other added to the #if-ery. Made its addition to the other's. src/corelib/kernel/qeventdispatcher_unix_p.h One side moved some members into a struct; this collided with a #undef check that neither side now has. Discarded the #undef part. src/gui/opengl/qopengltexturehelper_p.h 5.7 deleted a bunch of methods; not clear why merge got confused. src/tools/moc/moc.cpp One added a name to the copyright header; another changed its URL. Change-Id: I9e9032b819f030d67f1915445acf2793e98713fa
| | * moc: fix infinite loop over malformed inputOlivier Goffart2016-07-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | We should not call prev() if we had already reched the end. Task-number: QTBUG-54815 Change-Id: I56bc86880a0dbfdce57fc4a08e5950f2ff3a5958 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | | moc: Add warnings when resolving and opening includes failsFriedemann Kleint2016-07-291-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only cryptic warnings: QFSFileEngine::open: No file name specified occurred. Task-number: QTBUG-55014 Change-Id: Ic99614eb58c605ed6e1b86d3d4b8f527c5b9244c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Add QMetaEnum::isScoped to be able to destinguish C++11 enum classOlivier Goffart2016-07-261-1/+6
| | | | | | | | | | | | | | | | | | Change-Id: I67b1dbd069fa57bd60e50690abb5d876edc0d1d2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/devEdward Welbourne2016-07-221-4/+4
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-191-4/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp qmake/library/qmakeevaluator.cpp qmake/library/qmakeevaluator.h qmake/project.h QMakeEvaluator: * evaluateConditional(): one side changed return type, the other changed a parameter type. * split_value_list(): one side changed a parameter adjacent to where ... * expandVariableReferences(): ... the other killed one overload and changed the survivor src/corelib/io/qlockfile_unix.cpp One side changed a #if condition, the other moved NETBSD's part of what it controlled. src/corelib/tools/qdatetime.cpp One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the other moved it from the private class to the public one, in the midst of the "short date-time" optimization, which confused diff entirely. One side changed a QStringLiteral to QLatin1String, the other rewrote adjoining code. src/network/kernel/qauthenticator.cpp Both rewrote a line, equivalently; kept the dev version. src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h One side changed #if-ery that the other removed. tools/configure/configureapp.cpp One side added a check to -target parsing; the other killed -target. tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml tests/auto/testlib/selftests/expected_cmptest.xunitxml Regenerated using generate_expected_output.py I note that quite a few other expected_* come out changed, now. There was no git-conflict in src/widgets/kernel/qformlayout.cpp but it didn't compile; one side removed some unused methods; the other found uses for one of them. Put FixedColumnMatrix<>::removeRow(int) back for its new user. Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-151-4/+4
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp One side changed the iterator to use ranged-for, the other changed its body; they only conflicted because the latter had to add braces around the body, intruding on the for-line. Trivial resolution. Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
| | | * moc: Fix a crash with malformed inputOlivier Goffart2016-07-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not increment 'data' past the buffer in case of invalid token. Remove the left over qDebug so we can make a test. Task-number: QTBUG-54609 Change-Id: I8f0dd3381fbdea3f07d3c05c9a44a16d92538117 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | | | Make moc obey the preprocessor environment variable for include pathsThiago Macieira2016-07-201-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C preprocessors augment their standard list of include paths from the environment: Unix preprocessors use $C_INCLUDE_PATH (for C) and $CPLUS_INCLUDE_PATH (for C++), plus CPATH for both, whereas MSVC uses the an environment variable simply called "INCLUDE". Handling this for MSVC is particularly important because the VCVARSALL.BAT script sets the necessary #include paths in the environment for important things. Without that being parsed, moc won't find some #defines, like WINAPI_DESKTOP_FAMILY. [ChangeLog][moc] qmake and moc now cooperate to use the Visual Studio environment variables (set by the VCVARSALL.BAT script) to find system include files. A possible consequence is that moc parses application headers slightly differently, depending on #if conditions that depended on macros that previous versions had not seen #define'd. Implementers of other buildsystems are advised to pass the --compiler-flavor=msvc option to moc. Change-Id: I7e06274214d1939b0124e5b4bf169cceaef9ca46 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | moc: get the system #defines from the compiler itselfThiago Macieira2016-07-203-26/+50
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for moc to properly parse #ifdefs and family, we've had QMAKE_COMPILER_DEFINES as a list of pre-defined macros from the compiler. That list is woefully incomplete. Instead, let's simply ask the compiler for the list. With GCC and family, we use the -dM flag while preprocessing. With ICC on Windows, the flag gains an extra "Q" but is otherwise the same. For MSVC, it requires using some undocumented switches and parsing environment variables (I've tested MSVC 2012, 2013 and 2015). The new moc option is called --include to be similar to GCC's -include option. It does more than just parse a list of pre-defined macros and can be used to insert any sort of code that moc needs to parse prior to the main file. Change-Id: I7de033f80b0e4431b7f1ffff13fca02dbb60a0a6 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Don't error out on preprocessor concatenation of two stringsLars Knoll2016-07-131-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "foo" ## "bar" doesn't make a lot of sense, but MSVC allows them (although gcc errors out on them). Simply ignore the ## in this case instead of aborting with an error. Fixes parsing of the Windows winsock2.h header. Task-number: QTBUG-54560 Change-Id: I84cd5fbb56a006cf379430708c955cf0da475cff Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | moc: remove _MSC_EXTENSIONS #defineThiago Macieira2016-07-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we obviously don't support Microsoft's extensions in C++. This is required because some MS headers have code that isn't proper C++, like iso646.h: #if !defined(__cplusplus) || defined(_MSC_EXTENSIONS) #define and && Change-Id: Ib57b52598e2f452985e9fffd145a3d4ec28e773d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-233-7/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/wince80colibri-armv7-msvc2012/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/corelib/global/qnamespace.h src/corelib/global/qnamespace.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/tools/tools.pri src/network/ssl/qsslconfiguration_p.h src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/plugins/platforms/windows/windows.pri src/src.pro src/tools/bootstrap/bootstrap.pro src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/dialogs/qfilesystemmodel.cpp tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-192-6/+8
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| | * Moc: fix crash when a file ends with \\\rOlivier Goffart2016-05-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make the 'cleaned' more robust by making sure we do not read past the buffer in some cases. We must also use resize and not reserve on the outpt buffer because reseve is meant as a hint and we are not supposed to write past the size of the QByteArray even if it is reserved. [ChangeLog][moc] Fixed crash on file ending with \\\r Task-number: QTBUG-53441 Change-Id: I901e6c0ffc7f8877de3d07fd08cf26495461d294 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Robert Loehning <robert.loehning@qt.io>
| | * Fix moc warning detected by ICCThiago Macieira2016-05-091-4/+4
| | | | | | | | | | | | | | | | | | | | | moc.cpp(385): error #187: use of "=" where "==" may have been intended Change-Id: Ibb6ef27030762cbe4f7c7002581a0955f0f9086d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | qmake/tools: port the last remaining Q_FOREACH loops and add QT_NO_FOREACHMarc Mutz2016-05-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port the last four remaining Q_FOREACH users in qmake and uic to C++11 range-for and mark all qtbase tools (incl. qmake) as Q_FOREACH-free, using QT_NO_FOREACH. Change-Id: Ief4e5877269e7a853e4cf05e58861a448e822d3d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-123-58/+44
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * | Moc: use QStringBuilder moreAnton Kudryavtsev2016-04-203-58/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding strings in a single expression gets mediated efficiently by QStringBuilder, where using += repeatedly forces premature consolidation. Change-Id: I6c1abb9c9801a016ce6c151cffdf8c7ac9502f4e Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-034-28/+28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/double-conversion/include/double-conversion/utils.h src/corelib/global/qnamespace.qdoc src/corelib/tools/qsimd_p.h tests/auto/corelib/io/qfile/tst_qfile.cpp Change-Id: I3ca1007bab5355d251c13002a18e93d81c254d34
| * | Moc: use const (and const APIs) moreAnton Kudryavtsev2016-04-184-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: Iefc33552d826aa30320e52acd2d421c9bdae127e Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Moc generator: avoid creating QMap::keys().Anton Kudryavtsev2016-04-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Iterate the keys directly off the QMap itself. Change-Id: I7792414db250d8ae63a935513a16a01eb184ebde Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | moc: Use QCommandLineParser::ParseAsLongOptions and ↵Olivier Goffart2016-04-281-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | QCommandLineOption::ShortOptionStyle So the command lines is more compatible with compilers flags. And new options like -isystem can be used. Change-Id: I7ad0997e5dab7d0425f12cde415abae6e9034a5b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-041-0/+2
|\| | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| * moc: bail out early on missing or invalid options fileJoerg Bornemann2016-03-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | If moc is invoked with the @ argument and no options file is specified or the options file cannot be read, do not try to parse the empty arguments list. Otherwise QCommandLineParser will print an additional error message that is of no value for the user. Task-number: QTBUG-51847 Change-Id: I9aa1eb20a44097b553123be8bc6fded87473a03a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | moc: replace inefficient QLists with QVectorsMarc Mutz2016-02-104-29/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These types are larger than a void*, so holding them in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking them movable, and holding them in a QVector instead. Change-Id: I42f494ed87854eadc33d78db4479203ff5e0370f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/dbus/qdbusconnection_p.h src/dbus/qdbusintegrator.cpp src/dbus/qdbusintegrator_p.h tests/auto/corelib/io/qdir/qdir.pro tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
| * Speed up QObject::connect with function pointersSimon Hausmann2016-01-221-0/+1
| | | | | | | | | | | | | | | | | | When resolving the signal/slot of connect(&Foo::bar, ...) we place a meta-call to map the address to the method index. Once we have found the index, we don't need to continue but can return the result right away. Change-Id: I67bb22df394d7c22dc1731367c0961b958ed77b3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | moc: eradicate all Q_FOREACH loopsMarc Mutz2016-01-262-21/+38
| | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for, or, for loops over .keys() or .uniqueKeys(), with explicit iterator loops. Saves 2300b in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I6e1d4f5e56895dfd74aba21a3d4e913b5825645c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | moc: simplify finding required Qt containersMarc Mutz2016-01-261-28/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code searched for any Qt containers by looking at - each class definition - each property's type - each function (signal, slot, method) - each argument type and matching each against "Container<", building the pattern string each time through the loop. It would then collect hits in a QSet to be converted to a QList and sorted at the very end. The new code pulls the iteration over the candidates out of all other loops. By doing so, it can stop looking at classes, properties, functions etc when it finds the first hit, and it inserts every candidate at most once. By iterating over the statically-known list of candidates, the result is not a sorted set of Qt containers, as before, but it still has s fixed order across runs, which was the purpose of the sorting in the original code. In the implementation, make liberal use of C++11 range-for, which is safe, as we're passing everything around as const. Change-Id: If76dd3f57aa1b544a9cf1de2dca94ca7999220f0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-2121-357/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Moc: fix duplicate condition in AND expressionAnton Kudryavtsev2016-01-121-1/+1
| | | | | | | | | | Change-Id: I0c0e69aecdb7a15228d44688116a88b6afb44a50 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | moc: replace a QStack<QByteArray> with std::stack<QByteArray, QByteArrayList>Marc Mutz2015-12-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QByteArrayList is almost as efficient as a QVector<QByteArray>. More importantly, the QByteArrayList case can share code with the myriad of other QByteArrayList users, in particular because std::stack is but the thinnest of wrappers around its underlying container. For moc, saves almost 1KiB in text size on optimized GCC 4.9 Linux AMD64 builds. For qdbuscpp2xml, which re-uses moc code, saves ~1.6KiB. Change-Id: I861e92b3c79e47e0ce892ccf54c9041182aaf212 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Optimize moc: Preallocate space for list of preprocessed symbols.Milian Wolff2015-12-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this, the symbol list is frequently reallocated. The value is a guestimate. It corresponds to a block of memory with the size 262144 * 3 * 8 byte = ca. 6.3 megabytes on a 64 bit machine. Looking at the final size of the symbol list, this seems to fit the common case nicely. Change-Id: Ib546a1ea479f2c6d8ab57be783cdf630f9b54f77 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-232-1/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf configure src/corelib/global/qglobal.h src/tools/qdoc/node.cpp src/tools/qdoc/qdocdatabase.cpp tests/auto/corelib/io/qsettings/tst_qsettings.cpp tools/configure/configureapp.cpp Change-Id: I66028ae5e441a06b73ee85ba72a03a3af3e8593f
| * moc: fix Q_PROPERTY with parentheses in their MEMBER clauseOlivier Goffart2015-10-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This was never a documented feature, but happended to work before Qt 5.5. It broke because the peoperty access went into the static function and are now prefixed with '_t->' So restore the behavior as it was by not including the parentheses in the member name. Task-number: QTBUG-47695 Change-Id: Ic3509ddea7ac9abc871e71f5bfbe81d04d08e9bc Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * Split two error cases so they get reported distinctly.Edward Welbourne2015-10-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a macro is used with too few parameters, complaining about its definition using '#' followed by something other than a macro parameter name is apt to be confusing - reading the definition will reveal that the name in fact is a macro parameter after all. The reader needs attention directed to the invocation, not the definition. Split the test in two: one to test the prior error message does in fact get produced for an invalid macro definition, the other to test the invalid invocation case. Task-number: QTBUG-46210 Change-Id: Ie177a56d346e553bf9d67e2008a4352633afa1ae Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Optimize moc: Preallocate some space for tokenization results.Milian Wolff2015-09-141-0/+5
|/ | | | | | | | The value was found by looking at the common ratio between input size and final size of the result list. Change-Id: I5762c15156afad4a7b8c1538e886058b3b5b0673 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* moc: Make toExpand const, we do not modify it.Milian Wolff2015-07-232-2/+2
| | | | | Change-Id: I7036ea7ee9e533670ebed425e6c4a8bb0063f751 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* tools: mark some types movable/primitiveMarc Mutz2015-07-221-0/+1
| | | | | | | They are held in QList or QVector. Change-Id: Ic0e379560e554e5cd3de4319e402ec1655e77874 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Optimize moc: Preallocate space for list of arguments on the stack.Milian Wolff2015-07-221-1/+1
| | | | | | | This removes the temporary QList allocations. Change-Id: I1f255e94730202f719e0a97b9ab4a83e28b805c1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Optimize moc: Remove another temporary list allocation.Milian Wolff2015-07-141-5/+5
| | | | | | | | | | | In the common case, macroExpandIdentifier was called in the "not a macro" case, and a temporary vector with a single item was allocated. Now, we catch this common case at the caller site and put the single item directly into the result set, bypassing the temporary list. Change-Id: I71d92afc486ccdaae5930405d028f53f48073b8c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>