summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-01-072-35/+78
|\ | | | | | | Change-Id: Ia2ce994c42adc010c453edaeea57f672556958f6
| * Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2020-01-061-0/+44
| |\
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-061-0/+44
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qvariant.h Change-Id: I8f3873e74b9795ac889e7c7ec5de2619bca92160
| | | * QVariant: Prefer direct conversion to QVariant{List,Map,Hash}Fabian Kosmale2020-01-031-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a type has both a converter to QVariantList and to QSequentialIterableImpl registered, we would have chosen the QSequentialIterableImpl version. In the case of types like QJSValue, this is more costly. With this change we therefore uses the direct conversion if it has been registered. The same applies to QAssociativeIterableImpl and QVariantHash/QVariantMap. Change-Id: I9c0b5068efe4bfbc5e0598a200e6db59201e9974 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | | Deprecate SAX classes in Qt XMLSona Kurazyan2020-01-061-35/+34
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecated the SAX classes and disabled or replaced their uses in tests if applicable. Removed the saxbookmarks example, no point in keeping examples for the deprecated code. [ChangeLog][QtXml] SAX classes are now deprecated. Use QXmlStreamReader, QXmlStreamWriter in QtCore instead. Task-number: QTBUG-76177 Change-Id: Ic171d62fa0527b0f36f94cf09a69586092269957 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-01-0411-82/+454
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h Make QVector(DataPointer dd) public to be able to properly merge 5b4b437b30b320e2cd7c9a566999a39772e5d431 from 5.15 into dev. src/widgets/kernel/qapplication.cpp tests/auto/tools/moc/allmocs_baseline_in.json Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
| * | Fix parameter of QJsonObject::const_iterator operator-(const_iterator)Friedemann Kleint2020-01-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It used to be "iterator", causing a qdoc warning: src/corelib/serialization/qjsonobject.cpp:1405: (qdoc) warning: clang found diagnostics parsing \fn int QJsonObject::const_iterator::operator-(const_iterator other) const error: out-of-line definition of 'operator-' does not match any declaration in 'QJsonObject::const_iterator' Add a small test. Change-Id: Id65effffa720ed1e0fb0ee6937dcc4298f3ef363 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QTime: fix tests with Qt6Christian Ehrlicher2020-01-031-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt6 there is a behavior change with extra stuff after the seconds - it's no longer allowed and will result in an invalid QTime. This was introduced with bf65c277892f6f322fa689c06d81ba9b1d9a8038 but the autotests were not adjusted for it. Change-Id: Ia78f4f2a8019e46d9d0e8e8b8918a3ab2d4638e2 Reviewed-by: Liang Qi <liang.qi@qt.io>
| * | QIdentityProxyModel: implement moveRows / moveColumnsGiuseppe D'Angelo2020-01-021-35/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It makes sense for it (instead of triggering the QAbstractItemModel base class implementation, which doesn't do anything). Safe to override virtuals in this case -- code calling the old version could not do anything useful, so at least new code gets those functions properly implemented for free. Change-Id: Iefe1ff25e15d877435e93ab28289ad2579616f72 Task-number: QTBUG-48076 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: David Faure <david.faure@kdab.com>
| * | QDateTime: fix tests with Qt6Christian Ehrlicher2020-01-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt6 there is a behavior change with extra stuff after the seconds - it's no longer allowed and will result in an invalid QDateTime. This was introduced with bf65c277892f6f322fa689c06d81ba9b1d9a8038 but the autotests were not adjusted for it. Change-Id: Iee6a9a7ac6cbb2754a68e082bb7074d17fac9d9c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-021-0/+53
| |\| | | | | | | | | | Change-Id: I7b6e6c687d8d60b4a54e6b9dada025ef66c53d96
| | * QLocale: Support Indian number formattingTuomas Heimonen2019-12-301-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QLocale::Country is set to QLocale::India numbers are written so that after first three from the right and then after every second will be comma. E.g. 10000000 is written as 1,00,00,000 Task-number: QTBUG-24301 Change-Id: Ic06241c127b0af1824104f94f7e2ce6e2058a070 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
| * | Introduce QString(View)::isValidUtf16Giuseppe D'Angelo2019-12-201-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString(View)s can be built or manipulated in ways that make them contain/refer to improperly encoded UTF-16 data. Problem is, we don't have public APIs to check whether a string contains valid UTF-16. This knowledge is precious if the string is to be fed in algorithms, regular expressions, etc. that expect validated input (e.g. QRegularExpression can be faster if it can assume valid UTF-16, otherwise it has to employ extra checks). Add a function that does the validation. [ChangeLog][QtCore][QStringView] Added QStringView::isValidUtf16. [ChangeLog][QtCore][QString] Added QString::isValidUtf16. Change-Id: Idd699183f6ec08013046c76c6a5a7c524b6c6fbc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QStringListModel: fix moveRows()Christian Ehrlicher2019-12-161-28/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | QStringListMode::moveRows() had an issue when the destination was before the source row. Change-Id: Icf64e5b4cdd6a39faf3ba4ccc3883196b247ccbd Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: David Faure <david.faure@kdab.com>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-161-0/+4
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket.cpp src/widgets/kernel/qapplication.cpp Change-Id: Ib7421cc2df59d0969f89b3fbd65a17ea76ffef3b
| | * Let QItemSelectionModel::columnIntersectsSelection honor the parentChristian Ehrlicher2019-12-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QItemSelectionModel::columnIntersectsSelection() should honor the parent according to the docs. For rowIntersectsSelection() this was fixed a long time ago but columnIntersectsSelection() was forgotten. Sync the both functions and use range-based for loops as a drive-by. Fixes: QTBUG-80644 Change-Id: Iaf08f85e2225204d1e6564fa4bb0bc826352ed53 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | Add QMap::insert(const QMap &map)Mårten Nordheim2019-12-121-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | As opposed to unite(), this inserts one map into the other without duplicating elements. Task-number: QTBUG-35544 Change-Id: Ie8ab350b29148851a3176cef1007e8a4ca82c273 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-122-1/+134
| |\| | | | | | | | | | Change-Id: I69238f23882deebeaad46e4fdcf899ab22cc2b8f
| | * QVariant: introduce ShouldDeleteVariantData flagFabian Kosmale2019-12-111-1/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flag is used in QSequentialIterable and QAssociativeIterable to indicate that the data pointer in VariantData should be deleted after the variant has been constructed. The use case for this is https://codereview.qt-project.org/c/qt/qtdeclarative/+/284151, where we have a proxy iterator and cannot easily return a pointer to already owned data, as it is hard to manage its lifetime in the iterator. In contrast, it is clear that we can release the memory in the QSequentialIterable functions, as it has already been copied into the QVariant there. Change-Id: I2b33497d991cd4f752153e0ebda767b82e4bb851 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix more mis-handling of spaces in ISO date format stringsEdward Welbourne2019-12-101-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISO date format doesn't allow spaces within a date, although 3339 does allow a space to replace the T between date and time. Sixteen tests added to check this all failed. So clean up the handling of spaces in the parsing of ISO date-time strings. [ChangeLog][QtCore][QDateTime] ISO 8601: parsing of dates now requires a punctuator as separator (it previously allowed any non-digit; officially only a dash should be allowed) and parsing of date-times no longer tolerates spaces in the numeric fields: an internal space is only allowed in an ISO 8601 date-time as replacement for the T between date and time. Change-Id: I24d110e71d416ecef74e196d5ee270b59d1bd813 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | MIME: Make the internal database direct content, not a Qt resourceThiago Macieira2019-12-101-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This saves us from having to bootstrap rcc in regular (non-cross) compilations, as it can now link to QtCore. Actually un-bootstrapping rcc is left as an exercise for the reader. This commit discovered that MSVC cannot handle constexpr arrays bigger than 256 kB, at which point it simply starts claiming that the constant expressions using it are not constexpr. ICC has a similar problem at 64 kB, but it tells you why ("note: type "const unsigned char [65537]" too large for constant-expression evaluation"). Note also that this requires gzip or zstd to be in PATH for compression to happen. RCC linked to zlib, which is always present due to the bundled copy. gzip's presence is not likely to be a problem on Unix systems, but could be for Windows users, especially MSVC ones. If gzip is not present, QtCore's size will increase by about 1910 kB of read-only (sharable) data. Change-Id: I2b1955a995ad40f3b89afffd15a3e65a94670242 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Long live QFlatMap!Joerg Bornemann2020-01-023-0/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a light-weight associative container, API-wise very similar to QMap, that's based on two sorted continuous containers (QVector by default). The class is internal for now. Change-Id: Ife12576c4abb39a3ea2acb0a1ba0faca91b3a4c5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | QBitArray: Add method to get int valueFederico Guerinoni2019-12-201-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is useful to use an array of bit as an integer value. I add also a prarameter to set endianness when converting value to UInt32. [ChangeLog][QtCore][QBitArray] Added toUInt32() to return the bit array's value as a uint32_t. Change-Id: I9d8c7a33f11e7ce94cb67aa9a50b11fa42d56168 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Convert QString to use QArrayDataPointerLars Knoll2019-12-161-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're now using the same infrastructure for QVector, QString and QByteArray. This should also make it easier to remove the shared null in a follow-up change. Change-Id: I3aae9cf7912845cfca8e8150e9e82aa3673e3756 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-119-31/+141
|\| | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp Change-Id: I6b82507bf9a80a374c40393e72f4843f1557de89
| * | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Liang Qi2019-12-108-31/+96
| |\ \
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-108-31/+96
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
| | | * Don't wrap feature detection macros with QT_HAS_FOO() variantsTor Arne Vestbø2019-12-107-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using wrappers for these macros is problematic when for example passing the -frewrite-includes flag to preprocess sources before shipping off to distcc or Icecream. It will also start producing warnings when compilers implement http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example https://reviews.llvm.org/D49091 Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations recommend defining '__has_foo(x) 0' as a fallback for compilers without the macros, so that's what we go for. Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767 Reviewed-by: Alex Richardson <arichardson.kde@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Allow lower-case for the T and Z in ISO 8601 date formatEdward Welbourne2019-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cite RFC 3339 as basis for allowing a space in place of the T, too. The RFC mentions that ISO 8601 accepts t and z for T and Z, so test for them case-insensitively. Add a test for this. Change-Id: Iba700c8d74d485df154d27300aab7b1958e1ccef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Fix handling of trailing space at the end of an ISO date-timeEdward Welbourne2019-12-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If milliseconds were followed by a space, the space was included in the count of "digits" read as the fractional part; since we read (up to) four digits (so that we round correctly if extras are given), a harmless apce could cause scaling down by too large a power of ten. Since QString::toInt() ignores leading space, we were also allowing interior space at the start of the milliseconds, which we should not, so catch that at the same time. Added tests, including one for the rounding that's the reason for reading the extra digit, when present. Fixes: QTBUG-80445 Change-Id: I606b29a94818a101f45c8b59a0f5d1f78893d78f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Fix crash when a date-time has an invalid time-zoneEdward Welbourne2019-12-061-14/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDateTime is a friend of QTimeZone, so can access its internals; but it must check the zone is valid before doing so. Expanded tst_QDateTime::invalid() and made it data-driven to catch the failure cases. Commented on a test-case that caught a mistake in my first attempt at this, and on QDateTimeParser's surprising reliance on a quirk of QDateTime::toMSecsSinceEpoch()'s behavior. Fixes: QTBUG-80146 Change-Id: I24856e19ff9bf402152d17d71f83be84e366faad Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | | * QCborValue: fix replacing of elements with byte data with ones withoutThiago Macieira2019-12-051-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We forgot to reset the flags when replacing the element, so we ended up with an integer with HasByteData after: testMap[0] = QStringLiteral("value"); testMap[0] = 42; Fixes: QTBUG-80342 Change-Id: Ia2aa807ffa8a4c798425fffd15dabfa066ea84b0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | | QCocoaEventDispatcher: make 'interrupt' workTimur Pocheptsov2019-12-101-0/+45
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | even if we are currently inside processEvents (apparently called manually and not from QEventLoop::exec()). A carefully crafted application (see, for example, the linked QTBUG or even updated auto-test) can trigger itself into failing to exit the current (potentially nested) event loop. We can harden our Cocoa event dispatcher to detect such condition and properly propagate 'interrupt' to where it'll do its job, indeed, interrupting the real event loop (aka [NSApp run]). This mainly means we have to undo what bool blocker would erroneously do. Also, long live (as people love to say these days) to another tricky (somewhat) auto-test (surely, it's not flaky!). Fixes: QTBUG-79477 Change-Id: I794f0cda23e24d36be67f2bb63d52b74be057c31 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-093-34/+240
|\| | | | | | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * | QMetaType: add more static-less APIOlivier Goffart2019-12-071-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In prevision to Qt6 which is going to discourrage the use of the integer id, add some missing API to the staticless QMetaType API: - Add a way to construct a QMetaType from a type without calling qMetaTypeId: QMetaType::fromType<T>() - Add equality operators - Add a QMetaType::name() function - Add a default constructor (by adding a default parameter to the existing ctor) Change-Id: I95487c1c31bdf0d773717daa9d5452cbced30673 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QByteArray: add a strict mode to fromBase64Giuseppe D'Angelo2019-12-051-34/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QByteArray::fromBase64 was liberal in its input, simply skipping over invalid characters. As a side-effect of this, it had no error reporting, meaning it could not be used to convert fromBase64 _and_ validate the input in one go. Add more option flags to make fromBase64 strictly validate its input. Since we want to know whether it has succeeded or not, and the existing fromBase64 overloads do not allow for that, introduce a new function that returns an optional-like datatype. While at it: base64 decoding can be done in-place; add an rvalue overload to enable this use case. [ChangeLog][QtCore][QByteArray] Added the new fromBase64Encoding function. [ChangeLog][QtCore][QByteArray] Added new flags to make fromBase64 / fromBase64Encoding strictly validate their input, instead of skipping over invalid characters. Change-Id: I99cd5f2230f3d62970b28b4cb102913301da6ccd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Add QHash::insert(const QHash &other)Lars Knoll2019-12-051-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As opposed to unite(), this inserts one hash into the other without duplicating elements. Change-Id: Ifc786c48f5dc3ab18c29782e73eac3c1a3ef8981 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Use QString::DataPointer instead of QStringPrivateLars Knoll2019-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Preparations to move QString over to use QArrayDataPointer instead of it's own private struct. Change-Id: I7796a595393394083f6a85863e3c710ebbdea149 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Use QArrayDataPointer to implement QByteArrayLars Knoll2019-12-081-3/+3
| | | | | | | | | | | | | | | Change-Id: I2ee28023c2dea9fc3160400112c59a47566a4868 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Use the QByteArray::DataPointer typedef instead of QByteArrayDataLars Knoll2019-12-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The goal here is to move things over to QArrayDataPointer. This prepares for it. Change-Id: I32f54a47594274799600c618f7341c200ceaa306 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Get rid of QCharRef and QByteRefLars Knoll2019-12-083-26/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already detach immediately since change c2d2757bccc68e1b981df059786c2e76f2969530. That basically removes the main purpose of having QChar/ByteRef, and we can just as well get rid of those classes for Qt 6. Change-Id: I8dc566a1948ddc29c0cb8a77ec7310654a7219a4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Use <type_traits> to properly have QVector<T>::parameter_typeThiago Macieira2019-12-081-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That allows us to pass by value for all fundamental and pointer types. This requires some magic to remove methods taking a T&& to avoid ambiguous overloads for QVector<int/qsizetype>. Remove them for all cases where parameter_type is T, as copying or moving will do exactly the same thing for those types. Change-Id: I8133fecd3ac29bb8f6ae57376e680bc3d616afbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Enlarge QVariant's private to fit the new QString and QByteArrayThiago Macieira2019-12-081-2/+1
| | | | | | | | | | | | | | | Change-Id: I8baecd0a4db13200b34cdd7c8aebc2a1cc0a0c75 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Final removal of the size and offset members from QArrayDataThiago Macieira2019-12-081-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | Those members are not required anymore and now part of the object itself. Change-Id: If9eb5355ca8f2cf9528f6f63ca4e172acc9f9aed Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Inline the size and data pointers in QByteArrayThiago Macieira2019-12-081-45/+14
| | | | | | | | | | | | | | | Change-Id: I82feeb2c9bd2900f421fc0c8d78698b1e83db043 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Change representation of string data in the meta objectLars Knoll2019-12-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Inline the size and data pointer members in QStringThiago Macieira2019-12-081-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'd have preferred to use QArrayDataPointer<ushort> for QString, but that option wasn't the best one. QArrayDataPointer try to do some operations using QArrayDataOps and that would expand to unnecessary code. What's more, the existing code expected to be able to modify and access the d pointer. Instead, this commit introduces QStringPrivate (named differently from QStringData to catch potential users), which contains the three members. This POD class is also used in QJsonValue to store the "inlined" QString. QHashedString in qtdeclarative will need a similar solution. Change-Id: I33f072158e6e2cd031d4d2ffc81f4a8dbaf4e616 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Inline the size and begin pointer in QVectorThiago Macieira2019-12-081-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add QGenericArray to simplify operations. This class can be shared by other tool classes. If there is nothing else to share it, we can move the code onto qvector.h. The one candidate is QList. All tests pass and valgrind is good. Change-Id: Ieaa80709caf5f50520aa97312ab726396f5475eb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove bad test in QVectorThiago Macieira2019-12-081-83/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test hardcodes the allocation behaviour instead of testing what it should be testing. Unfortunately, it can't test the actual problem directly since the problem was "it crashed when using vectors with 1 billion elements". Change-Id: Iec6a26ae490b8fdd4a7db1269e3bae85fc77ee52 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Start moving QArrayData's size and data pointer to the main classThiago Macieira2019-12-082-126/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires that the allocation functions return two pointers: the d pointer and the pointer to the actual data. Ported QArrayDataPointer & SimpleVector to the inlined size & data. For now, the size and offset members are not yet removed from QArrayData, to let QVector, QByteArray and QString compile unmodified. Change-Id: I8489300976723d75b8fd5831427b1e2bba486196 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>