summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobjectbuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Deduplicate offset calculation in QMetaObjectBuilderIvan Tkachenko2021-07-271-1/+1
| | | | | | | | | | | | Not even an optimization (unless your compiler sucks). Just improves readability, since offset is already calculated few lines above. Offset formula used to be somewhat more complicated, but since commit e58b44d557b859b7b55869f1e137aa1bc8968307 it became reusable here. Change-Id: I4128b2643daf2cb112c9b861342fd0e27c9a1a95 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMetaObjectBuilder: replace an int with QFlagsGiuseppe D'Angelo2021-05-131-3/+3
| | | | | | | | | The int was used as a flag the entire time, except in one stance. So just use the right QFlags type instead, and replace that one usage with a call to toInt(). Change-Id: I3670e6afdc244df69189dd15b8c2c34573476e2f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaMethod: Store method constness in metaobject systemFabian Kosmale2021-05-071-0/+22
| | | | | | | | | [ChangeLog][QtCore][QMetaMethod] It is now possible to query the constness of a method with QMetaMethod::isConst. Change-Id: I8a94480b8074ef5b30555aeccd64937c4c6d97d4 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Silence MSVC warning about int/size_t mismatchVolker Hilsheimer2021-05-061-2/+2
| | | | | | | | | | | | | | | Warning was qmetaobjectbuilder.cpp(1439): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Instead of adding another cast in that line, fix the warning by making the size variable a qsizetype, and remove the now unnecessary static_cast to int. Pick-to: 6.1 Change-Id: Ieff9330501f5a07c4bbe1e851a3ef211f8bf2d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Introduce QMetaObject::metaTypeFabian Kosmale2021-03-251-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function returns the metatype corresponding to the metaobject, or an invalid metatype for namespaces. This works as follows: First we increment the metaobject revision for new metaobjects. Metaobjects with older revisions are handled by doing a lookup by name. That fallback is also used for dynamic metaobjects (from QtDBUS and those created by QMetaObjectBuilder). For new metaobjects, we store the metatype in its metatype array, behind the property metatypes. This avoids any changes to the property and method metatype extraction logic: For properties, the metatype access does not change, as the new metatype is after their metatypes. For method metatypes, we already have an indirection layer (using offsets), so by adjusting those offsets by one, the same logic keeps working. To distinguish between namespaces and dynamic metaobjects, namespaces store the metatypeinterface pointer for void in the metatype array, whereas dynamic metaobjects store a nullptr. One nice additional benefit is that this simplifies the generator logic in moc, as the metatype array is now never empty. Task-number: QTBUG-92077 Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QMetaObjectBuilder: remove unused serialization codeFabian Kosmale2021-03-201-268/+0
| | | | | Change-Id: I73a13265a69079581d2974400b3311d3fdfda2d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaObjectBuilder: use constexpr ifFabian Kosmale2020-12-091-37/+43
| | | | | Change-Id: I23319c263447714b280e9ba9da72162e19fe4e1b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-301-3/+3
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QMetaProperty::typeName: use name from metatypeFabian Kosmale2020-11-301-7/+8
| | | | | | | | | | | | | | | Except for types marked as unresolved, we're doing it anyway - the only difference is that now we skip looking up the metatype by typeid. [ChangeLog][QMetaProperty][Important Behavior Change] QMetaProperty::typeName returns now always the same name as name() of the corresponding metatype. This can cause a change for enum properties which were not fully-qualified. Change-Id: I1f57743948b7262ac06095d3bbc838d620f6e481 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QMetaObjectBuilder: remove relocatable data supportFabian Kosmale2020-11-301-80/+9
| | | | | Change-Id: I6f1dc9e81723e9a8af8988a8cb45c63c05214296 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QMetaPropertyBuilder: carry metatypeFabian Kosmale2020-11-301-3/+13
| | | | | | | | | | Properties of non-dynamic classes always have the metatype stored, so we can make use of it. Moreover, when the builder is converted into a metaobject, we need to resolve the metatype anyway. As a driveby, add a dedicated metatype test to tst_qmetaobjectbuilder. Change-Id: I7eea0cd8fc2da5d92c7fc803f05cd81e3a9d4cf4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Whitespace cleanup in corelib/kernelAllan Sandfeld Jensen2020-10-241-50/+47
| | | | | Change-Id: If061ef0af5ced4384e20a82afcea3712fa7e45d7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use qmetaobject_p.h's MetaObjectFlag in QMetaObjectBuilderEdward Welbourne2020-10-201-2/+2
| | | | | | | | This saves duplicating them with its own flags. Task-number: QTBUG-85700 Change-Id: I9e938322fd787282cfd9f941f83af8c0d76aaa9d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Replace Q_DECL_UNUSED with [[maybe_unused]]Allan Sandfeld Jensen2020-10-031-1/+1
| | | | | | | Use C++17 attribute directly Change-Id: Id853e7a5117065e4adb549f81303c1820fe198ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaPropertyBuilder: support bindable flagFabian Kosmale2020-09-231-0/+21
| | | | | Change-Id: I0d6ad00e49fd5df4c3b9c0692839404d53d8f6ed Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use C++17 [[maybe_unused]]Allan Sandfeld Jensen2020-09-061-1/+1
| | | | | | | In some places needs to be ordered before const/constexpr though. Change-Id: I57a521ac0ad22b5a018761c4d52befbef69d64c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-241-7/+7
| | | | | | | | | | | | | And remove one of the type id to name mapping that still existed in QMetaType. QMetaTypeInterface can provide that, so there's no need to have a second copy of the data. qMetaTypeTypeInternal() can still map all the names of all builtin types to ids. That functionality is for now still required by moc and can't be removed yet. Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-311-1/+1
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix some MSVC int conversion warningsFriedemann Kleint2020-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | kernel\qmetaobjectbuilder.cpp(1279): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data kernel\qmetaobjectbuilder.cpp(1432): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data sax\qxml.cpp(1275): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data text\qfontsubset.cpp(920): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qfontsubset.cpp(920): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data text\qtextengine.cpp(2664): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2665): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2706): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2707): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data itemviews\qbsptree.cpp(60): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) kernel\qprintengine_win.cpp(1558): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data qsql_odbc.cpp(804): warning C4267: 'argument': conversion from 'size_t' to 'SQLINTEGER', possible loss of data qsql_odbc.cpp(822): warning C4267: 'argument': conversion from 'size_t' to 'SQLINTEGER', possible loss of data qsql_odbc.cpp(1585): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data qsql_odbc.cpp(1602): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data qwindowsmime.cpp(770): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data windows\qwindowsmime.cpp(770): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Change-Id: I04fbe17b9782f4c2704933fc005449b1e992475e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use qsizetype in QListLars Knoll2020-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in corelib implementationJarek Kobus2020-06-291-1/+1
| | | | | | | | Omitting state machine and docs for now. Task-number: QTBUG-84469 Change-Id: Ibfa5e7035515773461f6cdbff35299315ef65737 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-1/+1
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add some support to flag alias propertiesLars Knoll2020-06-111-0/+23
| | | | | | | | | | | This is required if we want to be able to get rid of the property cache. Also reserve a flag for var properties, in case it turns out that we need to keep the distinction between var and QVariant properties in QML. Change-Id: I55c2191adcc2d94bd8f148216e26423defaa900f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Get rid of the obsolete isEditable flag for propertiesLars Knoll2020-06-111-27/+0
| | | | | | Change-Id: I54411bd8e223671523c9c8fad5c80bfa6b5b7097 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Cleanups in QMetaPropertyFabian Kosmale2020-06-111-67/+12
| | | | | | | | | This changes the layout of the meta object data, so also bump the meta object revision. Original-patch-by: Lars Knoll <lars.knoll@qt.io> Change-Id: I176fb16c207e8ebe59e358e69554be813406232f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Clean up QMetaEnum codeLars Knoll2020-06-111-3/+3
| | | | | | Change-Id: I9c1fcfd72890fb3d69d2d9caed7f3cff931c3ff6 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* MetaObject: Store the QMetaType of the methodsFabian Kosmale2020-06-021-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | This does the analog of 46f407126ef3e94d59254012cdc34d6a4ad2faf2 for the methods we care about (signals, slots, Q_INVOKABLEs). In addition to the actual QMetaType, we store an array with offsets so that we later can do a mapping from methodIndex to metatype. The newly added QMetaMethod::{return,parameter}MetaType methods can then be used to retrieve the metatypes. This does however require that all involved types are complete. This is unfortunately not a feasible requirement. Thus, we only populate the metatype array on a best effort basis. For any incomplete type, we store QMetaType::Unknown. Then, when accessing the metatype, we fall back to the old string based code base if it's Unknown. Squashes "moc: support incomplete types" and "Fix compile failures after QMetaMethod change" Fixes: QTBUG-82932 Change-Id: I6b7a587cc364b7cad0c158d6de54e8a204289ad4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove deprecated functionality in QMetaObjectBuilderShawn Rutledge2020-05-131-11/+0
| | | | | Change-Id: Ic0539aed854b9bf9b335cbb8030d5a4eb4296a7d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-111-1/+11
|\ | | | | | | | | | | | | Conflicts: tests/auto/network/socket/platformsocketengine/platformsocketengine.pri Change-Id: I22daf269a8f28f80630b5f521b91637531156404
| * Fix warning about QMetaObject::isEditable() being deprecatedThiago Macieira2020-04-091-1/+11
| | | | | | | | | | Change-Id: Ibdc95e9af7bd456a94ecfffd1603f482445bff28 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Fix a few size_t / int conversion warningsFriedemann Kleint2020-04-101-2/+2
| | | | | | | | | | | | | | | | Change the hash function of QTypeRevision and QtFontFallbacksCacheKey to use size_t and add a few casts. Change-Id: I89a8fc617abbe8b0c67529ec41795691c99b0574 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix warning in qmetaobjectbuilder.cppMitch Curtis2020-03-101-1/+1
| | | | | | | | | | | | | | | | src\corelib\kernel\qmetaobjectbuilder.cpp(1489): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Change-Id: I9cf9bdcb62b796eb8d3f3c633640b648cb11b39f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | MetaObject: store the QMetaType of the propertiesOlivier Goffart2020-02-251-0/+15
| | | | | | | | | | Change-Id: I563e7232b70e94de4184f2c23a581319313dcf5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-091-16/+16
|\| | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-16/+16
| | | | | | | | | | | | | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Change representation of string data in the meta objectLars Knoll2019-12-081-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Don't store our string data as QByteArrayLiterals anymore, but revert back to simply storing them as an array of char* and offsets into that array. This is required to be able to inline size and begin into QByteArray itself. Once that change is done, we can then avoid creating copies of the string data again. Change-Id: I362a54581caefdb1b3da4a7ab922d37e2e63dc02 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Replace Q_ALIGNOF usage in qtbase with C++11 alignof keywordVolker Hilsheimer2019-10-291-1/+1
|/ | | | | | | | | | | | | | | | The macro is not documented, so not part of the public Qt API. It is made obsolete by the alignof keyword in C++11. Remove the usage of the macro across qtbase, in particular the workarounds for compilers that didn't support alignof, and that will not be supported in Qt 6. The macro definition is left in place, no need to break existing code. Task-number: QTBUG-76414 Change-Id: I1cfedcd4dd748128696cdfb546d97aae4f98c3da Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Qt6: Fix uninitialized meta objects on WindowsThiago Macieira2019-07-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows has a problem relating to cross-DLL variable relocations: they are not supported. Since QMetaObject's link to the parent class is done via a pointer, every QMetaObject in a DLL or in the EXE that derives from a class from another DLL (such as QObject) will be dynamically initialized. This commit changes the meta object pointers in QMetaObject::d from raw pointers to a wrapper class SuperData, which is almost entirely source- compatible with the pointer itself. On all systems except for Windows with Qt 6, it's binary compatible with the current implementation. But for Windows with Qt 6, this commit will store both the raw pointer and a pointer to a function that returns the QMetaObject, with one of them non-null only. For all meta objects constructed by moc, we store the function pointer, which allows the staticMetaObject to be statically intialized. For dynamic meta objects (QMetaObjectBuilder, QtDBus, QtQml, ActiveQt), we'll store the actual raw pointer. [ChangeLog][QtCore][QMetaObject] Some internal members of the QMetaObject class have changed types. Those members are not public API and thus should not cause source incompatibilities. The macro QT_NO_DATA_RELOCATION existed in Qt 4 but was called Q_NO_DATA_RELOCATION and only applied to Symbian. It was removed in commit 24a72c4efa929648d3afd95b3c269a95ecf46e57 ("qglobal: Remove symbian specific features"). Task-number: QTBUG-38876 Fixes: QTBUG-69963 Change-Id: Id92f4a61915b49ddaee6fffd14ae1cf615525e92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix QMetaObject naming of class enum flagAllan Sandfeld Jensen2018-08-111-9/+40
| | | | | | | | | Adds an enumName to QMetaEnum to carry the name of the enum since for flags that doesn't match the name of the Qt type, but is needed if the flag is scoped. Change-Id: I1c0f77eb9e40e6fd1eb6a59bea77caf0f33fcf43 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add support for scoped enums to QMetaObjectBuilderMichael Brasser2017-04-241-3/+33
| | | | | | Change-Id: I7b3c3973ff4396a854014f5b2b671b71007e80da Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QMetaObjectBuilder: replace index-based for loops with C++11 range-forMarc Mutz2015-10-171-139/+123
| | | | | | | | | | | | | | ...for the recently-introduced std::vector objects (QVector would detach). Also, as a drive-by, reorder two comparisons so the cheaper one is first, twice. Saves 1700B of text size on GCC 4.9 optimized C++11 AMD64 Linux builds. Change-Id: I05a29ef1f2e67c98d26236c2cc40a13856a91af6 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QMetaObjectBuilder: replace two signed comparisons with one unsigned oneMarc Mutz2015-10-081-8/+8
| | | | | | | | | | ... where possible. It's a cleanup commit following the change from QVector to std:vector and the corresponding signed/unsigned comparison fixes. Change-Id: I927445686d24d542cae024cac0f34ff1fd82d20f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaObjectBuilder: replace a QVector with std::vectorMarc Mutz2015-10-071-103/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...with minimal other changes: signed/unsigned warning fixes, and API adjustments. I chose std::vector instead of QVector because it does not require the contained type to have a default constructor (QVector does). All three QMeta*Private types in question didn't have a default ctor before they were ported to be held in QVectors (instead of QLists). std::vector generally also produces less executable code, and its push_back() is overloaded for rvalue references, and the code happens to pass only QMeta*Private temporaries to it, which are conveniently implicitly move-enabled. Even though std::vector doesn't care, keep the QMeta*Private classes marked as Q_MOVABLE_TYPE, so the next person doesn't wonder whether it was forgotten or intentional. There are a lot of for loops which use int-based indexing. They all needed to be adjusted to use size_t-based indexing. Eventually, we will change that to C++11 range-for loops. In most places, index validation could now be done in a single unsigned comparison, but keep that for a separate commit to keep the change minimal. Added lots of casts to int from size_t to avoid MSVC's narrowing conversion warnings. Saves more than 4.5K of text size on GCC 4.9 optimized C++11 AMD64 Linux builds. Change-Id: I889eba20fcfb4cb14b1f55f5bc1aad0a767d7bd5 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QMetaObjectBuilder: replace an inefficient QList with QVectorMarc Mutz2015-06-171-1/+1
| | | | | | | | | | | | | ints are only half the size of void* on 64-bit, so QVector<int> uses only 50% of per-element memory, compared to a QList. Saves ~1800B of text size on GCC 4.9 optimized C++11 AMD64 Linux builds, even though it wasn't the last instance of QList<int> in QtCore, yet. Change-Id: Ibf04b26cff78c428e4253aaab7c280866906db58 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QMetaObjectBuilder: replace inefficient QLists with QVectorMarc Mutz2015-06-171-6/+12
| | | | | | | | | | | | The QMeta*Private classes are larger than a void*, and weren't marked as movable, so QList<QMeta*Private> is horribly inefficient. Fix by holding them in QVector instead. Saves ~900B in text size on GCC 4.9 optimized C++11 AMD64 Linux builds, and tons of memory allocations. Change-Id: I313c965d7a0fea16f79e9fde04a972fc248e33aa Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-161-16/+36
|\ | | | | | | | | | | | | | | | | 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
| * Fix quadratic behavior in QMetaObjectBuilder when writing string tableSimon Hausmann2013-12-061-16/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHash::key() is O(n) and we're calling it n times. That can make repeated calls to the meta object builder very slow, as for example QQmlPropertyMap when inserting properties repeatedly. Fortunately this is easy to fix, as the value in the hash map is also the index, so we can simply iterate over the hash once. With the exception of the class name, which we have to treat specially to ensure that it is always the first entry in the string table. Task-number: QTBUG-32720 Change-Id: Ic954c45c454107feee83216131f601cc69d4c63b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>