summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix cmake tests for no-widgets and no-gui configurationsAlexandru Croitor2020-11-101-6/+30
| | | | | | Task-number: QTBUG-86053 Change-Id: I108977546304f203f6e2b7e983bb909b76626a9f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QSignalSpy: Use QMetaType instead of metatype id in initArgsFabian Kosmale2020-11-101-0/+24
| | | | | | | | | | | | | | | The RegisterMethodArgumentMetaType had been changed to take a QMetaType instead of a type id in 0161f00e5043090f22b23de9822c09062b17d675. Unfortunately, the usage of it in QSignalSpy was missed. This patch adjusts the metacall to correctly use a QMetaType. Moreover, use parameterMetaType instead of parameterType to benefit from metatypes which are already resolved at compile time. Task-number: QTBUG-88260 Fixes: QTBUG-88356 Change-Id: Id8fa46581a005d62818971ea24d8aa2e39dcd6d0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix QArrayDataOps generic and relocatable emplace()Andrei Golubev2020-11-092-20/+233
| | | | | | | | | | | | | | | | | | Emplace() implemented with std::rotate is just awful on my system (Ubuntu 18.04 GCC 7.5.0). Custom code is much faster, so go for it. Cannot really use insert() code, which is also fast, because it doesn't forward-reference values but copies them always Changes in performance (approximately) for emplacing 100k elements into the middle: Complex 7600ms -> 1700ms Movable 7600ms -> 200ms Task-number: QTBUG-86583 Change-Id: If883c9b8498a89e757f3806aea11f8fd3aa3c709 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMultiHash: add a QHash&& constructor and unite() overloadMårten Nordheim2020-11-091-0/+113
| | | | | | | | Reaches into the internals to avoid erasing one entry at a time from the QHash. Change-Id: I47079592d130d2ecd844998dfa31e633e049d4c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add tests for QOperatingSystemVersionIvan Solovev2020-11-096-1/+205
| | | | | | Task-number: QTBUG-88183 Change-Id: I7083dae5bf9ef8cc5eb18e68052706cc3f7c66ab Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Automatically generate unit tests for QtConcurrentAndreas Buhr2020-11-0920-45/+1947
| | | | | | | | | | There are many different ways to to call map and filter functions in QtConcurrent. This patch adds a python script to generate all possible combinations. Change-Id: I61ed1758601e219c5852e8cc939c5feebb23d2f6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Allow painting above INT16_MAX on 64-bit architecturesAllan Sandfeld Jensen2020-11-091-0/+64
| | | | | | | | | | | The logic in qgrayraster was ready for it except for an intermediate format. qrasterizer.cpp and qcosmeticstroker.cpp uses a dot-16 fixed point format, and had to be changed to handle higher coordinates on 64-bit architectures. Fixes: QTBUG-84428 Change-Id: I85ab7a04e38bd0dbcefa9f16c16ccc84785a33cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* moc: output errors and warnings in a way that matches compilersVolker Hilsheimer2020-11-091-50/+50
| | | | | | | | | | | | | | | | | | gcc, clang, and MSVC all use lowercase "warning:", "error:" and "note:". Follow that standard. Also, include a column number; just print 1, as the Symbol doesn't give us a column number, and searching backwards for a newline seems overkill. This fixes IDE integrations that parse compiler output using regular expressions. The test checks for moc output, but most tests were so far only running on Linux systems. Expand this to Unix for most tests, which then includes macOS. Change-Id: I0a6151cc0dc50e52ca72ff8048a45213aebdb3a8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Teach QPixmapIconEngine how to handle @Nx pixmapsMorten Johan Sørvig2020-11-081-0/+45
| | | | | | | | | | | | | | | | | | | | Bring QPixmapIconEngine on par with QIconLoaderEngine when it comes to @Nx pixmap handling: Make the scale factor a test parameter during icon lookup. This allows storing e.g 16x16@1, 16x16@2, 16x16@3 versions of a pixmap in the icon, and then having QIcon select the correct one based on the target devicePixelRatio. Extend the qiconhighdpi test to also cover QPixmapIconEngine, via the addPixmap() API. The corner cases of pixmap lookup can be much complicated. QIconLoaderEngine and QPixmapIconEngine should ideally have identical behavior in order to avoid surprises. Change-Id: I17552cc61755bff9553c4a462e3983ac6759c13b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Update public suffix list header to latest versionEdward Welbourne2020-11-081-1/+2
| | | | | | | | | The former *.platform.sh entry has been replaced by more specific entries, replacing the wildcard with only selected second levels. Task-number: QTBUG-87925 Change-Id: Ie4ba7c66ba9aa40eafe23f02faa12f19d791cff2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update CLDR to v38Edward Welbourne2020-11-081-1/+1
| | | | | | | | | | | | | Fresh on the heels of our update to v37, they've released a new version. No new languages to complicate life, fortunately. Updated license (year range) and attribution. One test also needed an update: Catalan's long time format now parenthesizes the zone. Task-number: QTBUG-87925 Pick-to: 5.15 Change-Id: I54fb9b7f084b5cd019c983c1e3862dc03865a272 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Rename QRangeCollection to QPageRanges, make it a proper value typeVolker Hilsheimer2020-11-087-87/+195
| | | | | | | | | | | | | | | | | | | | | | | The type is specific about printing, so give it a name in line with QPageLayout and QPageSize. As per API review comment, it's not clear why this type should not be a regular, copyable and movable value type. It stores a list of intervals. Give it value-type semantics, as an implicitly shared class. Convert the parse method into a static factory function. Add a Range type and use it instead of the semantic-free QPair. Move QPrinter getter into QPagedPainteDevice, make it return a copy rather than a pointer, and add a setter. Extend test case to cover all members and more merge cases. Fix bugs found that way. Fixes: QTBUG-88113 Change-Id: If17ea4d410d49f16b097e88b7979db5d72add820 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSharedMemory: do not abuse QChar in a testGiuseppe D'Angelo2020-11-081-2/+2
| | | | | | | | The set() function sets a given byte in shared memory. Thus, just take a char, not a QChar. Change-Id: I6f3d148eb730573070832ddce6f63363408790cf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tests: Blacklist tst_qwindow failing test on WindowsAlexandru Croitor2020-11-071-1/+1
| | | | | | | | | Amends b13bad3ab0de96a3c6fe6dce4b9f35649f2f37d9 Task-number: QTBUG-35109 Task-number: QTBUG-88250 Change-Id: I0b37369bb7cfc58e6968ca20969725e2f4143200 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStringView test: avoid narrowingGiuseppe D'Angelo2020-11-071-2/+2
| | | | | | | Use '\0' (char) instead of 0 (int). Change-Id: I866d08e7b07ae555fcf0244a8614e3e04a0bc567 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>