summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add more tests for QList/QString/QBAAndrei Golubev2021-04-273-27/+471
| | | | | | | | | | | | | | | | The major part is stability tests for QList operations, Also added std::shared_ptr to the Custom type. shared_ptr accesses the memory which does not directly belong to QList, so using it inside a passed-to-qlist type is beneficial (e.g. ASan could catch extra issues) Basic prepend-aware cases added to QString/QBA tests Task-number: QTBUG-93019 Change-Id: I50e742bdf10ea9de2de66539a7dbb9abc4352f82 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit adb41bbe00b2b853d4dd26cd9ee77ae5ed541576) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add tests for QtPrivate::q_relocate_overlap_nAndrei Golubev2021-04-271-0/+281
| | | | | | | | | | | | | | | Test the relocation logic through the QADP::relocate() method which basically calls q_relocate_overlap_n inside and then ensures that the data pointers are in good state Running these locally in fact revealed a bug in the implementation, so these tests are definitely good to have Task-number: QTBUG-93019 Change-Id: I353ed46a31c5c77cd0c5fcacd3dfce46e5cf3e67 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 65d0f6829cc124f6d0d4003a17bedcb74dddf33b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Resurrect data moves in QListAndrei Golubev2021-04-272-17/+59
| | | | | | | | | | | | | | | | | | Use the data moves to readjust the free space in the QList, which ultimately fixes the out-of-memory issues caused by cases like: forever { list.prepend(list.back()); list.removeLast(); } Task-number: QTBUG-91801 Task-number: QTBUG-91360 Task-number: QTBUG-93019 Change-Id: Iacff69cbf36b8b5b176bb2663df635ec972c875c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit a0253f5f0249024580050e4ec22d50cb139ef8d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QTreeModel calling beginRemoveRows twiceLuca Beldi2021-04-261-0/+16
| | | | | | | | | | | | | | For items that are children of other items, removeRows calls beginRemoveRows directly and then once again inside takeChild() The signal blocker that dates back to the monolitic import from Nokia prevents the model from emitting extra signals but the persistent indexes are corrupted nonetheless. Fixes: QTBUG-90030 Change-Id: I5bc4b2598bf13247683b113faeec22471f1f04a4 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 6ec3fa2842b5c4714dc9a3953b2721ef70dd957b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QAbstractItemModelTester false positiveLuca Beldi2021-04-261-0/+4
| | | | | | | | | | When inserting rows to a branch with no columns the tester should not complain about indexes being invalid Change-Id: I466f4e5140b10f6dcf65a71f109c2d3be7336507 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit fcea8e7aa8a65de9e80136c2d603478831b246d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QThreadPool: obey the docs that say we always use at least 1 threadThiago Macieira2021-04-241-1/+1
| | | | | | | | | | | | | | | Even if the user (usually accidentally) sets a thread count of zero or negative. The reporter in the bug report did QThread::idealThreadCount() - 1 on a 1 CPU system... Drive-by add to the documentation and the missing #include. Fixes: QTBUG-93007 Change-Id: I6cdea00671e8479b9c50fffd167807d14e030154 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit 885eff053797d56f2e295558d0a71b030fbb1a69) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix case sensitivity handling QSFPMSamuel Gaist2021-04-221-0/+66
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the breaking of case sensitivity handling. The removal of QRegExp killed the wrong code paths which leads to inconsistencies when changing the regular expression throuh methods like setFilterWildCard or setFilterFixedString. Changing the case sensitivity also nukes the original options that were set on the regular expression if it was set through setFilterRegularExpression. [ChangeLog][QtCore][QSortFilterProxyModel] Case sensitivity as well as regular expression options handling have been fixed. The original value is properly kept when using setFilterWildCard and setFilterFixedString. The regular expression options are now also properly kept when changing the case senstitivity through setFilterCaseSensitivity. Fixes: QTBUG-92260 Change-Id: Ifb4732306f0c7d79ad0b18d3f5437c4523bb40e5 Reviewed-by: Igor Kushnir <igorkuo@gmail.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correct prefix reported for end element in QXmlStreamReaderVincent Baijot2021-04-208-13/+13
| | | | | | | | | | | | | | | | | | | | Before this change, QXmlStreamReader prefix value was always an empty string for EndElement when the documentation state : "Returns the prefix of a StartElement or EndElement." The error was a missing update of the prefix value when parsing EndElement. I updated the tests data which were also wrong because no prefix were reported even for </a:foo>. No new test is necessary, I think, the test data already cover the cases of EndElement with a prefix and without one (unchanged here). Fixes: QTBUG-86847 Change-Id: I0ad38b9741d760f1ce688a36f969ec14e20a928c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 366bdcde97962cf5804c519e9b605eddb543a592) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix get out of bounds index in QSortFilterProxyModel::filterAcceptsRowChunLin Wang2021-04-201-0/+17
| | | | | | | | | Before calling the index function, we need to check the validity of the parameters. Fixes: QTBUG-91878 Change-Id: I9ec7265fff3f81b8a288c4ba8fae606a2ec808a6 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit b8802071ed00689373da5817fc4824a30b5fcf86)
* Fix QAbstractItemModelTester false positiveLuca Beldi2021-04-191-2/+5
| | | | | | | | | | | When rows are removed from a model with no columns, the test should not report a problem if indexes are invalid Fixes: QTBUG-92886 Change-Id: I7a042dfdb2575f87208a00cbed13db3869807f84 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit fed2c0d23614df1b96dcc8746223501b07597a52) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Unicode: fix the extended grapheme cluster algorithmGiuseppe D'Angelo2021-04-192-634/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UAX #29 in Unicode 11 changed the EGC algorithm to its current form. Although Qt has upgraded the Unicode tables all the way up to Unicode 13, the algorithm has never been adapted; in other words, it has been working by chance for years. Luckily, MOST of the cases were dealt with correctly, but emoji handling actually manages to break it. This commit: * Adds parsing of emoji-data.txt into the unicode table generator. That is necessary to extract the Extended_Pictographic property, which is used by the EGC algorithm. * Regenerates the tables. * Removes some obsoleted grapheme cluster break properties, and adds the ones added in the meanwhile. * Rewrites the EGC algorithm according to Unicode 13. This is done by simplifying a lot the lookup table. Some rules (GB11, GB12, GB13) can't be done by the table alone so some hand-rolled code is necessary in that case. * Thanks to these fixes, the complete upstream GraphemeBreakTest now passes. Remove the "edited" version that ignored some rows (because they were failing). Change-Id: Iaa07cb2e6d0ab9deac28397f46d9af189d2edf8b Fixes: QTBUG-92822 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> (cherry picked from commit a794c5e287381bd056008b20ae55f9b1e0acf138) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Re-layout QProgressDialog when setting the cancel buttonQiang Li2021-04-191-0/+24
| | | | | | | | | | | | | | | Setting a cancel button on QProgressDialog more than once caused the layout to be invalid. The layout was only applied when the dialog resizes or the style changes, but not when a new cancel button is set. The solution is to update the layout() before showing the dialog when adopting new child widgets. Fixes: QTBUG-19983 Change-Id: Id8fb1ac56e94a9bd97d4559a2e8d4835856fd7d0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 777053cfff40570282e861527e0e52e22a359629) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QODBC: Preserve the whole value when using HighPrecisionAndy Shaw2021-04-191-0/+35
| | | | | | | | | | | | | Some ODBC drivers do not properly handle SQL_NO_DATA and therefore decimal values returned with HighPrecision are cut off because the decimal point is not taken into account. Fixes: QTBUG-73286 Change-Id: I905c947b4d0266a3245d5735300300ca00f77480 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit c2657f9762e01abd65ac991ba31e3ca085d9540c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qcborstreamwriter: don't pass char8_t strings to QByteArrayGiuseppe D'Angelo2021-04-161-2/+2
| | | | | | | | | | | | | | | There isn't a QByteArray constructor taking a char8_t*. (I am not sure if there should be one; QByteArray is not going to anything special about that information anyways.) Change such strings to be "ordinary" narrow string literals. There should be no problems at doing so, as by default we build in UTF-8 mode under all compilers. Change-Id: Ia200ec6e3b0453bad033d5d8ff34c013bb27abd1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b9d0fd3a09c23b410bb8ef228ff5326d118f3069) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid processing-intensive painting of high number of tiny dashesEirik Aavitsland2021-04-141-0/+34
| | | | | | | | | | | | | When stroking a dashed path, an unnecessary amount of processing would be spent if there is a huge number of dashes visible, e.g. because of scaling. Since the dashes are too small to be indivdually visible anyway, just replace with a semi-transparent solid line for such cases. Change-Id: I9e9f7861257ad5bce46a0cf113d1a9d7824911e6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit f4d791b330d02777fcaf02938732892eb3167e9b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make POSIX transition rule parser more robustEdward Welbourne2021-04-141-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | The POSIX rule parser used by QTzTimeZonePrivate recklessly assumed that, if splitting the rule on a dot produced more than one part, it necessarily produced at least three. That's true for well-formed POSIX rules, but we should catch the case of malformed rules. Likewise, when calculating the dates of transitions, splitting the date rule on dots might produce too few fragments; and the fragments might not parse as valid numbers, or might be out of range for their respective fields in a date. Check all these cases, too. Added a test that crashed previously. Changed QTimeZone::offsetFromUtc() so that its "return zero on invalid" applies also to the case where the backend returns invalid, in support of this. Fixes: QTBUG-92808 Change-Id: Ica383a7a987465483341bdef8dcfd42edb6b43d6 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io> (cherry picked from commit 964f91fd25a59654905c5a68d3cbccedab9ebb5a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAbstractItemModelTester: fix false positive when model has zero columnsDavid Faure2021-04-121-0/+10
| | | | | | | | | | | Regression introduced by me in commit 72e0d699cec09458ca9325035d477d4899e8e47b Fixes: QTBUG-92220 Change-Id: Ic7dd4eda0a1993f9763933882baf928bfc83b08b Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b4aac2af19690917553f93660e3ad760fc15d0b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtFuture::connect: disconnect signals firstMårten Nordheim2021-04-121-0/+19
| | | | | | | | | | | During reportFinished we may call a continuation which might end up triggering one of the signals. Change-Id: I19546fcca12be71cd536e4287eb5eddd9d236830 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit bb85831e4de5e2c4951a0c40003ccf36f57cbd93) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add binary compatibility files for Qt 6.0.0Milla Pohjanheimo2021-04-0811-0/+93524
| | | | | | | | | Binary compatibility files added. Change-Id: I89fe7daae970af697ec57a414e3c90b24d4f9a86 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 9224f8e99fd8be0aaf5971783af4e32e3795ca24) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix removing columns when QSortFilterProxyModel has not been sorted yetJoni Poikelin2021-04-081-0/+14
| | | | | | | | Fixes: QTBUG-91788 Change-Id: Iddcafd3171f0f3703b94893a32b4ccaaeea9e713 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit e287582cba74ddcfc67f83647e72c0b23bd99c36) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTypeInfo: Handle T::value_type being equal to TFabian Kosmale2021-04-051-0/+10
| | | | | | | | | | | | | | | | | | Fix operator checks for containers whose value_type equals themselves. It does not make sense to recurse on value_type in that case. Thanks to std::disjunction having short-circuiting semantics, we can avoid that issue by checking first whether T is T::value_type. As a drive-by, check for value_type typedef before checking for begin/end in is_container. This works around an issue in gcc <= 8.1, which fails to correctly SFINAE the case where begin and end are private methods. Fixes: QTBUG-89456 Change-Id: I27305a7cfe050f13a279c07f00bc229c01daa25b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit ce83e56cfeb2806181ec1daade9690f4c90b901c) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Stabilize test QMenu::QTBUG_89082_actionTipsHide() on WindowsFriedemann Kleint2021-04-011-0/+3
| | | | | | | | | | | Move the cursor out of the way to prevent it from interfering. Amends 3f3d5e6716d9130776b3613ccbd5595de7d4af8d. Task-number: QTBUG-89082 Change-Id: I0efbe2b5618a04e92839083a1bd3383e05d6ff93 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit ba139603925453bf79994eca48b566d8f15b2af0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip a tst_QRhi test case with the Android emulatorLaszlo Agocs2021-04-011-0/+3
| | | | | | | | | | Task-number: QTBUG-92329 Task-number: QTBUG-92211 Change-Id: I63ff17b226d502189bc769b0b28640b849b8d39a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9e662a0baf46253fcb88027688587c06b7112620) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ab32956178331bd323b8341129a237ae0030387b)
* tst_qobject: fix the detection for GCCGiuseppe D'Angelo2021-03-261-4/+14
| | | | | | | | | | | | | | Q_CC_GNU is defined on compilers that masquerade as GCC (Clang, ICC), so using it to work around GCC-specific bugs is wrong. Introduce a local define for _only_ GCC and use it in place of Q_CC_GNU. Drive by: version-fence a test we now know it's been fixed upstream, and correct the link to the corresponding bug report. Change-Id: I9059d6e6bf86157aca71590ac22afb1a1c114313 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 8b9c8d417b8ff2d4f60d83f9cc69c148632d1046) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPainterPath: fix handling of fill rulesGiuseppe D'Angelo2021-03-261-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | fillRule() contained a major blunder: instead of checking if the d-pointer was allocated, and return a default value if it wasn't, it checked whether the path contained any points. This means that QPainterPath p; p.setFillRule(x); Q_ASSERT(p.fillRule() == x); was failing. As a drive-by to test this change, fix another mistake in clear(): clear is documented to clear the elements in a path, but instead it also changed the fill rule. This commit partially reverses 697910e5fbd382e78bc1bcbac3f5824aded059b4. Change-Id: Ieb8145694b672439c3380d9ccb87d1206a2dd115 Done-with: Milian Wolff Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 0b4ccbf81ee2009051169f2f0918442b56512b20) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QEventDispatcher(Win): Always honor interrupted status to avoid racesMårten Nordheim2021-03-251-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | There may be a race where e.g. thread 'B' is woken up by a queued invoke. At the same time thread 'A' asks 'B' to quit, which will set various atomics (some important ones are 'interrupt' in the dispatcher and 'exit' in the event loop), but it does _not_ try to send another wake since there is already an unhandled wake triggered by 'B' itself. Sadly 'B' reads the 'exit' atomic before 'A' updates it. Then, slightly before, 'B' sets 'interrupt' back to 0, 'A' write 1 to it, meaning 'A's interrupt is ignored. Then, since there is no interrupt, 'B' goes back to waiting for events, leaving the thread alive and running instead of quitting. Maybe this has unforeseen consequences (one consequence is that it will return and re-enter the event dispatcher once more, possible unnecessarily) Fixes: QTBUG-91539 Change-Id: Ie6f861f42ffddf4817d5c8af2d764abe9d9103c2 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f274f91cebb0a4fd2ebe37bb3a605c47d6acd404) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix alpha handling of QImage::setPixelv6.0.3Allan Sandfeld Jensen2021-03-231-11/+61
| | | | | | | | | | It was treated differently depending on format, made it consistently behave the same for all formats (following the behavior of the primary formats). Change-Id: Ie24e19957d076fdf3ebd333074e26ede187489eb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c32cd44d34910cfd42e32537578e4a573138a282)
* Fix invalid pointer return with QGridLayout::itemAt(-1)Zhang Yu2021-03-221-0/+51
| | | | | | | | | | | QGridLayout::takeAt() and QLayoutItem *itemAt() only check the upper bound. If the index < 0, these function will return invalid pointer. Fixes: QTBUG-91261 Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit c47bb4478a4c3a29c0505d7d89755f40601b326f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslSocket::setSslConfiguration - skip if SecureTransport is in useTimur Pocheptsov2021-03-221-0/+4
| | | | | | | | | | | | | | SecureTransport does not allow deprecated digest algorithms, and (depending on ST version) it may or may not accept our server's certificate. Funnily enough, they 'fluctuate' between versions again and again. Fixes: QTBUG-89922 Change-Id: Ie5fbfca316806bd5000ce2d128b81b718bb36624 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 3d5f86e77d0740d72cd8922c7b1d4f8cde460ee1) Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Stabilize test QMenu::QTBUG_89082_actionTipsHide() on Windows, take 2Friedemann Kleint2021-03-221-3/+5
| | | | | | | | | | | | | | Use the QWindow-based overloads of QTest::mouseMove(), which do not move the cursor position. Amends ba139603925453bf79994eca48b566d8f15b2af0, 3f3d5e6716d9130776b3613ccbd5595de7d4af8d. Task-number: QTBUG-89082 Change-Id: I2cc62e4d1f24e4baebafd0d76fbf0fbdb6f588c7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 65c6fbea242e150d785ea0a7062188fdc090af32) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_bench_qmetaobject: Fix testFabian Kosmale2021-03-191-3/+4
| | | | | | | | | | | The code has apparently been broken for quite a while, probably since the change that made the QObject constructor invokable. Fixes: QTBUG-91710 Change-Id: I8b7e6c8a579913b3d0e2a364ffdbffe8d404c72b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit ed3df88846d3d92baf7110063cc7b82b7c45d1ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QMetaType benchmarkFabian Kosmale2021-03-121-3/+5
| | | | | | | | | | The benchmark used to crash because QMetaType::typeName would return an empty string, which is not a legal value for newRow. Change-Id: I9e6c6c1cf153943bfa21181cd2cca596a7943ea0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 1316af2f3ed7861d0955793261a18f8ebf237f6f) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix QMultiHash::count(key) crashAndrei Golubev2021-03-121-0/+15
| | | | | | | | | | | | As QMultiHash uses a pointer for the data, nullptr dereference is a thing, so check for valid d before doing anything in count() Fixes: QTBUG-91704 Change-Id: Ia20440cd7bdc03cb09c77f796fb9c5b52765eac5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f226854d256a382a5cc7ff08b10a0d27fbefb0fe) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Revert "QPushButton: fix support of style sheet rule for text alignment"Volker Hilsheimer2021-03-111-0/+18
| | | | | | | | | | | | | | | | | This reverts commit 6269438af95bbd988ead08829fa3bc9dc25891e8, and adds a test. This change introduced QTBUG-91735, without fixing QTBUG-86857 correctly. The code already interprets the textAlignment values from the rule, also if no icon is set. Adding the same, or some default textAlignment to the text flags if there is no icon doesn't work. Fixes: QTBUG-91735 Task-number: QTBUG-86857 Change-Id: Iee07e63a40e72909275f32e1caa28b33a595f879 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 674747bac1c8b57d4940de2ee68b6b562dfcad61) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QConcatenateTablesProxyModel: skip dataChanged in hidden columnsDavid Faure2021-03-091-0/+11
| | | | | | | | | | | | | | | | | When the source models don't have the same number of columns, the proxy keeps only the smallest number of columns across all source models. Afterwards, if a source model emits dataChanged in a column past that number (a "hidden" column), the proxy needs to ignore it rather than assert. But also, if the source model emits a dataChanged signal across both visible and hidden columns, then the last column number needs to be adjusted so that the signal is correctly processed and forwarded. Task-number: QTBUG-91253 Change-Id: I939e8ec0faf41370472f86785851292e4372f72c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit f6efbd23b59bcf75866ce47fb762c99f2e4a128a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: gl: Fix missing uniform data with certain command listsLaszlo Agocs2021-03-091-49/+170
| | | | | | | | | | | | | | | Following patterns from the other backends is insufficient with OpenGL because we do not use real uniform buffers. There is currently a possibility that a shader program will be bound without following it with setting uniforms. Correct this by having a second level of tracking of the associated srb object in the pipelines. Fixes: QTBUG-91630 Change-Id: I74a012daade826dd22c436bde06381c1233bad11 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 80029e0ca65d4bf4575f7a08d186c781ec6c2f0e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the crashes when animated QTreeWidgetItems are hiddenQiang Li2021-03-081-0/+24
| | | | | | | | | | | | | | | | | | | QTreeView's drawTree implementation performs lazy layouting when calling itemDecorationAt. If animations are enabled, this can change the list of items, and invalidate the copy made earlier. Don't copy the list of items, use a reference instead so that code iterating over the items later operates on valid data. Add an assert in the private itemHeight method, it must not be called with an index that is out of bounds. Fixes: QTBUG-42469 Change-Id: Ifdb782881447912e00baffd1c407de10a1d8d0d4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f140ef04a0c54c2c8a699db33433b8d7235d137c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make qdecompresshelper archive bomb check only trigger for large filesØystein Heskestad2021-03-072-0/+40
| | | | | | | | | | | | | This is to avoid false positives. By default files are large if uncompressed size > 10 MB. Only configurable internally. Also add auto tests. Task-number: QTBUG-91392 Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit be73ca7eb1cebcc15064666e647bc337b5c2baa2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMenu test: turn tooltip animations offVolker Hilsheimer2021-03-051-0/+2
| | | | | | | | | | | QTBUG_89082_actionTipsHide() is very flaky if tooltips fade in, as the mouse move might happen while the tooltip is still appearing. Fixes: QTBUG-91532 Change-Id: I55305927fcf143d99dfff28d0bc70b2e831a139a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit d76d8571e2cc9172d2800e4b53f4b6941842dc6a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist test QMenu::QTBUG_89082_actionTipsHide() for WindowsFriedemann Kleint2021-03-041-0/+1
| | | | | | | | | | | | Apparently, ba139603925453bf79994eca48b566d8f15b2af0 is not sufficient. Amends 3f3d5e6716d9130776b3613ccbd5595de7d4af8d. Task-number: QTBUG-89082 Change-Id: I80a00abb330bebd3be8667762c279c2eef595c7f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit b62725608bbc1a8924209bd733aefe9f0465c3a7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* And fix handling and test of QImage::fill(uint) as wellAllan Sandfeld Jensen2021-02-251-2/+8
| | | | | | | | | | Only RGB444 and RGB666 were treated slighlty different from the rest, but the test had a few additional mistakes. Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c2bec047e281d949015ecd27daf2ba2d51b21526) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix recently added auto test of text layout overflowv6.0.2Eirik Aavitsland2021-02-241-1/+2
| | | | | | | | | | Ignore width of trailing space. Fixes: QTBUG-91038 Change-Id: I74e278366a2c3b170335738bf6d6ee23933b361a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit be4127d6f747742c714914e1b313186422b438f3) Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QJsonObject: Fix operator<=()Ulf Hermann2021-02-181-0/+31
| | | | | | | | | | | We had a copy-paste error there. Change-Id: Ib1448197ac4f4641c6559f133f41dcf326f210f1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit a2e23bca0f2b43a26e2e489f83cfe2e521da63b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rework tst_QDateTime::toString_isoDate() to eliminate an XFAILEdward Welbourne2021-02-161-16/+17
| | | | | | | | | | | | | | | | Instead of an XFAIL, actually test what we expect will happen for the test, namely that the milliseconds will be lost. In the process, verify that milliseconds since epoch also matches what was expected, change an "expecting empty" condition to check for the "invalid" test-case to which it's actually relevant and note that this test-case shall need amended when we update our ISODate support to the 2019 update, which extends the year range. Task-number: QTBUG-56552 Change-Id: I680aa31ee0dcc8fadabb5d4cd6c083a8afd48573 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit cc93dadf772480df3b27fd031a471047a5db0038) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qapplication: Prevent desktopaware test from deactivating main testTor Arne Vestbø2021-02-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Applications on macOS are automatically activated (put into the foreground), when launched from the Finder, or via 'open' on the command line. But when launched from the terminal, e.g. foo.app/Contents/MacOS/foo, the application will launch in the background (inactive). In Qt we override this behavior, activating the app even when launched from the terminal, as a convenience, as long as the application is a GUI application. Unfortunately this means that when tst_qapplication launches a subprocess that is a GUI app, it will steal activation from tst_qapplication, which in turn will break tests that later try to activate a window and check that the window is then active. The window will not be active until the application is active. We can work around it by preventing Qt from activating the application, but ideally we'd find a better solution to this, as we don't want to sprinkle overrides all over our tests. Fixes: QTBUG-90699 Change-Id: If53a86548002b739df0c0a7153d6244924a4a205 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 09cc63d425dabfa37b406e7eb1cee627c2eabb67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Extend colorspace testing and fix bug it uncoveredAllan Sandfeld Jensen2021-02-161-0/+119
| | | | | | | | | | | When changing transferfunction the look-up-tables needs to be regenerated. Change-Id: I83ca5fe570f85d478a374f52c0a82db84e70c3b8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit b2631c72c0628e68c0fae7567fd12e6646455efc) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix tst_QDateTime::systemTimeZoneChange() for 32-bit systemsEdward Welbourne2021-02-151-14/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test verified that a LocalTime's time since Epoch changes when the system time-zone changes. This works when the QDateTime object is in short form and recomputes its offset from UTC every time it is needed, but fails with a pimpled QDateTime, as this caches its offset from UTC when it is created, saving the recomputation which - in the far more usual case where the system time-zone does not change in the lifetime of a QDateTime object - would normally produce the same result. Changed the test to use a newly-created QDateTime constructed with the same parameters, which doesn't have the cached out-of-date knowledge of its zone offset. Removed the XFAIL. Made the test data-driven and added test-cases: one so close to the Epoch that it should be short even on 32-bit systems, one so far that it's pimpled even on 64-bit systems (used in reproducing the issue in order to debug it). This then revealed that Android 5 doesn't seem to support the POSIX zone IDs used by this test, so it now verifies that LocalTime has the expected offset from UTC after zone changes, QSKIP()ping if not. Documented that the behavior of LocalTime is undefined after a change to the system time-zone. Cleaned up the existing doc of Qt::TimeSpec in the process. Fixes: QTBUG-89889 Change-Id: I1058f47a1ff3ee1c326f3579ac80bd8bab242e28 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 02ae1b522193b60e7a5c8e5eff7a15d25b0f7aae)
* Fix QImage::fill with semi-transparent QColorAllan Sandfeld Jensen2021-02-121-7/+31
| | | | | | | | | | A few formats were not treating the input QColor correctly. Fixed and added more exhaustive test. Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 95712c5e5438e4eb5cd205ab4659febf3192137a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restore pre-Qt6 QList::fill() behaviorAndrei Golubev2021-02-111-7/+63
| | | | | | | | | | | | | | | | | | | Somehow QList::fill(t, newSize) introduced a regression in Qt6: when newSize < QList::size() we should resize to the newSize. This is aligned with QVector::fill() in 5.15 and std::vector::assign() While 6.0 is already out, picking it to 6.0.x could save someone who haven't migrated yet as well as fix some accidental bugs in Qt's code [ChangeLog][QtCore][QList] Fixed QList::fill() regression introduced in 6.0: calling fill() with size < current list size wouldn't truncate the list Fixes: QTBUG-91042 Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6512a7fc642c65455db770385c67cfa6d71c294c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid overflow in text layoutEirik Aavitsland2021-02-111-0/+13
| | | | | | | | | | Fixes oss-fuzz issue 29313. Change-Id: Idbabd162fa9e0dbce687981bdbcc75be37189a61 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Robert Löhning <robert.loehning@qt.io> (cherry picked from commit bfc09b8d8fa6c1a397aff458c644ed424754adf0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>