summaryrefslogtreecommitdiffstats
path: root/src/tools
Commit message (Collapse)AuthorAgeFilesLines
* Build fix with defined DEBUG_MOCJędrzej Nowacki2014-04-252-370/+211
| | | | | Change-Id: I365feceda20625e95503eb5acfa58fc89bd3720a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update copyright year in tools outputKai Koehne2014-03-313-6/+6
| | | | | | Change-Id: I9ee9604303b3cb29f89a4252df5af35e729f6249 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Doc: Update year to 2014Kai Koehne2014-03-272-2/+2
| | | | | | Change-Id: Iae2f31232fb364b26aa4da99048d92c262b4fdec Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QDoc: Doc: Use correct terminology ("signal" vs. "signal handler")Sze Howe Koh2014-03-261-12/+9
| | | | | Change-Id: I0c6cdc77296b8a1a759671bac2c920bc05d0cbcb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: Improve navigation bar for example filesTopi Reinio2014-03-091-13/+13
| | | | | | | | | | | | | | | | | | | | For example file pages, added a link to the parent example page into the navigation bar. Also, - Removed protectEnc() calls for strings added as Text atoms, this is done automatically when generating the navigation bar output, and doing it twice results in malformed output. - Removed the subtitle from being appended to example file title. The subtitle contains the full path of the file and it's already displayed on the page body, so removing it from the html title + navigation bar makes for a cleaner look without losing any information. Task-number: QTBUG-33022 Change-Id: I3ca942470453379e22f1a4aaec1d9b866d85bb5c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QDoc: Do not warn about a file overwritting while writing to /dev/nullJędrzej Nowacki2014-03-061-1/+1
| | | | | | Change-Id: I7d23edf5a73d521bad361f1007be0750acd4c1e9 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix some typosSergio Ahumada2014-03-031-1/+1
| | | | | | Change-Id: I7dbe938bff5ac3ab50a0197f94bdb2f6c22fbd16 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Doc: Removed Contents listing for Qt Examples and Tutorials page.Jerome Pasion2014-02-201-1/+1
| | | | | | | | | -Qt Examples and Tutorials page does not need the table of contents. Task-number: QTBUG-36838 Change-Id: Id51ebc7cba7831a24cd9d8e8e6bde7f96bece326 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-171-14/+26
|\ | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h Change-Id: I03d8b6e07135056baaa1d97c3c63fbe8b25583d9
| * moc: Fix parsing of operator<Olivier Goffart2014-02-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | moc would skip the 'operator' keyword as unknown and try to parse a type again but as it sees the '<' it looks for the corresponding '>' which does not exist types can't start with '<' anyway, so return an invalid type and continue parsing as usual Task-number: QTBUG-36834 Change-Id: If3d27076ef9947abf8c57c594713eece9334d0b0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| * Make parsing of template arguments more robust.Olivier Goffart2014-02-141-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At first, my goal was just to fix Moc::until() to parse properly template arguments containing expressions containing > or >> such as Foo<(8>>2)> But with the test, I realized that normalizeType also requires change not to split the > > too much. And QMetaObjectPrivate::decodeMethodSignature should not interpret the ) within the template parameter as the end of the function. Change-Id: Ia9d3a2a786368aeda1edcf66280d70f64cf05070 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-122-7/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qimage.cpp src/gui/text/qtextengine.cpp src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/printsupport/kernel/qprintengine_win.cpp Change-Id: I09ce991a57f39bc7b1ad6978d0e0d858df0cd444
| * Document `moc -f<...>` behavior change in Qt-5.2.0David Faure2014-02-111-1/+1
| | | | | | | | | | | | | | | | Better late than never :) Task-number: QTBUG-33749 Change-Id: I5035255e66a56754b609441f5b81ab119565a7cb Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * qdoc: fix memory leaks, unchecked open(), hardcoded path - in debugging codeDavid Faure2014-02-101-6/+5
| | | | | | | | | | | | | | Change-Id: I3b065dd18f60214a858543d062dfb2f0f1dc1b36 Reviewed-by: Laurent Montel <laurent.montel@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Enable categorized logging for bootstrapped toolsKai Koehne2014-02-111-0/+2
| | | | | | | | | | Change-Id: Ie908a175bda103fd8d73031024a823a4c4d3dbb7 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-074-11/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| * Merge "Merge remote-tracking branch 'origin/release' into stable" into ↵Frederik Gladhorn2014-02-041-1/+2
| |\ | | | | | | | | | refs/staging/stable
| | * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-02-031-1/+2
| | |\ | | | | | | | | | | | | Change-Id: I625c46b86491fee66d39494d1466b2d616ea7380
| | | * qdoc: Never use a collision page as a main QCH landing pagev5.2.1Topi Reinio2014-01-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When writing the main/landing page for a documentation set to a .qhp file, check that it's not a collision page. If it is, default to 'index.html' instead. Task-number: QTCREATORBUG-11035 Change-Id: I0269834f6e50fcf5ae779c026263e69e4c3cd7b6 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * | | Doc: Fix broken linksSze Howe Koh2014-02-042-5/+3
| |/ / | | | | | | | | | | | | Change-Id: Ic275dfbf0b332fc34ea0fac1c31c4935ad961527 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| * | qdoc: Fix crash in Generator::generateInnerNodeAlbert Astals Cid2014-01-221-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using an iterator is not a good idea since the generateInnerNode can end up adding new items to the childrenNode list and thus the iterator becomes invalid Without this patch i was getting this trace in valgrind ==19251== Invalid read of size 8 ==19251== at 0x474350: Generator::generateInnerNode(InnerNode*) (generator.cpp:1018) ==19251== by 0x4A422D: HtmlGenerator::generateTree() (htmlgenerator.cpp:276) ==19251== by 0x4AC369: processQdocconfFile(QString const&) (main.cpp:515) ==19251== by 0x40B894: main (main.cpp:669) ==19251== Address 0x943c1c0 is 0 bytes after a block of size 32 free'd ==19251== at 0x4C2C72E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==19251== by 0x51676F2: QListData::realloc(int) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.0) ==19251== by 0x51677EE: QListData::append(int) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.0) ==19251== by 0x439BAB: QList<Node*>::append(Node* const&) (qlist.h:533) ==19251== by 0x4B46B3: InnerNode::addChild(Node*) (node.cpp:1262) ==19251== by 0x4B48DC: Node::Node(Node::Type, InnerNode*, QString const&) (node.cpp:179) ==19251== by 0x4B539F: InnerNode::InnerNode(Node::Type, InnerNode*, QString const&) (node.cpp:1193) ==19251== by 0x4B54EB: DocNode::DocNode(InnerNode*, QString const&, Node::SubType, Node::PageType) (node.cpp:1608) ==19251== by 0x4C0C5E: QDocDatabase::findQmlModule(QString const&) (node.h:535) ==19251== by 0x497EEA: HtmlGenerator::generateQmlRequisites(QmlClassNode*, CodeMarker*) (htmlgenerator.cpp:2005) ==19251== by 0x4995B9: HtmlGenerator::generateDocNode(DocNode*, CodeMarker*) (htmlgenerator.cpp:1533) ==19251== by 0x474508: Generator::generateInnerNode(InnerNode*) (generator.cpp:1010) ==19251== by 0x474372: Generator::generateInnerNode(InnerNode*) (generator.cpp:1019) ==19251== by 0x4A422D: HtmlGenerator::generateTree() (htmlgenerator.cpp:276) ==19251== by 0x4AC369: processQdocconfFile(QString const&) (main.cpp:515) ==19251== by 0x40B894: main (main.cpp:669) Change-Id: I7a6ae0a689ea5edddacf7f27f9dce95b26a441df Reviewed-by: Martin Smith <martin.smith@digia.com>
* | | moc: Make error message 'too many input files' more verbose.Friedemann Kleint2014-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | Make it easier to diagnose quoting errors in scripts. Change-Id: I17894a426faa5cdf50f5ace4ed422ab2bd202558 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Add comment to moc output to simplify slots flags reading.Jędrzej Nowacki2014-01-221-9/+22
| | | | | | | | | | | | | | | | | | Change-Id: I5b8f63b6fa561c108abed4c2726b3aff99144fe2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix lack of deterministic behavior in moc.Jędrzej Nowacki2014-01-221-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | Moc should check full scope of any related objects or gadget when it constructs extra data. Change-Id: Ibd1b607a389cd4e788c0916984464cd9103d9c59 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-01-216-36/+25
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-206-36/+25
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
| | * | moc: Fix parsing of complex defines defined via command lineOlivier Goffart2014-01-173-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since now in Qt5 the moc does full macro substitution, it needs to handle the defines passed is command argument, even if they span over multiple tokens, or if they do not have any token. Example: moc '-DCOMPLEX=QVector<int>' '-DEMPTY=' foo.h [ChangeLog][moc] Fixed passing -D of a macro defined to something more complex than a single identifier. Task-number: QTBUG-33668 Change-Id: Ie8131de215f1659a24af4778d52ee40cda19759f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| | * | qdocconf: Remove nonexistent dependencySze Howe Koh2014-01-151-1/+0
| | |/ | | | | | | | | | | | | Change-Id: I9d2f36102691a2bd8ab0697d20f6eac59d59a84f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| | * Fix to comply with Qt coding guidelinesKurt Pattyn2014-01-111-32/+19
| | | | | | | | | | | | | | | Change-Id: Ie6c62d3107d17e64c94fa01380b3b1d80f24d0de Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| | * Make qtbase compile with QT_NO_DOMTasuku Suzuki2014-01-101-0/+1
| | | | | | | | | | | | | | | Change-Id: I98bef84ca9bf86bf7dddd3ca2a3d8210a8e46a16 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | | Remove duplicated code from moc generatorJędrzej Nowacki2014-01-201-6/+0
| | | | | | | | | | | | | | | Change-Id: I0d603ac39068f796fc7397a74230d544a16e0371 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Do not close string data by a double null terminator.Jędrzej Nowacki2014-01-201-2/+3
|/ / | | | | | | | | | | | | | | | | There is no point in saving \0 twice. Any code that could relay on it is broken anyway, because moc saves \0\0 for an empty string. Change-Id: I28fa4f78aae8c883c088df43ec89d608a99b3bdd Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | move and build qlalrOswald Buddenhagen2014-01-2039-0/+6990
| | | | | | | | | | Change-Id: I852e1a33fc056a52f6dbba8aaf7dd75274bbe815 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Replace win32-g++ with mingw scopeKai Koehne2014-01-171-1/+1
| | | | | | | | | | | | | | | | Commit 773dd01 introduced a general mingw platform scope, which is cleaner and more flexible than matching the spec name. Change-Id: Ie3a9cb791a83f7c8a51bc4e23069190c452ab521 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | moc: Fix -Wsign-conversion warning in the moc generated fileOlivier Goffart2014-01-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is the warning it fixes: moc_foo.cpp:28:9: warning: conversion to ‘qptrdiff {aka long long int}’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion] - idx * sizeof(QByteArrayData) \ ^ qarraydata.h:282:49: note: in definition of macro ‘Q_STATIC_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET’ { Q_REFCOUNT_INITIALIZE_STATIC, size, 0, 0, offset } \ ^ moc_foo.cpp:26:5: note: in expansion of macro ‘Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET’ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ ^ moc_foo.cpp:33:1: note: in expansion of macro ‘QT_MOC_LITERAL’ QT_MOC_LITERAL(1, 23, 5), ^ [ChangeLog][moc][QTBUG-36128] Fixed sign conversion warning in generated file. Task-number: QTBUG-36128 Change-Id: Ibf00974dbfb419bb53a3109d93e4cee598bb0588 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-101-0/+5
|\| | | | | | | Change-Id: I99af0bef7f1c931533a324ebcfb27c40ee871a5e
| * Make qtbase compile with QT_NO_XMLSTREAMWRITERTasuku Suzuki2014-01-101-0/+5
| | | | | | | | | | Change-Id: I6d2447ba0875117e8a50d1aa3133bd5ea098d51a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | Windows/Windows CE: Do not dynamically load shell32/coredll.Friedemann Kleint2014-01-071-1/+1
| | | | | | | | | | | | | | | | | | Those libraries are contained in QMAKE_LIBS_CORE and GetSpecialFolderPath() is present in all supported versions. Change-Id: Iae40714e0f234625b063aeb50e29fc79c4aaa6ea Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-031-6/+16
|\| | | | | | | Change-Id: Id13badc270db98806048753fd7fb658aa17f1ede
| * qdoc: Fix Q_PROPERTY parsingTopi Reinio2013-12-311-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing Q_PROPERTY declarations, qdoc tries to always read an associated value for each matched keyword. This fails for property declarations including a CONSTANT or FINAL, as they have no associated values. This change fixes the above problem and makes the parsing more robust by checking the return value of matchProperty() and skipping to closing parenthesis in case of failure. Task-number: QTBUG-35722 Change-Id: Ia483b8e74aeef19b2e761b21473cd4f765cdca19 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Fix regression in property handling with enums from gadgetsSimon Hausmann2013-12-244-11/+24
| | | | | | | | | | | | | | | | | | | | When declaring a Q_PROPERTY(SomeType::SomeEnum foo ...) and SomeType is not a QObject but a gadget, then we must still include SomeType's meta object in the list of related meta objects. Task-number: QTBUG-35657 Change-Id: I46195140cb5d180c4f03bb1fe06a876e3fe11267 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-163-9/+13
|\| | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformtheme.h tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp Change-Id: Iecd3343d6a050b8764f78d809c4a1532aeba69e5
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-12-053-9/+13
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-ios-clang/features/default_post.prf tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp Change-Id: Iaba97eed2272bccf54289640b8197d40e22f7bf5
| | * qdoc: Fix output filenames for QML basic type documentationTopi Reinio2013-12-041-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qdoc intends to prepend all html files related to QML with a 'qml-' prefix. This doesn't work for basic QML types, as those nodes do not have valid qml module name information. This change fixes the issue by removing the requirement for a qml module name, thereby always using the qml prefix for a qml (basic) type. Task-number: QTBUG-35229 Change-Id: If61572b2dc8a39be08140c37aa59646b88e99b29 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| | * qdoc: Replaced hard-coded href with computed hrefMartin Smith2013-12-032-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For enum types that have QFlags versions, qdoc was outputting the documentation with a hard-coded link to qflags.html, which only workjed in the single directory mode. When qdoc outputs modular documentation, the href for the link should be "../qtcore/qflags.html" . Now qdoc computes this href correctly before it writes the docs. The href is no longer hard-coded. Task-number: QTBUG-35209 Change-Id: Ibdf5b11dbd063726eb77048de78f8874c65752ca Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Implement support for ref-qualified QString::toLatin1 & friendsThiago Macieira2013-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step in implementing an in-place conversion of QString to QByteArray. This requires ref-qualifiers in member functions so we know that we have an rvalue QString. Converting from UTF-16 to Latin1 always requires half the memory. For conversion from UTF-16 to UTF-8, the typical string will also need the same memory or less: characters from U+0000 to U+007F consume one fewer byte; characters from U+0080 to U+07FF and from U+10000 to U+1FFFFF occupy the same space in UTF-8 and UTF-16; it's only the ones from U+0800 to U+FFFF that consume more space in the UTF-8 string. For the locale's 8-bit codec, we can't be sure and the code (currently) needs to go through QTextCodec anyway. This requires a #define set before #include'ing "qstring.h". However, since qstring.h is included by the QtCore PCH, we need an extra qmake compiler without the PCH flags to compile this .cpp. After this change, the distribution of calls in QtCore, Network, Gui, and Widgets is as follows: const & && toUtf8 31 (74%) 11 (26%) toLatin1 79 (77%) 24 (23%) toLocal8Bit 26 (16%) 138 (84%) Change-Id: Idd96f9ddb51b989bc59f6da50054dd10c953dd4f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Fix erroneous exclusion of classes from related meta objects in mocSimon Hausmann2013-12-124-17/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assume an unrelated class that declares an enum and uses Q_ENUMS. Consider then a class that uses UnrelatedClass::Enum as a Q_PROPERTY. We used to include UnrelatedClass in the primary class's related meta objects, in order to support use-cases like obj->setProperty("enumProperty", "ValueOfEnumAsString"); If however moc happens to see Q_DECLARE_METATYPE(UnrelatedClass::Enum), then it would exclude it from the related meta objects, which would silently break the string based enum value conversion. This was meant as an optimization, but it isn't apparent to the developer why sometimes the string conversion would work and sometimes not (depending on whether somebody declares that macro). This also becomes visible in QML, which relies on the same embedded type information for enum assignments. This patch removes that check in moc's code generator and cleans up the code a little. However always including the prefix of Q_PROPERTY(SomePrefix::Enum ...) is not correct either, because it may be that SomePrefix is a namespace, which would cause compilation issues. Therefore we limit the inclusion of related meta objects only to Q_OBJECT decorated classes the moc has seen, and for these we save the fully qualified name in the related meta objects array (for QTBUG-2151). While this patch makes the previous workaround for namespace issues by using a Q_DECLARE_METATYPE not workable anymore, by saving the fully qualified name we are making a hopefully sufficient effort to not require a workaround in the first place. There's always the new workaround of fully qualifying the type in Q_PROPERTY. One side-effect of this change is that in the autoPropertyMetaTypeRegistration test of tst_moc, the CustomQObject for Q_PROPERTY(CustomQObject::Number enumValue ...) is now a related meta object, and therefore when querying for the type of this property via QMetaProperty::userType(), we are now aware of this being an enum and try to resolve CustomQObject::Number via QMetaType::type(qualfiedName). As there is no guarantee for this to succeed, we must now also do what is done in the non-enum code path in ::userType(), which is to call the moc generated type registration function. Task-number: QTBUG-33577 Task-number: QTBUG-2151 Change-Id: Ibf20e7421cba464c558a25c76a7e1eef002c6cff Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | moc: move qt_meta_extradata data from .data.rel into .data.rel.roMarc Mutz2013-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's still a relocation, but at least it can be marked read-only after the relocation run, if indeed the dynamic linker goes to such a length. Change-Id: Ibadddac3ab99d2e58cc32cfd57311bddd3bdb0ef Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-051-3/+8
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/sql/drivers/sqlite/qsql_sqlite.cpp Change-Id: Ia7cffd2c99ae3d5eea6b5740683c06e921336dcd
| * | qdbusxml2cpp: Use the mtime on the input XML to avoid needless source changes.Robin Burchell2013-11-301-3/+8
| |/ | | | | | | | | | | | | | | These can cause rebuilds unnecessarily when repeatedly running qdbusxml2cpp. Change-Id: I902954d4bed6fe68802183e51d82700fe30af437 Reviewed-by: Mathias Hasselmann <mathias.hasselmann@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>