summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | 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>
* Optimize moc: Remove temporary allocations during macro expansion.Milian Wolff2015-07-132-10/+7
| | | | | | | | | | Previously, a temporary list was allocated and then fed into the bigger list of results. Now, we push data into the final list directly, removing the overhead of the temporary allocation. Change-Id: I9bea0fd3c23b1434b4be2728c60ac22a66908efc Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Optimize moc: Implement fast operator== for Symbols.Milian Wolff2015-07-101-1/+4
| | | | | | | | | | Previously, this allocated temporary QByteArrays in the frequent QVector<Symbols>::indexOf calls (macro.arguments.indexOf(s)). Now, the we reuse the fast SubArray::operator== implementation. Change-Id: Idbc6e3cf5fd353e8e36d51ba88d31e4c3bfd121d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* moc: Fix crash parsing invalid macro invocationOlivier Goffart2015-05-301-3/+5
| | | | | | | | | | | | | | When invoking a macro with less argument than it expect, we would crash trying to access the vector of arguments from the invocation as we are trying to substitute an argument. (Note that we do not show an error in case of argument mismatch because ithat might happen parsing valid code as moc's c++ parser is not 100% accurate (that was QTBUG-29331)) Task-number: QTBUG-46210 Change-Id: I3f08d7f5049e593a5bdc02a594ea63cadf66e7a4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* moc: Generate qt_static_metacall for creatable-only gadgetsGabriel de Dietrich2015-05-131-1/+2
| | | | | | | | | Prior to this, moc would not generate the function unless the gadget class had a property or a non-constructor invokable. Change-Id: Ic020ea5f8f59702f5e9e194a46e26850e53e5cfe Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* moc: Fix type for gadget's CreateInstance metacallGabriel de Dietrich2015-05-131-1/+2
| | | | | | | | | | | | An error similar to the one below would be emitted by the compiler on the moc generated file: error: assigning to 'QObject *' from incompatible type 'Gadget *' if (_a[0]) *reinterpret_cast<QObject**>(_a[0]) = _r; } break; Change-Id: I75ae7bd6c46d20db2d47a80eaa08aae302d7d6c8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Moc: test if superclass list is not empty before accessing first()Jacek Całusiński2015-04-271-1/+2
| | | | | | | | | | Accessing QList().first() with an empty superclassList caused assertion fail. Added check to fix it. Change-Id: I1aff35e0d267fc0e670beadba1bd196b175a4da8 Co-authored-with: Olivier Goffart <ogoffart@woboq.com> Task-number: QTBUG-45790 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Work around MSVC warnings about unused variables in moc outputKai Koehne2015-04-151-0/+3
| | | | | | | | | Change 8836a4d5f0fbbb already added Q_UNUSED in one place, but that was not enough. Change-Id: Ib98ba3fe47c0903cc01c56fd3eb8461c8938c75e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge dev into 5.5Oswald Buddenhagen2015-02-232-2/+2
|\ | | | | | | Change-Id: Id6dbbbfc542c214fe695c6795c6aaf23aedc1cd1
| * Fixed license headersJani Heikkinen2015-02-172-2/+2
| | | | | | | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Output the JSON binary data with printable charactersThiago Macieira2015-02-171-1/+7
|/ | | | | | | | | | | This makes it easier to debug QJsonDocument binary bugs. Note that the last character is never printed as printable, but by way of construction it's always binary data anyway (the offsets table is at the end after parsing JSON sources). Change-Id: I8a7a116f51864cecb52fffff13bc24ad01ad8a49 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-131-2/+2
| | | | | | | | ...where passing them by value was not intentional. Change-Id: Ifd5036d57b41fddeeacfbd3f5890881605b80647 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-1121-179/+163
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Introduce Q_ENUM and Q_FLAG macrosOlivier Goffart2015-01-134-2/+8
| | | | | | | | | | | | | | In replacement for Q_ENUMS and Q_FLAGS. Q_ENUM(Foo) has to be put after the declaration of Foo in an object. It will tell moc to include the enum in the meta object (just like Q_ENUMS) and will allow templated code to get the metaobject for that enum. Will be used by QDebug and QMetaType Change-Id: Iefaf8ae07dc0359828102bf384809346629b3e23 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* moc: Don't link to inexistent parent staticMetaObjectGabriel de Dietrich2015-01-132-1/+7
| | | | | | | | | | | | | Contrarily to Q_OBJECTs, Q_GADGETs are not guaranteed to descend from a Q_GADGET. Here, we ensure that if the first superclass is a Q_GADGET, then the derived class will be treated as one. This allows gaps in the Q_GADGET hierarchy while preventing from trying to link to the inexistent staticMetaObject if there's no such ancestor. Change-Id: If10fb952e23655102a425bb18fe8babaf447a47f Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* moc: Work around 'unused variable' MSVC warningKai Koehne2015-01-091-1/+2
| | | | | | | | | | | | MSVC prints warnings if all slots are actually static methods: moc_xxx.cpp:71: warning: C4189: '_t' : local variable is initialized but not referenced This can be easily avoided by using Q_UNUSED. Change-Id: Ice134a8a8d3e6aef1df1e7a89e9a2867281580fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix maximal literal string limitation in moc.Jędrzej Nowacki2014-12-071-9/+25
| | | | | | | | | C++ standard advise to place 64k char limit for string literals, this patch improves moc output so it is not affected anymore. Task-number: QTBUG-36500 Change-Id: Iece630faaef45baebe8c7afe4fc51e0362c713de Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-242-15/+11
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b