summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Remove mention of no longer supported formatv6.0.4Paul Wicking2021-04-271-3/+1
| | | | | | | | Fixes: QTBUG-92826 Change-Id: I35950523e41ceaa1ddc59782c4b527707289013b Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 069369d86707c89645d63ff36151065c47e6c0ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: Add more debug info for XCB_INPUT eventLiang Qi2021-04-271-1/+44
| | | | | | | Change-Id: I99bba80659a103aa79426ae94cd04db2c5d851d6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6a91ad7b5b429a9e277a4eedd7161b052b3acf68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change QList's insert() and emplace() to always invalidate [pos, end())Andrei Golubev2021-04-271-107/+114
| | | | | | | | | | | | | | | | | Drop the "move left if pos <= size / 2" path in favor of reference stability of insert and emplace operations Leave the insert(0, ...) and emplace(0, ...) as special cases for prepend optimization as invalidating [begin, end()) practically means that we can reallocate behind the scenes Doing this also simplifies the code a bit Task-number: QTBUG-93019 Change-Id: I7c248f96d687e94a6a38f81ade901619ff2b4733 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 5e76c2acff2c70f2893306b16aeba230f3d6114a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not shift the data pointer when removing all elements from QListAndrei Golubev2021-04-271-5/+7
| | | | | | | | | | | Because leaving the pointer untouched is a much more expected behavior The tests for this (and not only) logic can be found in the following commit Change-Id: Iec9eec9bbce04c9fd90cb6be9627c135cd989b7f Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 38bba2a87c6c5c2b8100870add6d0d7ad559e669) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Resurrect data moves in QListAndrei Golubev2021-04-276-83/+307
| | | | | | | | | | | | | | | | | | 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>
* Add q_points_into_range to container utilitiesAndrei Golubev2021-04-273-18/+19
| | | | | | | | | | We already used it in QString and QBA. And implicitly in QADP (see parent commit). Might as well move to a common location and reuse Change-Id: I694f0f1dbd109f17c134f64b3f3dc28d19556c88 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 10b46e7f0faecc42a94cc2e25ad3edd08ae28083) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build error on iOS with the configure option -qtnamespaceLars Schmertmann2021-04-272-3/+9
| | | | | | | | | | | | | qtbase/src/corelib/kernel/qsharedmemory_p.h:62:33: error: unknown type name 'QString'; did you mean 'XXXX::QString'? int createUnixKeyFile(const QString &fileName); ^~~~~~~ XXXX::QString Change-Id: I455526503f059efc2f496b159b4cb098385dda00 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit d81a9206ac528ad7b5093305d7fe0037053468b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* [Android] Fix select handles misplacement on QDialogPekka Gehör2021-04-261-6/+19
| | | | | | | | | | | Get select handles {Left, Right}Point from a mapToGlobal with a cursorRectangle of anchorRectangle of the selected word/text Change-Id: I3425104c90f0efe6a1e4337328cf06dc93685b6f Task-number: QTBUG-90799 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 56b54743e001c4af196c1e4786118d88b1d2cd2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QTreeModel calling beginRemoveRows twiceLuca Beldi2021-04-261-11/+7
| | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | 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>
* Skip adding externally added plugins to the plugin meta-setsAlexey Edelev2021-04-261-3/+0
| | | | | | | | | Plugin meta-sets are not visible outside of the module build tree, so there is no point in adding dependencies for externally added plugins. Change-Id: Ica5b29b57c032f4fc9b128172aaa806392e9e581 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit bbe26a766748c00da5e2241a9c7ec5e714dd76ad)
* Optimize quadratic-time insertion in QSortFilterProxyModelIgor Kushnir2021-04-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Let N = proxy_to_source.size() before the code modified in this commit. Let M = (N - proxy_start). Let K = source_items.size(). The algorithmic complexity of the removed loop is O(N+K+K*M), assuming the number of O(N+K) reallocations is a constant. The complexity of the QList::insert and std::copy implementation is O(N+K). This is much faster in practice when K and M are of the same order of magnitude as N. For example, this quadratic complexity issue results in noticeable slowdown in the following scenario: * a QSortFilterProxyModel is used only for filtering, not sorting; * first set a filter that matches a single item in the middle of a huge number of items (about one million) - this is reasonably fast (takes about a second); * then clear the filter (i.e. set an empty filter so that no item is filtered out) and watch your application's UI freeze for a minute. The "Add QSortFilterProxyModel clear-filter benchmark" commit (with Change-Id I419a5521dd0be7676fbb09b34b4069d4a76423b1) adds a benchmark that runs much faster with this performance fix. Change-Id: Ieaec173e6910f5d21eaee49402087f7711abbedf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 7d92ef63d7c2d9d017d89905a2ee0d1e9226b15c) 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-242-8/+13
| | | | | | | | | | | | | | | 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>
* Do not access internal allThreads data unlockedAllan Sandfeld Jensen2021-04-231-0/+1
| | | | | | | | Change-Id: I54eb67571fff07ffdbf9d2b77c96bb85e3fae5e0 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ffb5635c1a34d23d85e3cb42310e14a81fa24f6e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix case sensitivity handling QSFPMSamuel Gaist2021-04-221-24/+44
| | | | | | | | | | | | | | | | | | | | | | 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>
* Don't own unique name for QDBusTrayIconIlya Fedin2021-04-212-14/+5
| | | | | | | | | | | | | | | | | | | Flatpak doesn't allow to own random name with PID. Even after adding such a permission into manifest, all flatpaked apps have PID 2, so only one Qt application at a time can have tray icon. Even though unique name is a part of the spec, no tray hosts really check it and SNI implementations without unique name run just fine inside and outside of Flatpak. This fixes the inability of Qt applications to have tray icon in Flatpak outside of KDE. Change-Id: Ieea6dc335b7a74537a51929f6e70ca68c84228fb Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 9db7cc79a26ced4997277b5c206ca15949133240) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Documentation: Fix broken links to QIODeviceBase::OpenModeFriedemann Kleint2021-04-212-9/+9
| | | | | | | | | | | Previously, QIODeviceBase was not visible in the documentation and the links from QIODevice::open() were broken. Fix by fully qualifying the arguments. Change-Id: I43960ac2ff436251cc3bfad862d82f937b9bd4b1 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 1b1844afef81520520ba75146f835a7dbbbb5fd6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Read DPI from X Settings initially as wellIlya Fedin2021-04-202-7/+18
| | | | | | | | | | | | | | | | | | | | | | | Currently, Xft.dpi from X Resources is read initially, while changes are monitored for Xft/DPI from X Settings. These protocols are different and can have different values. E.g. MATE sets X Resources' Xft.dpi to 96.30859375, while X Settings' Xft/DPI is set to 197240 at 2x scale. This results in a very weird bug when Qt can't determine 2x scale initially, but if scale is changed at run time, Qt changes scale to the right value. The difference could be checked via xrdb -query and dump_xsettings (the second is from xsettingsd project). [ChangeLog] Qt now reads Xft/DPI from X settings at startup, and will prefer this value over Xft.dpi from X resources. Change-Id: If6adac0c88198579332ddebc673f1524f324c0e4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 6560778616b090f8cc73700675ec2ef385953fb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Draw the cursor considering the descent is 0Tang Haixiang2021-04-201-3/+3
| | | | | | | | | | | | | | | When the descent of the item is 0, ascent is the height of the item, base(base = si.ascent)> sl.base. At this time, sl.descent is not considered. The calculated y value may be <0. Fixes: QTBUG-86823 Fixes: QTBUG-92468 Change-Id: I9cf088dec9162595e52ff72aa90ec3153a30fb72 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit e99a883bd382ca950192bd66cafb2a1de6394ce7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correct prefix reported for end element in QXmlStreamReaderVincent Baijot2021-04-202-0/+4
| | | | | | | | | | | | | | | | | | | | 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-3/+5
| | | | | | | | | 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 ARM and MIPS runtime CPU feature flagsAllan Sandfeld Jensen2021-04-201-11/+11
| | | | | | | | | | The set values didn't match tested values, as the enum were already on flag form. Change-Id: I9e8b0d419682122e8d40cd47bd68d840386c2066 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ccd17fbc57fae0cb2e5c020e00706edc856b13df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QAbstractItemModelTester false positiveLuca Beldi2021-04-191-2/+2
| | | | | | | | | | | 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-193-6292/+6462
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Unicodetools: compileGiuseppe D'Angelo2021-04-191-0/+2
| | | | | | | | | | | | | Add an #include for a header that was only accidentally included transitively. Task-number: QTBUG-92822 Change-Id: Ie29bb0e065f2db712e9cf9539b15124ff0ced349 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit fd0c3170c890707c5cea63b11895084d149d991c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Re-layout QProgressDialog when setting the cancel buttonQiang Li2021-04-191-0/+2
| | | | | | | | | | | | | | | 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>
* iOS: Protect against a possible crash after the window is deletedAndy Shaw2021-04-192-1/+3
| | | | | | | | | | | | | | | | | | If we are in a case where the original window is deleted before a new one is shown then we need to make sure that we are not still expecting that the original one has the focus. So we protect against the crash by only outputting the address of the object that previously had focus. A follow-up patch will be done for inclusion from 6.2 that will fix the root cause of the pointer being invalid when the only window is deleted before a new one is shown. Fixes: QTBUG-92173 Change-Id: Ifdb3fd6b6cb8fb8e8b79d2c325a30c27b298d8a9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit b050d4867f68c3d35493221d65d343749504c988) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QODBC: Preserve the whole value when using HighPrecisionAndy Shaw2021-04-191-1/+2
| | | | | | | | | | | | | 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>
* Fix handling of surrogates in QBidiAlgorithmEdward Welbourne2021-04-161-2/+2
| | | | | | | | | | | | | Prior code was naively assuming the character after a high surrogate would necessarily be a low surrogate, which is buggy. Fixes oss-fuzz issue 29718. Change-Id: I10f023c4b5024a0d76fea0a3672001063591ec6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit aeeaab1a5ac0b4d91c9f9b542035b8970e4c61dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMultiHash: Fix docFabian Kosmale2021-04-161-3/+2
| | | | | | | | | In Qt 6, QMultiHash does not iherit QHash Change-Id: Iaad8768d681a9aad2bb1f80fd87904f0dd9683d4 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit e27390f8e1fb961e783ce1004b3a8caf5eeaeca6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkDiskCache: Drop the file mmap-ingMårten Nordheim2021-04-161-12/+1
| | | | | | | | | | | | | | | Presumably the code at some point would do a QByteArray::fromRawData-style thing. But now it doesn't do that so the current code was a bit strange. It would map the content of the file to memory only to then copy the content into a QByteArray. Then it reparents the file to the QBuffer, keeping it alive even if its not needed. Fixes: QTBUG-92838 Change-Id: I88f8cd1b64e0fd13d08b5cc4df44661e216da340 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit c254d73be63033497838807119cb9cb47ca6c1fa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't parse XML symbols longer than 4096 charactersAllan Sandfeld Jensen2021-04-161-0/+5
| | | | | | | | | | It is slow and will use too much memory. Fixes: QTBUG-91889 Change-Id: I45c5e6038357c87bbb85b1ace17ef39a2a814ea0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 38e111158a38507c63fd70f9ee18b9116b537976) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix various documentation issuesTopi Reinio2021-04-165-8/+22
| | | | | | | | | | | | | - Document QIODeviceBase - Document QPointerEvent::points - Fix linking issues Task-number: QTBUG-90662 Task-number: QTBUG-92273 Change-Id: Ib123d5708953b22e01f95c82626b39a49fff95b2 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> (cherry picked from commit 00e10f62b55626097e94a2d70a9214c0062fbcd5) Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix partial pixel coverage calculationAllan Sandfeld Jensen2021-04-141-1/+1
| | | | | | | | | | | | We want right - left, but the numbers we have are (1 - left) and right, so we need right - (1 - left) = right + left - 1. Fixes: QTBUG-91957 Fixes: QTBUG-92485 Change-Id: I238cbbe1eebddff1ce56da38127899cdbd21db0e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 004189b2d8e751021f26d9eb28948f753ea8208c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid processing-intensive painting of high number of tiny dashesEirik Aavitsland2021-04-141-9/+35
| | | | | | | | | | | | | 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-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add missing compile definitions to the resource object libraryAlexey Edelev2021-04-141-0/+3
| | | | | | | | | | | The resource object library must be compiled with the definitions specified in Qt::Core. Missing the required definitions causes linker problems when QT_NAMESPACE is defined. Change-Id: If0ca20604e251822279e0d4906c47b94d3b4ceb4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 9466b3629a391ae93c4f06d3627e3dc9e10bba9f) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Correct item indent in checkable menus in stylesheet styleEirik Aavitsland2021-04-141-2/+2
| | | | | | | | | | | Not only the checkable items need to be indented, but all items in the same menu, so that they line up. Fixes: QTBUG-90242 Change-Id: I559005f753b5cd19eaeeeb6658178d62de93b4ef Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 96e9c8cc8aae718942f79ac98e775f06501b0e25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Only scroll QMenu when there is a valid active actionZhang Hao2021-04-141-1/+1
| | | | | | | | | | | | | | | When changing the active action via QMenu::setActiveAction the menu will scroll to the active action, but we were scrolling the menu also when the active action was null, resulting in the menu scrolling back to the top. We fix this by guarding the call to scrollMenu. Fixes: QTBUG-92096 Change-Id: I998f99ddacec32640834d59a907d569fdda458f0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 94e03e506a0e953f72c21c4ca827174a3d1f0d73) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build without features.menuTasuku Suzuki2021-04-131-7/+7
| | | | | | | Change-Id: If7947839b8da5abc8ee84aace60cc7de7a053e04 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit d84bf703b505db470e5c7916e3cd630c3e456cef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't disable menu items that belong to the active modal windowVolker Hilsheimer2021-04-123-5/+18
| | | | | | | | | | | | | | | | | | | A popup/context menu created via QQuickPlatformMenu doesn't belong to any menubar, so by disabling items in a menu that doesn't belong to the currently active menubar (5b9f6862b1), we disabled all menu items in a QQuickPlatformMenu when a modal window was active. For such unrooted menus, use the QCocoaMenuObject data structure to record which window it is shown for, and only disable items if that window is not also the current modal window. Amends 5b9f6862b1aa474a392203c69f6db678d633cecf. Fixes: QTBUG-92040 Change-Id: I56b6d579e5e94689b43ca84d4637e35dc2cbeb4c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 2bdaf28034541cd57b0aa7c067fda8cfbffa0e94) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAbstractItemModelTester: fix false positive when model has zero columnsDavid Faure2021-04-121-1/+1
| | | | | | | | | | | 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-7/+7
| | | | | | | | | | | 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>
* QtConcurrentIterateKernel: fix warningMårten Nordheim2021-04-121-1/+1
| | | | | | | | | | src\concurrent\qtconcurrentiteratekernel.cpp(134): warning C5055: operator '*': deprecated between enumerations and floating-point types Change-Id: I934e767e77e9393e1da3adc390dc8e252e7f5b6a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit b86176abf6a66b20cebbcb53958229590b4c2253) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restore support for reading /etc/timezone for system zone nameEdward Welbourne2021-04-121-7/+15
| | | | | | | | | | | | This restores one of the two mechanisms removed in commit b0383cbd388336f698ceeac11a4f50cdff931dd9, transformed to fit in with the new cached system-zone determination. Fixes: QTBUG-87326 Change-Id: Ic270acb0d958e17dbc74a0ff93a5a1843c939678 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 824d963700a91294ba4a543ebb486aedbd650284) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix read-only pseudo-state in QPlainTextEdit stylesheetEirik Aavitsland2021-04-091-1/+7
| | | | | | | | | | | Was implemented for the other text edit widgets, but not for QPlainTextEdit. Fixes: QTBUG-92490 Change-Id: Idd2a1b5c743fc030d3f2d4dd24e98f806b58f4d9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f3a042c5ab998c0d283017f3569bb72c392580b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Call statx() with AT_NO_AUTOMOUNTAlexander Volkov2021-04-081-1/+1
| | | | | | | | | | Otherwise it can be very slow in some cases (e.g. 0.5 sec). Besides, AT_NO_AUTOMOUNT is used by {l,f}stat() internally. Change-Id: Iae9c8b46dcdc96d21ac6b114a51c382b4949d3dd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9667ac1c2d3b3d48cbd154bece36ec1d41d93a59) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't judge other people's writing systemsVolker Hilsheimer2021-04-081-10/+8
| | | | | | | Change-Id: Ifb8265bad4c8c96c6b20f957c376cec47e28f666 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 2c2b34997468a028de9e9c2de54b21c7e0757fbb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix removing columns when QSortFilterProxyModel has not been sorted yetJoni Poikelin2021-04-081-1/+4
| | | | | | | | 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>
* Fix incorrectly-drawn menu indicator for QPushButton on macOSDoris Verria2021-04-081-1/+2
| | | | | | | | | | | | | | Because the QPushButton's bevel rect is smaller than its actual widget's rect, custom styled menu indicators are drawn outside the bevel frame on macOS. Fix this by drawing the menu indicator inside the bevel's rect instead of the widget's rect. Fixes: QTBUG-90250 Change-Id: Ie63d68d8f564a4a640bdb8e7564f028784faab97 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 0eb0fc87014b8de06473055bd2298b2423d480f6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>