summaryrefslogtreecommitdiffstats
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>
* Fix plugin SKIP_INSTALL optionAlexey Edelev2021-04-271-5/+14
| | | | | | | | | | | If SKIP_INSTALL option is specified for the qt_internal_add_plugin function the install_directory variable become empty and finalizer unable to call qt_finalize_plugin, because of lack of the second argument. It makes sense to use the INSTALL_PATH single argument instead. Change-Id: I2d4b40c8cf812a834c0e045569b45a649d339508 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 361daa2990ddb70805d356ce5df7d8cfae8e1954)
* Fix "qmake -spec foo" call for cross buildsJoerg Bornemann2021-04-271-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | In a cross built Qt, for example Qt for Android, calling "qmake -spec android-clang" led to an error message: "Could not find qmake spec '-qtconf'." This happened, because: - the qmake in Qt for Android is a wrapper script that calls "qmake -qtconf qt_target.conf -spec android-clang" - the first stage of command line argument handling in qmake garbled the call to "qmake -spec -qtconf qt_target.conf android-clang" We do not modify the order of arguments anymore. Instead, we skip the "-qtconf <file>" arguments in the first argument handling stage that is supposed to determine qmake's modus operandi (like -project or -query). This amends commit 661b586a69740bd9a1791622f8b238d290ebe00d. Fixes: QTBUG-93079 Task-number: QTBUG-85136 Change-Id: I12ec25b17d64c00be2a3904b7c4a975b781500a0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 63a812b85191c9cfe0704d400df86ce7961dea12)
* 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>
* 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>
* 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>
* 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-278-100/+366
| | | | | | | | | | | | | | | | | | 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>
* CMake: Install prl files from all repo build dirs in a top-level buildAlexandru Croitor2021-04-261-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, in a top-level build we always generated the final prl file somewhere under QT_BUILD_DIR (which is qtbase_build_dir). After each repo was processed by QtPostProcess.cmake, we installed the prl files found in PROJECT_BINARY_DIR. For qtquickcontrols2 this meant that qml plugin prl files were placed under qtbase/qml, but we tried installing the prl files from qtquickcontrols2/qml, which didn't have any prl files. In a static Qt build, qmake's qt.prf calls qmlimportscanner to identify which plugins should be linked to the executable. This worked fine because the plugin .pri files were installed correctly. None of the qml plugin library dependencies were linked in though. This is supposed to happen in qmake's C++ code where it tries to find the associated prl file of a linked library in order to extract all its dependencies. Because no prl file was found, linking failed with multiple undefined symbols. Fix this by installing the prl files from QT_BUILD_DIR rather than PROJECT_BINARY_DIR. Note that this will create multiple install rules for certain files, but it's harmless. An example is imageformats. We process qtbase plugins, see qjpeg, issue an install rule from under the qtbase/plugins/imageformats folder. We then process qtimageformats plugins, see webp, issue another install rule from under qtbase/plugins/imageformats. The first install rule will install both qjpeg and qwebp, the second install rule will merely say all plugins are up-to-date. Change-Id: I8a4bb67bfafc1d016eab62f4fe66b6ba378ceeb2 Fixes: QTBUG-93021 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 31ee3c84a78afa67eeb4e4b6da5a8181ea62c387) 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-262-11/+23
| | | | | | | | | | | | | | 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-262-1/+5
| | | | | | | | | | 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-262-6/+7
| | | | | | | | | 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-243-9/+14
| | | | | | | | | | | | | | | 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 infinite loop in qmake option parsingJonas Karlsson2021-04-221-3/+4
| | | | | | | | | | | If calling 'qmake -qtconf file' an infinite loop occurs. Bug introduced in 661b586a69740bd9a1791622f8b238d290ebe00d Change-Id: I3ccc067570308227b605d700b41b299800aa872a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 6b1a7341fed4b9456ea6bfa2de7412d45ef56c65) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix case sensitivity handling QSFPMSamuel Gaist2021-04-222-24/+110
| | | | | | | | | | | | | | | | | | | | | | 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-2010-13/+17
| | | | | | | | | | | | | | | | | | | | 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-202-3/+22
| | | | | | | | | 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-192-4/+7
| | | | | | | | | | | 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-198-6941/+7787
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-192-0/+26
| | | | | | | | | | | | | | | 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-192-1/+37
| | | | | | | | | | | | | 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 top-level build repository targetsJoerg Bornemann2021-04-191-9/+10
| | | | | | | | | | | | | The directory-level targets missed the first level of sub-targets. E.g. `qtbase_qmake` did not have a dependency to `qmake`. Fix qt_build_internals_get_repo_targets to first grab all targets of the subdirectory and then recurse. Change-Id: I3604000caec22fac9a4cc5f5aaf651d550d16793 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 82f8519b827ba7fd89f8168632461f47b09605a7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Warn when using CMake 3.20.1 due to crashes in AUTOMOCAlexandru Croitor2021-04-171-0/+6
| | | | | | | | | | | | | With CMake 3.20.1 AUTOMOC can crash or hang on Windows when used with a Qt installation that supports moc depfiles due to missing multi-threaded locking. Warn and advise to use a different CMake version instead. Change-Id: I78d2269c48dfc2541bebcd6ab23aaa5595012149 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit aab8a0ac6e5365d97d3c7571b26430776b7b5f49) 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>
* 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-166-11/+25
| | | | | | | | | | | | | - 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>
* CMake: pro2cmake: Use latest project version for qml import versionAlexandru Croitor2021-04-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Use PROJECT_VERSION instead of CMAKE_PROJECT_VERSION when setting the version of a qml module, which extracts the version of the latest project() call rather than the top-level one. Using CMAKE_PROJECT_VERSION caused issues in top-level builds where the qtdeclarative version is 6.2, but the top-level project version is still 6.1 and hasn't been updated to 6.2, causing qml module import errors. This was probably an oversight during initial implementation of qml support in pro2cmake. So projects that define qml modules should be adapted accordingly. Amends cce8ada8141d786c1deda78fdba485b4c67f9687 Amends 28fff4a5519c8e1068450a052cb19fb2149e9726 Task-number: QTBUG-92861 Change-Id: I494784694e997501a5bc4fd0c0eac458ddc248aa Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit cf27a23937b108f7f8492a7873f71bc71c368dfb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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-142-9/+69
| | | | | | | | | | | | | 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-142-14/+45
| | | | | | | | | | | | | | | | | | | | | | | | | 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>