summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Support the markdown underline extensionShawn Rutledge2020-11-072-8/+18
| | | | | | | | | | | | | | | | MarkdownDialectGitHub now includes this feature, so *emph* is italicized and _emph_ is underlined. This is a better fit for QTextDocument capabilities; until now, _underlined_ markdown could be read, but would be rendered with italics, because in CommonMark, *emphasis* and _emphasis_ are the same. But QTextMarkdownWriter already writes underlining and italics distinctly in this way. [ChangeLog][QtGui][Text] By default (with MarkdownDialectGitHub), markdown _underline_ and *italic* text styles are now distinct. Fixes: QTBUG-84429 Change-Id: Ifc6defa4852abe831949baa4ce28bae5f1a82265 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QDebug: add op<<(QUtf8StringView)Karsten Heimrich2020-11-071-0/+41
| | | | | | | | [ChangeLog][QtCore][QDebug] Added streaming of QUtf8StringViews. Task-number: QTBUG-88029 Change-Id: Ifcb001cfebddd79ce1cdbfef5bcc19f7c56679ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDebug: add op<<(QByteArrayView)Karsten Heimrich2020-11-071-0/+43
| | | | | | | | | [ChangeLog][QtCore][QDebug] Added streaming of QByteArrayViews. Task-number: QTBUG-88029 Change-Id: I66f5cc45a0438dbaacb1754cb3c669b3717f528b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a mistake when using QLatin1String::argGiuseppe D'Angelo2020-11-072-6/+6
| | | | | | | | | | | | QLatin1String::arg (and QStringView::arg) only support string-like arguments, and QLatin1String("%1").arg(123) does *not* produce the string "123" -- 123 gets routed through the QChar(int) constructor instead. Fix by using QString. Change-Id: I96371a15e1af957ef8133e30e79eb3e22b3e9d32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce QEvent::isSinglePointEvent()Shawn Rutledge2020-11-072-0/+3
| | | | | | | | | | | | This makes high-level event dispatching easier: for example we often need to cast an event to access getters like button() and buttons(). We can so far assume that any QPointerEvent that is not a QTouchEvent is a QSinglePointEvent; but more explicit type-checking looks safer. Implemented in a similar way as c7f727996909338c3689396160f3060480521846. Change-Id: I980d759e2a7538b6b30fd3bdc3be0c351ec6c246 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tests: Blacklist failing tests on MinGWAlexandru Croitor2020-11-061-6/+4
| | | | | | | | | Also move redudant Android entries to already existing sections. Task-number: QTBUG-35109 Task-number: QTBUG-88250 Change-Id: I9d5eaa5a3f11b55566a7c74f84a972a0c272cfea Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QLineEdit: check a int->QChar conversion, and make it explicitGiuseppe D'Angelo2020-11-061-4/+12
| | | | | | | | | | | | | QStyle::styleHint returns int, and that int was simply used to build a QChar representing the "password mask" character. Enforce that it actually fits and then do an explicit cast. (In general, of course, this is an API flaw; styleHint should somehow return a QString for this use case). Change-Id: Ifb6181b229b91cc84859cb9b9d57e21d6748c31a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* qmakelib test: build with qmakeGiuseppe D'Angelo2020-11-061-1/+1
| | | | | | | A dependency was missing, causing qduplicatetracker_p not to be found. Change-Id: I4076d6cf82d804354731c357bcdbfd03c3d42142 Reviewed-by: David Faure <david.faure@kdab.com>
* Use built-in C++ foreach iteration in testsDavid Skoland2020-11-062-7/+7
| | | | | Change-Id: I1e4bf9249ce26c034c676d78cfa16231226da05b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Set the url to have the AtNx filename if one is foundMorten Johan Sørvig2020-11-064-0/+91
| | | | | | | | | | | | | | There’s no need to convert the file name/path to QUrl, and then back again to QString before calling qt_findAtNxFile(). Call qt_findAtNxFile first, and then convert to QUrl. This makes sure the url-name and string-name stays in sync. Change-Id: I8b8939eabbdaff473945ebe31faafd408e9c4295 Pick-to: 5.15 Fixes: QTBUG-60793 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Android: blacklist a list of failing tests for androidAssam Boudjelthia2020-11-0483-38/+490
| | | | | | | | | | | | | | | | We want to re-enable Android tests in QTQAINFRA-3867. However, many tests are failing already preventing that from happening. QTBUG-87025 is currently keeping track (links) to all of those failing tests. The current proposal is to hide those failing tests, and enable Android test running in COIN for other tests. After, that try to fix them one by one, and at the same time we can make sure no more failing tests go unnoticed. Task-number: QTBUG-87025 Change-Id: Ic1fe9fdd167cbcfd99efce9a09c69c344a36bbe4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Rename AllocationPosition enum and its membersLars Knoll2020-11-042-20/+20
| | | | | | | Use GrowsAt* and GrowthPosition as that is clearer. Change-Id: I3c173797dec3620f508156efc0c51b4d2cd3e142 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement QList::emplaceBack as a proper functionAndrei Golubev2020-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | My endeavours figuring out why QList::append(elem) gives worst performance compared to 5.15 ended up into this commit. After some straightforward fixes, what was left is "everything is uniformly worse" and takes more CPU cycles Introduce emplaceBack implementation as append is quite a special case that could be greatly simplified. This is a "straightforward" part of the optimizations While at it, change append(t) to use emplaceBack(t) For workloads like: QList<int> list; forever { list.append(0); } this gives huge improvement (roughly 30% for 10k+ elements), movable and complex types also get a tiny speedup Task-number: QTBUG-87330 Change-Id: I9261084e545c24e5473234220d2a3f2cd26c2b7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove the old insert methods in QArrayDataOpsLars Knoll2020-11-042-63/+25
| | | | | | | | | | Inline them into the one place they are called from and remove duplicated code. Change-Id: Ica88485e98625905083b16c24ee9eaf223a89ae0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Clean up out allocation handlingLars Knoll2020-11-042-131/+98
| | | | | | | | | | Get rid of the allocation options inside the flags field of QArrayData, they are really a completely separate thing. Change-Id: I823750ab9e4ca85642a0bd0e471ee79c9cde43fb Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup QArrayDataOps::reallocate() and relatedLars Knoll2020-11-041-1/+2
| | | | | | | | | | Don't use QArrayData::GrowsForward/Backward anymore and replace it with a simple 'bool grow'. Change-Id: Ifddfef3ae860b11dda4c40854c71ef2aeb29df34 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't move data in QArrayDataOps::reallocate()Lars Knoll2020-11-041-49/+0
| | | | | | | | | reallocate() should only ever call realloc(), and only be used to create more space at the end of the data. Change-Id: I2ac4dbc90d2afaa571bb620108d7984356712cb2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Do not move data around on insert neitherLars Knoll2020-11-041-203/+4
| | | | | | | | | | | The while insertion logic will need further work to make it more efficient. Currently it does use copy construction and assignment for internal moving instead of move operations. Change-Id: I7ae3094daa43a44629d8fa89ab6562c2a21b6cbd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid expensive iterator calculations in append()Lars Knoll2020-11-042-17/+14
| | | | | | | | | | | | | Avoid moving data inside the array to create free space at one end. This is a performance bottleneck, as it required quite a lot of calculations for every insert. Rather reallocate and grow in this case, so we only need to do expensive work when we reallocate the array. Change-Id: Ifc955fbcf9967c3b66aa2600e0627aac15f0c917 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QArrayDataPointer: redesign (and simplify) growth policyAndrei Golubev2020-11-041-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | It looks like we can drastically simplify the way QADP grows without sacrificing much: 1. append-only use cases should have the same performance as before 2. prepend-only use cases should (with the help of other commits) get additional performance speedup 3. mid-insertion is harder to reason about, but it is either unchanged or benefits a bit as there's some free space at both ends now 4. mixed prepend/append cases are weird and would keep excess free space around but this is less critical and overall less used AFAIK Now, QList would actually start to feel like a double-ended container instead of "it's QVector but with faster prepend". This commit should help close the performance gap between 6.0 and 5.15 as well As a drawback, we will most likely have more space allocated in mixed and mid-insert cases. This needs to be checked Task-number: QTBUG-86583 Change-Id: I7c6ede896144920fe01862b9fe789c8fdfc11f80 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QList/QVector benchmark testsAndrei Golubev2020-11-041-1/+265
| | | | | | | | | | | | Added some simple benchmarks for QList insertion of 1 element Added same tests for QVector (within the same file) for 5.15 Task-number: QTBUG-87330 Task-number: QTBUG-86583 Pick-to: 5.15 Change-Id: I19a851c79cf5ce0329266883e99ecaf2d6b3df19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve QtConcurrent::blockingMapped testsSona Kurazyan2020-11-041-18/+11
| | | | | | | | | | | | | QtConcurrent::blockingMapped was not able to determine the result type in case of passing containers that have more than one template argument. This should be fixed by the parrent commit. Also fixed some unrelated compiler warnings. Change-Id: I96618dc955c5e4c3792f28f6436d6851745dc01d Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add multi key bindings to QShortcutAllan Sandfeld Jensen2020-11-041-0/+20
| | | | | | | | | | | This makes it feature comparable with QAction, and makes it possible to use as a backend for QAction, and fixes a few missing alternative keybindings in qtwidgets. Change-Id: Iaefc630b96c4743fc5ef429dc841870ddd99fc64 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add QEventPoint::normalizedPosition() to replace normalizedPos()Shawn Rutledge2020-11-031-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 4e400369c08db251cd489fec1229398c224d02b4 we deprecated normalizedPos() because we suspect it's a legacy feature that few users will need. However Qt developers keep bringing up the continued usage in autotests over and over. (It's IMO not wrong to keep testing deprecated functions in autotests, but the warning keeps attracting attention.) Of course it will turn out that normalizedPos() has users; we just don't know how many. One way to look at it is: why should they copy a snippet of code to calculate it, when it costs us so little to continue to provide this accessor. It might also turn out that some users will complain that in Qt 5 it was passed through from the device driver (or at least from the window system API) to the application, and perhaps the replacement will not always work, for example if availableVirtualGeometry() ends up wrong, or there is some strange scenario that generates events that are out-of-bounds for the device that the event professes to come from, so that the "normalized" coordinates also go outside the [0..1] range. We reserve the right to put back the storage in QEventPointPrivate if the need arises; so that's why this function is not inline. We continue to hope that startNormalizedPos() and lastNormalizedPos() are used even less and won't be missed much, because it would be wasteful to store them all the time if only a few users need them. Change-Id: I23ed78843e3f9e16133c5b6f462884a3845f91b6 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* moc: Handle include in enum, take 2Fabian Kosmale2020-11-031-1/+2
| | | | | | | | | | | | The existing logic broke down when we reentered the enumerator parsing loop, and encountered a INCLUDE_MOC_END token in the first handleInclude call. Fix this by restarting the loop in that case. Amends d8a2456fbf18f60e2d1950585d93aa530df077bf. Fixes: QTBUG-88125 Pick-to: 5.15 Change-Id: I87acaa986a81de53730eddc40bc7d48c15328aba Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of all instance usage of QFontDatabaseVolker Hilsheimer2020-11-039-99/+65
| | | | | | | | All QFontDatabase APIs are static, use them accordingly. Task-number: QTBUG-88114 Change-Id: I0e4a7508646037e6e2812611262eed8b6d7ad3de Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Make the QMultiHash(const QHash &) constructor explicitLars Knoll2020-11-031-0/+6
| | | | | | | | | And add a QMultiHash::unite(const QHash &) method to avoid a copy of the data when inserting a QHash into a multi hash. Change-Id: I864aa9d2b9b7b2c367c3c4d140a2ce2f5408ae09 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix qHash(QMultiHash)Lars Knoll2020-11-031-0/+10
| | | | | | | | | | | | | The old code was trying to convert a multi hash to a QHash. While that worked in Qt 5 it won't compile in Qt 6 anymore. QHashCombineCommutative also can't be used with a std::pair. ADL won't find the correct instance with a namespaced build, as qHash(std::pair) is defined after QHashCommutative. Fix the code to compile and work correctly. Change-Id: Ice2bc3ab4244e310cbbb5e0f31fc11eb14f5faf3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProperty: Fix notification logic for eager propertiesFabian Kosmale2020-11-031-1/+28
| | | | | | | | | | | | | This ensurse that we do not do dobule notifications in setValue. Moerover we avoid needless notifications in markDirtyAndNotifyObservers when the value did not change. Lastly, if the value did actually change, we pass that information along to notify, so that we do not evaluate the eager property twice. Fixes a test-case which errorneously relied on the old behavior, and adds a new test which verifies that the fix works. Change-Id: I8ec6fa2fe8611565dfc603ceab3ba5f92999b26c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove std::function from QProperty interfaceFabian Kosmale2020-11-031-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::function as a type is rather unfortunate for us, as its SSO buffer makes it rather large, and we can ensure that the function is never empty. Considering that we do need to allocate memory for QPropertyBindingPrivate anyway, we can get rid of the SSO buffer and instead coalesce the allocations (similar to how std::make_shared works). The memory looks then like [--QPropertyBindingPrivate--][Functor] and QPropertyBindingPrivate can get a pointer to the functor via reinterpret_cast<std::byte>(this)+sizeof(QPropertyBindingPrivate). To actually do anything with the functor, we do however need a "vtable" which describes how we can call, destroy and move the functor. This is done by creating a constexpr struct of function pointers, and storing a pointer to it in QPropertyBindingPrivate. As a consequence of those changes, we cannot use QESDP anymore, as we now have to carefully deallocate the buffer we used for both the QPropertyBindingPrivate and the functor. We introduce a custom refcounting pointer for that. While we're at it, we make the refcount non-atomic, as bindings do not work across threads to begin with. Moreover, we can now make the class non-virtual, as that was only needed to hack around limitations of QESDP in the context of exported symbols. Change-Id: Idc5507e4c120e28df5bd5aea717fe69f15e540dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename QContainerTraits namespace to QContainerInfoLars Knoll2020-11-031-111/+111
| | | | | | | | | | | | We'll need QContainerTraits as a class for changing properties of our containers, so free up that name. This is not a problem, as the namespace is new in Qt 6 and has only been used internally so far. Change-Id: I6d6b9d9c32b92b77e66323f1fc29b3ddd8baa98f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QCombobox: propagate the palette to the embedded line editWang Chuan2020-11-021-0/+27
| | | | | | | | | | Let the new created embedded QLineEdit use the palette from QCombobox, when calling [setEditable(true)] Fixes: QTBUG-81533 Pick-to: 5.15 Change-Id: Ia406dd8122a348e185f0e94d027646b95eeaa76e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix tst_qtimer::zeroTimer unit testAndreas Buhr2020-11-012-3/+3
| | | | | | | | | | | | | | | | The tst_qtimer::zeroTimer unit test was relying on QCoreApplication::processEvents processing all pending events. However, for the glib backend, this is not the case. For the glib backend, if there is an event of high priority pending, low priority events are not processed. This patch changes the test to use the overload with timeout of processEvents, which does process events until there are no more events or the timeout is reached. Fixes: QTBUG-84291 Change-Id: I429141507b8603b57a191efa21f154493d75cc9e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Update tst_qcborstreamwriter to use QMetaTypeDavid Skoland2020-10-301-10/+10
| | | | | | | Since the QVariant types are deprecated in Qt6, use QMetaType instead Change-Id: I7bddea15a3f1a534d3c6f6b9e7ddf9585a8423bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Fix tst_qapplication to respect blacklists in CMake buildsAlexandru Croitor2020-10-301-0/+1
| | | | | | | | | | | CMake builds are special and need to know the path to the source dir. This is handled automatically by QTEST_MAIN, but tst_qapplication doesn't use QTEST_MAIN. Thus we need to call QTEST_SET_MAIN_SOURCE_PATH manually. Task-number: QTBUG-87137 Change-Id: Ib2c461f0da0a3d9a2f571f37476b750a606065f7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Adapt QDate::fromString() to accept negative year numbersAndreas Buhr2020-10-303-1/+104
| | | | | | | | | | | | | The documentation states that QDate::fromString() accepts negative year numbers, but it did not. This patch adds support for negative year numbers to QDate::fromString() and corresponding unit tests. Furthermore, tests are added for positive signs (+) in date strings. Fixes: QTBUG-84334 Task-number: QTBUG-84349 Change-Id: I575291e7b8317055d4bb530011d7b10c9cd37ae1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use universal references for passing callables in QtConcurrentSona Kurazyan2020-10-303-0/+411
| | | | | | | | Task-number: QTBUG-87596 Change-Id: I219f08d73b97317820ec6e329ab1e6c89c0545f1 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Forbid implicit conversions between QFuture and other typesSona Kurazyan2020-10-306-65/+71
| | | | | | | | | | | | | | | | | | | | | - Remove the casting operator of QFuture<T> to T. It calls QFuture::result(), which may lead to undefined behavior if the user has moved the results from QFuture via QFuture::takeResult() before trying to do the conversion. - Disable implicit conversion of QFuture<T> to QFuture<void>, by making the constructor explicit. If the users really intend to do the conversion, they should do it explicitly. [ChangeLog][Source-Incompatible Changes][QFuture] Implicit conversions of QFuture<T> to T and to QFuture<void> have been disabled. Use QFuture::result() or QFuture::takeResult() where you need to convert QFuture<T> to T. Use the explicit QFuture<void>(const QFuture<T> &) constructor to convert QFuture<T> to QFuture<void>. Change-Id: I153d4137d36365b1611ac934fb3ac2eb667fdd6c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* tests: blacklist tst_QTcpSocket::connectToHostError()Liang Qi2020-10-301-1/+2
| | | | | | | | on Ubuntu 20.04. Task-number: QTBUG-88042 Change-Id: Ie63cd26b6885b73073251e20cb4e8ba5da36d906 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Adjust tst_qdbusmarshall to QVariant changesFabian Kosmale2020-10-301-24/+58
| | | | | | | | | | | | Comparing QVariant's containing QDBusArguments does not work anymore in Qt 6, where QVariant will simply use QMetaType equals. Thus we now do the comparisons in a more manual way. This is currently only partially implemented. Additionally, adjust to changed warning message. Fixes: QTBUG-87998 Change-Id: Ie63db4e8c8d03d7627234f3c892067d1557454af Reviewed-by: Liang Qi <liang.qi@qt.io>
* Make QVarLengthArray comparisons hidden friendsAllan Sandfeld Jensen2020-10-301-3/+3
| | | | | | Task-number: QTBUG-87975 Change-Id: Iaebb237b3d5d3e881caf9a93153e295af051e2ab Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add unit tests for QDateTimeParser internalsAndreas Buhr2020-10-301-0/+78
| | | | | | | | | | | | | | | | | | | | So far, the internals of QDateTimeParser and especially the handling of 'Intermediate' values were only tested implicitly by tst_qdatetimeedit. 'Intermediate' values are values which are not valid according to the specified format, but could become valid by adding more characters. This patch adds unit tests which tests parsing of these intermediate values directly. These tests will help implement handling of negative year numbers, where additional complications arise because of possible ambiguities between the minus sign '-' and the separator '-'. Task-number: QTBUG-84334 Change-Id: Ia6ba08df198288b8b11d3b2d2052c194f04fe8a1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtConcurrent: Provide a test for runWithPromise with handlersJarek Kobus2020-10-301-1/+110
| | | | | | | | | | | | | | | | Test runWithPromise with "then" and "onCanceled" handlers. Test the case when QFuture::cancel() is being called when the task's thread already started, so that a call to QPromise::isCanceled() from inside the running thread returns different values in the same task's run. This nicely proves that communication between QFuture and QPromise works between different threads. Task-number: QTBUG-84868 Change-Id: Icb2e0b1f99e2dcd919d881515f1ccd08e2f25b8c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add QPushButton::touchTap autotestShawn Rutledge2020-10-291-0/+25
| | | | | Change-Id: Ibfed43fd4b8fdc3834ee7ca7bd92296504943abe Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the comparison operators of QFutureSona Kurazyan2020-10-292-4/+1
| | | | | | | | | | | | | | These operators don't do what the user might expect and may lead to confusing results. [ChangeLog][Source-Incompatible Changes][QFuture] The comparison operators of QFuture have been removed. They were comparing the underlying d-ptrs instead of comparing the results (as the users might expect), which is not very helpful for the users point of view. Change-Id: I80a887610eac38b60329128cca52cdb5fb515207 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Workaround gcc compiler bugVolker Hilsheimer2020-10-292-16/+16
| | | | | | | | | | | | | | | | For the comparison of a QFuture<int> and an int, gcc creates code that creates a qfloat16 instance, as can be seen when stepping through this code: QFuture<int> future; int five = 5; if (future == five) return five; Explicitly get the result of the QFuture to compare as a workaround. Change-Id: Id2adc2268dbc0ccec7df3a9786c9d29dcdc04da3 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* CMake: Update usage of add_qt_gui_executableAlexandru Croitor2020-10-292-2/+2
| | | | | Change-Id: I8a5e3b4ecdd1c4fa888d4e11dfd09c5116cfb4d4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Purge deprecated language and country codes from QLocaleEdward Welbourne2020-10-291-28/+0
| | | | | | | | | | | | | | | | | | | | Requires subsequent re-numbering of the enum tables to eliminate gaps, before locale data can be regenerated. However, it will work with the present locale data, since it merely loses the means to use some names for which the available data was just the name and code. This implies a transient issue of recognising some codes for which there is no actual enum member; but relevant code will work as before, finding nothing but the code and its name. This shall be resolved by a coming BiC change to resort the language, country and script codes, changing the numbering (almost) completely. [ChangeLog][QtCore][QLocale] Various obsolete language and country codes have been removed. Some lacked locale data, others were obsolete aliases. All have been deprecated in 5.15. Task-number: QTBUG-84669 Change-Id: I45fc76a5f2f6c3b0ea3c1bb61e917da984183783 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Initialize values in collection testsDavid Skoland2020-10-281-2/+2
| | | | | | | This silences a compiler warning Change-Id: I8d01b5d008ab4f90d5551fef522e2e3c3adb02ba Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update tst_qspinsbox test to use metaType systemDavid Skoland2020-10-281-1/+1
| | | | | Change-Id: Ib744a1ceb3d90ae443ee754f97c0ef1edbbac52f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>