summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove QFtp sources etc. in favor of alternate distributionMårten Nordheim2020-08-2710-3371/+102
| | | | | | | | | | | | While we initially wanted to just disable the functionality the way it is currently built forces people to do a full build of Qt just to enable it. Instead of doing this half-measure let's just remove the code completely from QtBase and rather prepare QtNetwork to handle being a plugin that can be compiled at any time. Task-number: QTBUG-80340 Change-Id: I19155c8c167cf932088f01b2a9706d0e7ab792d1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Make QUUid constructors from string like types explicitLars Knoll2020-08-271-3/+3
| | | | | | | | I don't think we want to have implicit conversion from a const char * or a QByteArray to a QUuid. Change-Id: Idfe7450ce15b89e295aa7af7ccf1fc94f5acd4f9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change QByteArray to handle large arraysLars Knoll2020-08-273-6/+10
| | | | | | | | | | Use qsizetype throughout. Change-Id: I787af7fcfa17e1be87decb64c41c609cc24be117 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Support GrowsBackwards prepend in QListAndrei Golubev2020-08-271-8/+23
| | | | | | | | | | | | | Restored previously deleted logic of setting GrowsBackwards flag for prepend-like cases. This should be sufficient to fully enable prepend optimization Fixed QList::emplace to not use implementation detail logic. Updated tests to cover changed behavior and its correctness Task-number: QTBUG-84320 Change-Id: I4aadab0647fe436140b7bb5cf71309f6887e36ab Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Add prepend optimization to QCommonArrayOpsAndrei Golubev2020-08-272-20/+261
| | | | | | | | | Introduced prepend optimization logic to QCommonArrayOps. Trying to rely on original QList behavior Task-number: QTBUG-84320 Change-Id: I46e6797b4edad804a3e3edb58307c9e96990fe01 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Support GrowsBackwards flag in QArrayDataPointerAndrei Golubev2020-08-272-21/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduced allocation function in QArrayDataPointer with interface similar to QArrayData::allocate that supports growing strategies. This func is used instead of the original in cases when prepend-aware storage is needed. Tried to follow Qt5 QList policy in terms of space reservation Updated QPodArrayOps::reallocate to be aware of growing shenanigans. It doesn't look like a perfect solution but it is rather close and similar to what Qt6 QList is doing when not growing (e.g. reserve/squeeze) Added initial QCommonArrayOps with helper function that tells when reallocation is preferable over just using the insert-like operation. This comes up later on when GrowsBackwards policy is properly supported in operations Essentially, 2/3 main data management blocks for prepend optimization are introduced here. The last one being a generalized data move that is done instead of reallocation when existing free space is not enough Task-number: QTBUG-84320 Change-Id: I9a2bac62ad600613a6d7c5348325e0e54aadb73d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark some Qt namespace enum members properly as deprecatedEdward Welbourne2020-08-271-1/+0
| | | | | | | | | | | | | | | | A comment is not good enough, Some of the enum members were even still in use, or mentioned in documentation. WA_ContentsPropagated, WA_WState_DND and WA_ForceAcceptDrops have been deprecated since 4.5.1; and at least the last has been an \omitvalue in the docs for even longer. (WA_ShowModal and WA_GroupLeader have been similarly marked, but are in use, see QTBUG-85816.) Push back to 5.15.1 in order to be able to remove these at Qt 6. Pick-to: 5.15.1 Change-Id: I6ea3839767e5f5158b0fed508f65798470191908 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QIcon: Add pixmap() overload which take devicePixelRatioMorten Johan Sørvig2020-08-271-0/+14
| | | | | | | | | | | | | Add new QIcon::pixmap() overload: QPixmap pixmap(const QSize &size, qreal devicePixelRatio, ...) This function replaces the existing pixmap() function which take a QWindow pointer, and should be more convenient in use. Task-number: QTBUG-85885 Change-Id: Ie4ca96a266d9278864678dc61bdfc2836cabdb93 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Replace QAbstractItemView::viewOptions with initViewItemOptionVolker Hilsheimer2020-08-265-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | viewOptions returned a QStyleOptionViewItem object. Such a method can never support newer versions of the option structure. Most styleable QWidget classes provide a virtual method initStyleOption that initializes the option object passed in as a pointer, e.g QFrame, QAbstractSpinBox, or QComboBox. Follow that API convention, but name it initViewItemOption, as the QStyleOptionViewItem struct contains information about the item as well as the widget itelf. This is a source incompatible change that will go unnoticed unless existing subclasses mark their overrides as 'override', or call the removed QAbstractItemView::viewOption virtual function. [ChangeLog][QtWidgets][QAbstractItemView] The virtual viewOptions method that previously returned a QStyleOptionViewItem object has been renamed to initViewItemOption, and initializes a QStyleOptionViewItem object that's passed in through a pointer. Change-Id: Ie058702aed42d77274fa3c4abb43ba302e57e348 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Introduce QWindow::paintEvent with QPA plumbingTor Arne Vestbø2020-08-263-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The explicit paint event on QtGui and QPA level allows us to untangle the expose event, which today has at least 3 different meanings. It also allows us to follow the platform more closely in its semantics of when painting can happen. On some platforms a paint can come in before a window is exposed, e.g. to prepare the first frame. On others a paint can come in after a window has been de-exposed, to save a snapshot of the window for use in an application switcher or similar. The expose keeps its semantics of being a barrier signaling that the application can now render at will, for example in a threaded render loop. There are two compatibility code paths in this patch: 1. For platform plugins that do not yet report the PaintEvents capability, QtGui will synthesize paint events on the platform's behalf, based on the existing expose events coming from the platform. 2. For applications that do not yet implement paintEvent, QtGui will send expose events instead, ensuring the same behavior as before. For now none of the platform plugins deliver paint events natively, so the first compatibility code path is always active. Task-numnber: QTBUG-82676 Change-Id: I0fbe0d4cf451d6a1f07f5eab8d376a6c8a53ce8c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* macOS: rename 'macintosh' style to 'macos'Richard Moe Gustavsen2020-08-264-5/+5
| | | | | | | | | | | | | | Change the name/key of the style to 'macos'. Besides the name 'macintosh' being archaic, we also need this change to avoid creating 'macintosh' style folders in QtQuickControls, now that we plan to use QPlatformTheme also there to resolve the style. [ChangeLog][Widgets][QStyle] The 'macintosh' style has been renamed to 'macos'. Change-Id: I14b8a8b4dbd369e7a7d16b94e4ad27e501e7e8d0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QFuture::waitForFinished to wait until QFuture is startedSona Kurazyan2020-08-262-4/+26
| | | | | | | | | | | | | | | | | Currently QFuture::waitForFinished() exits as soon as the future is not in the running state. If the user calls it before QPromise::reportStarted() is called, it will exit immediately, because nothing is running yet. Fix the behavior to wait for the finished state. [ChangeLog][Important Behavior Changes][QtCore] Fixed the behavior of QFuture::waitForFinished() to wait until the future is actually in the finished state, instead of exiting as soon as it is not in the running state. This prevents waitForFinished() from exiting immediately, if at the moment of calling it the future is not started yet. Task-number: QTBUG-84867 Change-Id: I12f5e95d8200cfffa5653b6aa566a625f8320ca8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add back QByteArray's relational operators taking QStringSona Kurazyan2020-08-261-0/+1
| | | | | | | | | | | | | QString still has the overloads of relational operators taking QByteArray. Add back QByteArray's relational operators taking QString for symmetry. See also the comments of d7ccd8cb4565c8643b158891c9de3187c1586dc9 for more details. [ChangeLog][EDITORIAL] Remove the changelog about QString/QByteArray operators being removed. They're back. Change-Id: I22c95e727285cf8a5ef79b3a4f9d45cb66319252 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Synchronize QEventDispatcherWin32::processEvents() with QCoreApplicationAlex Trotsenko2020-08-261-0/+26
| | | | | | | | | | | | | | | QCoreApplication has a special internal mechanism to control whether the event dispatcher should block after delivering the posted events. To handle queued connections in nested loops properly, we should use that functionality. Pick-to: 5.15 Fixes: QTBUG-85981 Change-Id: I124179a23b26a995cf95ed379e97bfa62c95f42a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't skip QFileDialog retranslatability test on macOSVolker Hilsheimer2020-08-261-3/+0
| | | | | | | | The test explicitly asks for a non-native file dialog, which works on macOS as well. Change-Id: I964c6d98501b4207c2b6c2ce1df39f654c801a43 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated qGenericMatrix{To,From}Matrix4x4 functionsMarcel Krems2020-08-261-10/+0
| | | | | Change-Id: I3b43d48f5324f3a1f2fff8e22bb4f9563d3ea997 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPaths/Unix: improve the XDG_RUNTIME_DIR creation/detectionThiago Macieira2020-08-252-59/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | First, use QT_MKDIR instead of QFileSystemEngine::createDirectory(), as the latter can't create a directory with the right permissions. That would allow an attacker to briefly obtain access to the runtime dir between the mkdir() and chmod() system calls. Second, make sure that if the target already exists that it is a directory and not a symlink (even to a directory). If it is a symlink that belongs to another user, it can be changed to point to another place, which we won't like. And as a bonus, we're printing more information to the user in case something went wrong. Sample outputs: QStandardPaths: runtime directory '/root' is not owned by UID 1000, but a directory permissions 0700 owned by UID 0 GID 0 QStandardPaths: runtime directory '/dev/null' is not a directory, but a character device, socket or FIFO permissions 0666 owned by UID 0 GID 0 QStandardPaths: runtime directory '/etc/passwd' is not a directory, but a regular file permissions 0644 owned by UID 0 GID 0 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-tjmaciei' QStandardPaths: runtime directory '/tmp/runtime-tjmaciei' is not a directory, but a symbolic link to a directory permissions 0755 owned by UID 1000 GID 100 Pick-to: 5.15 5.12 5.9 Change-Id: Iea47e0f8fc8b40378df7fffd16248b663794c613 Reviewed-by: David Faure <david.faure@kdab.com>
* Implement QAbstractFileIconProvider to use theme and mime databasesVolker Hilsheimer2020-08-261-3/+0
| | | | | | | | | | | | | | This doesn't give useful defaults on all platforms; icon themes are not provided on platforms other than Linux, and the mime database doesn't always return user-friendly names based on file names. However, both icon themes and the mime database can be customized by application developers by shipping a data file side-by-side with the application, without the need for reimplementing the provider class. Change-Id: Ie4b18ac1b861e2da64f01d1f209986b27fbe6bd5 Task-number: QTBUG-66177 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QPromise snippets: use QScopePointer instead of QPointerAndrei Golubev2020-08-261-7/+7
| | | | | | | Change-Id: I2b863e43eb227a80ded3422ca57bd5f5d4209858 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* QRegularExpression: do not assume QStringViews are NUL terminatedGiuseppe D'Angelo2020-08-251-0/+31
| | | | | | | | | | | The convenience API used to look up the index of a named capturing group expects NUL terminated strings. Therefore, we can't just use it together with QStringViews, which may be not. Use the non-convenience API instead. Pick-to: 5.15 Change-Id: I25ca14de49b13ee1764525f8b19f2550c30c1afa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup QTypeInfoLars Knoll2020-08-2610-33/+41
| | | | | | | | | | | | | | | Remove QTypeInfo::isStatic, as that's not used anymore in Qt 6. Also remove sizeOf, it's unused, and we have QMetaType for that if required. Remove all typeinfo declaractions for trivial types, as the default template covers them correctly nowadays. Finally set up a better default for isPointer, and do some smaller cleanups all over the place. Change-Id: I6758ed37dfc701feaaf0ff105cc95e32da9f9c33 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename confusingly named QFont/QPalette::resolve overloadsVolker Hilsheimer2020-08-258-61/+61
| | | | | | | | | | | | | | | Having three methods with the same name doing different things is unnecessarily confusing, so follow the standard naming convention in Qt and call the getter of the resolve mask resolveMask, and the setter setResolveMask. These methods were all documented as internal. The publicly documented resolve() method that merges two fonts and palettes based on the respective masks remains as it is, even though 'merge' would perhaps be a better name. Change-Id: If90b1ad800834baccd1dbc38fc6b861540d6df6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QLineF: Don't try calculating a unit vector when length is nullRobert Loehning2020-08-251-0/+11
| | | | | | | | | | It's undefined and causes a division by zero. Fixes: oss-fuzz-24561 Pick-to: 5.12 5.15 Change-Id: Idebaba4b286e3ab0ecb74825d203244958ce6aec Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qobject: Enable build with CMakeFabian Kosmale2020-08-253-2/+3
| | | | | Change-Id: Ia2b324d0e5aa88ea9a71bb040a740f359e11f2ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* tst_QNetworkDiskCache: fix setCookieHeaderMårten Nordheim2020-08-251-0/+5
| | | | | | | | | | | It wouldn't grab the cached entry since it was not deemed "fresh" (and would never be fresh because we didn't know when it originated from or when it expired). But the test still passed because the reply produced a "finished" signal which ended the loop, but the "finished" signal was due to an error which was unchecked. Change-Id: I6ad271aa621bdb4a48b74bc8fd64c7e2caa8f179 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QPrinterInfo: Remove deprecated methodsMarcel Krems2020-08-251-12/+0
| | | | | Change-Id: I5089bc23308a4348dc21122dfa000d5ca6e3938d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce QEvent::isPointerEvent()Shawn Rutledge2020-08-252-0/+4
| | | | | | | | | | This makes high-level event dispatching easier: for example in Qt Quick, all pointer events should eventually be delivered to items in a similar way. Implemented in a similar way as d1111632e29124531d5b4512e0492314caaae396. Change-Id: I2f0c4914bab228162f3b932dda8a88051ec2a4d7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move QFileSystemModel into QtGuiVolker Hilsheimer2020-08-2511-8/+18
| | | | | | | | | | | | | | This requires a QAbstractFileIconProvider in QtGui, as the standard QFileIconProvider depends on QStyle, and cannot be moved out of QtWidgets. QAbstractFileIconProvider returns strings for file types, but returns no icons yet. Support for a default icon set might be added in a follow-up commit. Change-Id: Ib9d095cd612fdcf04db62f2e40709fcffe3dc2b7 Fixes: QTBUG-66177 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move QStateMachine from QtCore to QtScxmlKarsten Heimrich2020-08-2412-7302/+0
| | | | | | Task-number: QTBUG-80316 Change-Id: I2ee74110fd55e94d86321d3b3dc5bb8297424ed4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* QByteDataBuffer: add readPointer functionality using QByteArrayViewMårten Nordheim2020-08-241-0/+55
| | | | | | | | While it could be done before it's nice to not have a custom "local" struct or the size in an out-parameter. Change-Id: Ie910f7060b1dadf037312d45e922f8e2deafe3ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Disable cipherstring-setting test for schannelMårten Nordheim2020-08-241-0/+4
| | | | | | | And put a note about it in the documentation Change-Id: I29126e4a80f83c256190e03b8fe01f3c869fd46d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_qnetworkreply: Extend httpConnectionCount to test HTTP/2 and TLSMårten Nordheim2020-08-241-7/+46
| | | | | | | | | HTTP/2 is only used initially before it transitions to using HTTP/1.1, and in this case the amount of connections established should also reach 6. Change-Id: I300e171e46c846df1730c07469ea85a51cecfb63 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QIODevicePrivate: rearrange class membersAlex Trotsenko2020-08-241-2/+2
| | | | | | | | | | | | | | As this class is a subject of the library hook data, there must be a solid understanding of the member's alignment and padding across different architectures. By reordering the layout, this patch provides a clearer way of adding new members to the class. Bump the TypeInformationVersion field in qtHookData, to notify the Qt Creator developers that the offset of QFilePrivate::fileName was changed and dumpers should be adapted. Change-Id: Ied8b69bdeb9da50ff05aba2107bc75509674b18e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QLocalSocket: fix wrong slot nameAlex Trotsenko2020-08-241-1/+1
| | | | | | | | | | Suppress the warning: QObject::connect: No such slot LocalSocket::slotError(QLocalSocket ... Pick-to: 5.15 Change-Id: Ia08505ebc85d4070582c7ddaae8b581d394dbb80 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSqlite: Don't crash after binding too many placeholdersMarcel Krems2020-08-241-0/+10
| | | | | | | | | | | | | | When you bind more values than the query has placeholders, indexes will be empty which causes an out-of-bounds access in indexes.first. We can't check the parameter count because of multiple placeholders with the same name, so we check if the name is null. Tested with SQLite and PostgreSQL Pick-to: 5.15 Change-Id: Id5d4bd15d7ed16603f47b87d6e0bf811a20157d8 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Remove QEventPoint::event() in favor of device()Shawn Rutledge2020-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | event()->device() was the most common use case anyway. The idea that the "parent" of a QEventPoint is the QPointerEvent interferes with the ability to copy and move event objects: the parent pointers are dangling unless we use the QPointerEvent subclass destructors to set the points' parents to null. Since there is no move constructor, even returning a QEventPoint from a function by value results in destroying the temporary instance and copying it to the caller's space. So the parent pointer is often useless, unless we do even more work to maintain it when the event moves. If we optimize to avoid copying QEventPoints too much (and perhaps enable exposing _mutable_ points to QML) by storing reusable instances in QPointingDevice (which is the current plan), then the actual parent will no longer be the event. Events are usually stack-allocated, thus temporary and intended to be movable. Change-Id: I24b648dcc046fc79d2401c781f1fda6cb00f47b0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate int based convert/canConvertLars Knoll2020-08-243-11/+11
| | | | | | | Better to provide the correct meta type to convert to. Change-Id: I8e0d46e4ba482186201c157e302c03874bd38e7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-2419-147/+147
| | | | | | | | | | | | | 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>
* Remove refcounting of QMetaTypeInterfaceLars Knoll2020-08-242-7/+4
| | | | | | | | | It's only used for dynamic types in DBUS and QML, where we control things good enough to be able to handle the lifetime of those interfaces there. Change-Id: Ia7f8970d17a85b195db85fcdc2d8f1febd8753f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove an unused enum value and document another oneLars Knoll2020-08-242-26/+27
| | | | | Change-Id: If9fed4f20242d789c1251b8798d7378d2d6911a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move conversions to and from *Iterables into QMetaTypeLars Knoll2020-08-241-0/+4
| | | | | | | | Those were not yet supported by QMetaType. Change-Id: I9f85476049f200e35939ac58ef7e8b4e7cbe0b77 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement QMetaType::canConvert() and use it in QVariantLars Knoll2020-08-244-10/+12
| | | | | | | | | | | | | | | | | | | | Use the fact that we return the conversion function as a lambda to find out reliably whether a conversion between two types can be done. This requires some minor adjustments to our tests: * Nothing can convert to an unknown type and vice versa * Adjust results to the fact that we don't convert from char to QString anymore (where the old method was incorrect) * QStringList->QString requires some adjustments, as we only convert if the string list has exactly one element. For now we return true in canConvert(), but the conversion behavior in this case is something we should rethink, as it is very surprising. Change-Id: I3f5f87ee9cb99d690f5a7d13b13d6a6313d8038e Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Move enum conversions over into QMetaTypeLars Knoll2020-08-241-5/+0
| | | | | | | | Take the opportunity to properly handle the underlying type (size and signed vs unsigned). Change-Id: I0cb8cf40acac6de03c24ed3fe570db68268952c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Start porting conversions over from QVariant to QMetaTypeLars Knoll2020-08-241-5/+0
| | | | | | | | | | This will ensure full symmetry in what QVariant and QMetaType support. With this done, QVariant will become simply a container that can hold any QMetaType with fully symmetric functionality between both. Change-Id: I796d4368a2bc0f08cf4f70f4465ed6a0e07bdd76 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Clean up QVariant::Private::DataLars Knoll2020-08-241-2/+2
| | | | | | | | | | | Remove all the internal members of the union. Instead replace it with raw storage (uchar[]) aligned to max_align_t. Place all accesses to the internal members with get<> methods for consistency. Change-Id: Icebf46b90c9375aa6ea0b5913b2132608e8c223d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix compiler warnings in autotestLars Knoll2020-08-241-1/+2
| | | | | Change-Id: I891b31fa86c6e0e8bcbfb6e6760e093d33598b47 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Always use the variants internal space if possibleLars Knoll2020-08-241-1/+3
| | | | | | | | | | There's no point in storing small types with an external refcount, even if they aren't movable. Simply copying the type should be faster in pretty much all cases, while this uses less memory. Change-Id: I127474f8e3c5fa042f530684f9d5bfccbba134ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Generate less code when creating QMetaTypeInterfacesLars Knoll2020-08-241-3/+2
| | | | | | | | | There is no need to generate wrapper functions for equals, lessThan or debugStream for pointer types, as those can easily be handled by a few lines of code in QMetaType itself. Change-Id: If79b3bc3a629249c1d17c9e592202f08b59f80ef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refactor Q*IterableLars Knoll2020-08-241-11/+8
| | | | | | | | | | | | Refactor the methods retrieving data in Q*Iterable so that we don't return pointers with unclear ownership. Instead, copy the data into a out pointer provided by the caller. This also means there is no need for the metatype flags anymore and we can remove those. Change-Id: I517de23a8ccfd608585ca00403aca0df2955f14b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Cleanups in the Iterable classesLars Knoll2020-08-241-9/+9
| | | | | | | Store a QMetaType, not a meta type id in the classes. Change-Id: If27a60512a46fa029cc914d65b8cad7f89d7f3b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>