summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* d3d11rhi: remove pre-win10 codev6.2.0-beta3Yuhang Zhao2021-08-121-10/+5
| | | | | | | | | | | | | CreateDXGIFactory2() is always available from Windows 8.1 No need to load it dynamically. Task-number: QTBUG-84432 Change-Id: I84d82f30327df416e1fdbac256b63512900c07b7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 1e085b9e15abeb45bbbf7995818fcd9c94bfefe1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Warn when using CMake 3.21.0 due to issue in AUTOMOC/AUTOUICAlexandru Croitor2021-08-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There can be cases where trying to incrementally rebuild an already built Qt will cause a ninja dependency cycle error due to incorrect dependency information created by AUTOMOC and AUTOUIC. Example error when building qtscxml tests ninja: error: dependency cycle: auto/scxmlcoutput/default/tst_scxmlcoutput_default_autogen/timestamp -> auto/scxmlcoutput/default/ids1.h -> auto/scxmlcoutput/default/tst_scxmlcoutput_default_autogen -> auto/scxmlcoutput/default/CMakeFiles/tst_scxmlcoutput_default_autogen -> auto/scxmlcoutput/default/tst_scxmlcoutput_default_autogen/timestamp Example error when building Qt Creator ninja: error: dependency cycle: src/shared/help/shared_help_autogen/include/ui_filternamedialog.h -> src/shared/help/shared_help_autogen/timestamp -> src/shared/help/shared_help_autogen/include/ui_filternamedialog.h Warn and advise to use a different CMake version instead. Change-Id: I6f529ba6a526663bc6ed699b1bfe8a9094129887 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 06c2400f5d439ce1f1945833d9b1895eff843855) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix some compiler warnings from deprecated QFont constructorVolker Hilsheimer2021-08-122-2/+2
| | | | | | | | | QFont should be constructed with a list of font families. Change-Id: I61141b25d3f6e25f4fea141acbfa8e164d7af58f Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 761f32ae2ad98e8fb12a4f05b45b4aa277e47a1b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QUrl: Fix handling of invalid sequences starting with xn--Ievgenii Meshcheriakov2021-08-122-4/+6
| | | | | | | | | | | | | | | Return ASCII sequences that start with xn-- but fail Punycode decoding as is when converting URLs to Unicode. This is consistent with handling of sequences that do decode successfully but fail other validity checks. This fixes one test in tst_qurlinternal. Task-number: QTBUG-95689 Change-Id: I63d7197f25102c96f5dc21d9fecec5e015c531cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 2b4ffe914f191f598ae8e9639ad1efd3179e4b46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qurlinternal: Add another Punycode overflow testIevgenii Meshcheriakov2021-08-121-0/+4
| | | | | | | | | | | | The test string "xn--l0902716a" encodes 2**32. Currently the IDNA code returns an empty string when encoding this to Unicode instead of expected original string. Task-number: QTBUG-95689 Change-Id: I5ce7bcc744c9d5426f66b8a7d0ae76c7c92f552b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 22bf38351954137ff17e9a314f8847ee1fd00234) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qlocale_win: return null QVariant on failed look-upsEdward Welbourne2021-08-111-4/+4
| | | | | | | | | | | | Various functions were still returning a null QString wrapped as a QVariant; the caller distinguishes these cases, so should get a null QVariant so it knows the backend failed to answer the query and can attempt whatever fall-back it may have at its disposal. Change-Id: I0983b9f3b1026f17c3f13ab92b713bee90be466c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 54b1ed6798d890cb290846ad57767b016ecb2f2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* testlib: Don't report blacklisted tests as failures in JUnit reporterTor Arne Vestbø2021-08-112-3/+1
| | | | | | | | | | | | | | We don't produce <failure> elements for them, so we shouldn't include them in the total count of failures. In the future we might produce <skipped> elements instead, but for now remove the incorrect increment. Change-Id: Ia89a5cdaf79f6aa2f92be53180112c40ad6da2c6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit eb4fb9fa32797d48d4779464483230ad92f349a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qurlinternal: Use a lambda for bad IDN testsIevgenii Meshcheriakov2021-08-111-15/+13
| | | | | | | | | | Use a lambda to simplify testcases for bad IDNs. Task-number: QTBUG-95689 Change-Id: Ia4f3a5dbc73c74968628d89bd64d7aa6692b1c46 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 58e32ae198ee3e82c14da68f9637bf046c4ab8db) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix memory leak if eXIf has incorrect crcRobert Löhning2021-08-102-4/+19
| | | | | | | | | | | | | | Change eb6767 from upstream repo. Fixes oss-fuzz issue 23376. [ChangeLog][Third-Party Code][libpng] Fix for possible memory leak in libpng was backported. Change-Id: Id0c2f8b8bd60438ae8b5a61c83b6e50d55c6eb65 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 76e2409cc908d1fa6ee6c7ff61b699594244bf6c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Assert that special handling of '0' padding does what it shouldEdward Welbourne2021-08-102-35/+94
| | | | | | | | | | | | | | | | | | | | | When formatting numbers, if the fill character used to left-pad to field widths is '0', the code delegates that padding to the QLocaleData's ZeroPadded formatting option. Since we want the zeros before any minus sign, and don't want to subsequently add more zeros before it, check that this has worked as expected when calling replaceArgEscapes(), to confirm that it doesn't need to worry about that. Add some tests that verify the expected behavior. In the process, tidy up the code doing this. Rename a local variable to match our coding style, split a long line. Change-Id: I7cc430c5bceb006cf4e226bca33da16bd2bb1937 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit d055abd1958879ff1775772cfb0d5039e975fe9c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Implement missing support for 'em' and 'ex' lengths in style sheetVolker Hilsheimer2021-08-103-23/+80
| | | | | | | | | | | | | | | | | | | | | | | | | The Qt style sheet reference claimed that Length properties can be specified in 'em' or 'ex' units, but that was never implemented. Add the missing implementation. Since the sizes depend on the size of the font of the current element, we cannot convert the units in the CSS parser, but have to do so in the QRenderRule constructor, where we can make a decision about which font to use if the style sheet itself doesn't specify a font. Fall back to the widget font if possible; otherwise it will be the application default font. The implementation translates em into QFontMetrics.height, identical to what is already done in the QCssParser. This is in line with the CSS specification, but contradicts our previous documentation which stated that 'em' means "width of M". Fix the documentation. Fixes: QTBUG-8096 Change-Id: I145e2504ae3b19101a0d0dd63653466b6c2cec1d Done-with: Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 33f9591e378a2162378d8be5e75a47adf034536b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* MySQL: properly fix setting the character setThiago Macieira2021-08-101-3/+31
| | | | | | | | | | | | | | | | Commit e4bd73dc54542fe16121825c2a369b7f863e0de8 moved the mysql_set_character_set() call above the mysql_real_connect() but that doesn't actually work, as there's no connection to send the "SET NAMES" statement on. So do it in two steps: first, by setting the charset in the MYSQL structure, then by asking the server to match. Task-number: QTBUG-55444 Change-Id: I4a40ccbd3321467a8429fffd1699bd829f342124 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 472520afb9081856a2556c7df221c084a42a2d42) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* MySQL: remove the version number checks in favor of actual functionalityThiago Macieira2021-08-101-2/+15
| | | | | | | | | | | | | | | | | | | | | | MariaDB library version 3.2 no longer returns the server version in the 10.x range but the library version itself, which is lower than 4.x. That meant we concluded the server did not support prepared statements. And because of the lack of prepared statements, all QDateTime conversions failed, because of the timezone. I don't know if this was intended or what, but it's a side issue. [ChangeLog][QtSql][MySQL] Fixed the detection of whether the client and server support prepared statements. This was caused by the mariadb connector library reporting its own version numbers (starting in version 3.2) instead of the server version. Fixes: QTBUG-95071 Change-Id: I4a40ccbd3321467a8429fffd1699bc089ba706e6 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de> (cherry picked from commit 211369133cf40b2f522caaff259c19069ed23ca4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Copy Find*.cmake to ${QT_BUILD_DIR}/lib/cmake/Qt6Li Xinwei2021-08-101-0/+7
| | | | | | | | | | | | | | | | | | | | | In top-level builds, when configuring qtsensors, the directory of FindWMF.cmake isn't in ${CMAKE_MODULE_PATH}, this makes CMake couldn't find WMF. On Windows, QtMultimedia requires WMF. If WMF couldn't be found, QtMultimedia will also be treated as NOT FOUND. QtSensors has an optional dependency to QtMultimedia. If QtMultimedia couldn't be found, CMake will warn. Copy Find*.cmake to ${QT_BUILD_DIR}/lib/cmake/Qt6, to make sure these files could be found by CMake. Fixes: QTBUG-95655 Change-Id: I87d14c9a7becd0ec493e00c297b2e01fc0ad0f96 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1a8de144b64fe665d3c0b34e329c9454d97e1523) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add default constructor and Q_DISABLE_COPY_MOVE to native interfacesTor Arne Vestbø2021-08-101-0/+2
| | | | | | | | | | | We currently define a non-default destructor, but without defining a constructor, copy constructor, copy assignment operator, move constructor, or a move assignment operator Change-Id: I0dcaef61d86292df5963fac410d22cb3fcf12af3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 41d6a2673124dfb3e4d4c98b9c631ce730d17e6c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix qt_find_package to work when CMP00126 is set to NEWAlexandru Croitor2021-08-101-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | When CMP00126 is set to NEW, set(CACHE) doesn't remove regular variable bindings with the same name as the cache variable. This introduced an issue in qt_find_package, which called find_package(CONFIG QUIET) to try and find a package config file, but did not clean up the non-cache _FOUND variable which is automatically set to 0 by CMake if no Config file is found. Make sure to unset both the regular and cache _FOUND variables if either the package config file was not found, or if none of the provided targets found even if the Config file was found. Also move the _DIR cache variable cleaning into the same code block. Amends 4c31ce68d5367a6ec4dd3cf2f55e4b226add876d Amends 34b1c1c23cbddf67f878579bee9d10dcac29d8ca Fixes: QTBUG-95635 Change-Id: I871987217526e0f0a20038a8da52625838e49488 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 72a1e55472d0780996cc3843039b00427b5a420b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qurlinternal: Add tests for punycode overflowIevgenii Meshcheriakov2021-08-101-0/+13
| | | | | | | | | | | | | | | | | Add two tests for decoding IDNs when they encode values outside Unicode (> 0x110000). "xn--5p32g" decodes to "a" (all ASCII) before QTBUG-95577 got fixed. "xn--400595c" decodes to the same value as "xn--097c" after the above mentioned bug got fixed. This test is currently failing. Task-number: QTBUG-95689 Change-Id: Icab55c41e0233b34d57e38232fa90ac42f35a50a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 62b5d88b0d62eaba2e94c0dcf1dc3d0be719ee6b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslSocket - replace an old certificateTimur Pocheptsov2021-08-102-88/+84
| | | | | | | | | | | Helped quite a lot with OpenSSL 3 not accepting some old algorithms. Task-number: QTBUG-95123 Change-Id: If4894fa86eba7b002465fa661d436ae6ea751989 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 33de5f6502254ffe51960714404b6330dab224d5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: implement missing bits from ICCCM 4.1.4 WM_STATE handlingGatis Paeglis2021-08-102-12/+119
| | | | | | | | | | | | | | | | | | | | | ICCCM 4.1.4 says: Clients that want to re-use a client window (e.g. by mapping it again) after withdrawing it must wait for the withdrawal to be complete before proceeding. The preferred method for doing this is for clients to wait for a windown manager to update or remove the WM_STATE property. This patch implements the required logic. Qt 4 had something similar. Without this patch we are calling various setter functions on a native window while it is in an undefined state. Fixes: QTBUG-69515 Done-with: Liang Qi <liang.qi@qt.io> Change-Id: I377a66ad3d5e43f14465d0ea670b2f43f96ed7d3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit e946e6895a8517a887ac246905e0769edd766fcc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCalendarRegistry: Explicitly disable moving and copyingIevgenii Meshcheriakov2021-08-101-0/+2
| | | | | | | | | | | | | | | | | | | | Add Q_DISABLE_COPY_MOVE to QCalendarRegistry to silence the following warning produced by QtStaticAnalysisBot: class 'QCalendarRegistry' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator QCalendarRegistry is a singleton so it does not need to be moved or copied. The warning was introduced by d0ae1ef33a6eed02acde7304298794f4f0119e16. Task-number: QTBUG-93004 Change-Id: I5e018346415b9d0a1ebc3bbde2ab7c3ad5e6d9d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit f636a1efa5a103b63db34c97ff664e6ac8ee0502) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: add a timeout control when reading INCR propertyLiang Qi2021-08-101-2/+6
| | | | | | | | | | | | | | | | | | | | For the first call of QXcbClipboard::clipboardReadProperty() inside of clipboardReadIncrementalProperty() in getSelection(), it will get a XCB_NONE reply before the contents arrived via property change. Then we give a chance to read more. Manually tested with following setups: * examples/widgets/mainwindows/application with gvim(gtk3) * examples/widgets/widgets/imageviewer with GIMP 2.10.18(based on gtk2) and GIMP 2.99.6(based on gtk3 via flatpak) Fixes: QTBUG-56595 Done-With: JiDe Zhang <zhangjide@uniontech.com> Change-Id: Ib45f08464d39ad79137b1da99808c89b7dca2d08 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 02248eea5562c1df39ee23f195011afacc6759b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Apply custom timeouts to cross compilationsToni Saario2021-08-101-4/+18
| | | | | | | Change-Id: I93ce6b6a6011a0883820f291121d7374391494c6 Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 2f3b234d6c776099acef1b3d3ce4cdad25240677) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCompleter: QCompleter unexpectedly changes QLineEdit textTianlu Shao2021-08-101-0/+1
| | | | | | | | | | | | | | | | When qcompleter and qlineedit are used together, the currentcompletion() of qcompleter is its first item by default. Therefore, when qlineedit makes the initial value, then selects the text and enters, qcompleter will modify the default first item to qlineedit text. The judgment that completionprefix() of the completer is not empty is modified and added here, because completionprefix() is always empty when there is no match. Fixes: QTBUG-20894 Change-Id: Id47f7f4da0a93d03a4e7b056ec731615b0803d13 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tianlu Shao <shaotianlu@uniontech.com> (cherry picked from commit 0ef190fcc429405200d9f6063851726fcfb75637) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QUrl: Fix Punycode handling for non-BMP codepointsIevgenii Meshcheriakov2021-08-102-15/+39
| | | | | | | | | | | | | | | | | | Iterate over Unicode codepoints instead of UTF-16 characters when converting to/from Punycode as described in the specification. Additionally reject strings with invalid surrogate pairs when encoding to Punycode, reject strings with any encoded surrogates when decoding. Remove expected failure marking from the test for this issue in tst_qurlinternal. Fixes: QTBUG-95577 Change-Id: I3dd68f95ada6d652e2fa5c0c3118dcfa0a5f4c4d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9bd2ab85ac88e88f29a11a7dedc8635261ca3484) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix build with CMake master / 3.22Alexandru Croitor2021-08-101-1/+1
| | | | | | | | | | | | | | | | | CMake master / 3.22 introduced a behavior change in how conditions are evaluated in the while command. It is now consistent with how if() evaluates conditions. This caused an issue in Qt code where a "(" opening parenthesis was evaluated as part of the condition rather than as a string. Fix this by wrapping the evaluation of the variable in quotes. Change-Id: I70c26dc91394f4a14f7a26419df264a069dc7dc5 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io> (cherry picked from commit eb2282605734152440e840777d1f8a0576e3c7a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve docs for QFuture continuationsSona Kurazyan2021-08-102-49/+53
| | | | | | | | | | | | Replace phrases like "future has been running", "parent" with more precise descriptions. Fixes: QTBUG-95273 Change-Id: Ibd5a464007d41cc437da49ba250b9ea0a46078c6 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit d61820e5ab3176818b8a2326fa25d05a9f135244) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVariant: Tolerate QObject* metatypes without QMetaObjectUlf Hermann2021-08-102-3/+53
| | | | | | | | | | | QMetaType does. QVariant should do the same. Change-Id: I3419276b78b3b5ce8bd144dee92685195797d568 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Daniel Nicoletti <daniel.nicoletti@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6f8ef8c64d4e7af92f585d10a1d5815fcb67831b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* testlib: Fix name of current test case element in JUnit reporterTor Arne Vestbø2021-08-102-10/+10
| | | | | | | | Change-Id: I0bd77e5f1d0540b87568a0c69a4b96442d4000eb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 1272b60d9eea398c70a7e7803d41e13ad9a1956f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* testlib: Write failure details as <failure> content in JUnit reporterTor Arne Vestbø2021-08-1010-175/+249
| | | | | | | | Change-Id: Ica48769e7dfcabdc4bc8f0ed058bc22e29a0b632 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit a2026e4116e325767b899505cf248a75b9647195) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QString/QByteArray: Fix setNum docs and add testsMårten Nordheim2021-08-102-2/+54
| | | | | | | | | | Amends 260168d9d7547a2e7586bff6cb42e11d54c9d06e Task-number: QTBUG-53706 Change-Id: I01c8cdc6a3cb46ec8e49e15ad71b6d707c0d272f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9b860ece42e4012821b7e2140f363dbe3e256062) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Document that hiding/disabling a menu is best done via the menuActionVolker Hilsheimer2021-08-101-1/+3
| | | | | | | | Task-number: QTBUG-95072 Change-Id: I83afe13b129a35b39c62abe553061cc4a390fd65 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 79a219862f45a11c948bab574afa961a73b72b73) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Refix for avoiding huge number of tiny dashesEirik Aavitsland2021-08-102-4/+35
| | | | | | | | | | | | Previous fix hit too widely so some valid horizontal and vertical lines were affected; the root problem being that such lines have an empty control point rect (width or height is 0). Fix by caculating in the pen width. Change-Id: I7a436e873f6d485028f6759d0e2c6456f07eebdc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 84aba80944a2e1c3058d7a1372e0e66676411884) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QListView: fix AdjustToContents (sizeAdjustPolicy)Thorbjørn Lund Martsum2021-08-102-1/+83
| | | | | | | | | | | | | | | | | | | | | Unlike an acceptable effect in QTableView + QTreeView setAdjustPolicy(QAbstractScrollArea::AdjustToContents) unfortunately didn't work for QListViews (and QListWidget). This patch corrects QListViews AdjustToContents behavior. [ChangeLog][QtWidgets][QListView] A more correct implementation of QListView::viewportSizeHint has been made. That implies that setting the sizeAdjustPolicy to AdjustToContent on QListView and QListWidget will now cause the view to size after the contents and avoid scrollbars. Task-number: QTBUG-58749 Change-Id: I1675115f2348e2fcf0b2c39b451ef337e10eb872 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 7502598ef5bfa3f1a6d4f435bc2b91914e3acc61) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove dysfunctional -coverage configure argumentJoerg Bornemann2021-08-105-34/+1
| | | | | | | | | | | | | | | The -coverage argument merely added compiler flags for the Qt build. It was never properly ported to the CMake build, and it doesn't seem feasible to have configure arguments for every possible compiler option. The same can be achieved by passing the needed compiler option to CMake, for example: CMAKE_CXX_FLAGS=-fsanitize-coverage=trace-pc-guard Fixes: QTBUG-86227 Change-Id: Ieef9acaedc0a839f9fb35b4403395eea28643864 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 0e92ec972840e78b6f38d0f554ec1554edf752d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProperty: Only try to avoid TLS access if currentThreadId is fasterFabian Kosmale2021-08-082-1/+12
| | | | | | | | | | | We will not gain anything if we have to do multiple function calls to obtain the thread id. Therefore we introduce a macro to signal that we have a fast implementation of currentThreadId, and only use the function if it is defined. Change-Id: I3347489ea91992896bb753b796ae26e391c2c99c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 5889985c8c8e8cc676de4480ad95979287860b96)
* QProperty: Avoid needlessly refetching bindingStatusFabian Kosmale2021-08-082-9/+12
| | | | | | | | If we already have the bindingStatus, we can just pass it along. Change-Id: Iaaea4f4c34e6a786899561293016ece163c26d25 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 3f0a32aeb50acf17302e44dcffc3210f199de6eb)
* QProperty: more micro optimizationFabian Kosmale2021-08-082-40/+60
| | | | | | | | | | | | | - Provide an inline version of evaluateRecursive which does not fetch the status. - Provide an unsafe variant of setBindingToNotify which does not set the tag. This can be used in allocateDependencyObserver, as newly allocated observers already have the correct tag (this is checked via an assert). Change-Id: I31aec6af4aef244efc6d0777e5bfaaa8f82f2046 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit f7eed15588fc93af417b8969fe4e498936d81e04)
* Pass QBindingStatus to evaluateBindingsFabian Kosmale2021-08-082-12/+11
| | | | | | | | | This avoids another round of TLS lookups in evaluateRecursive when we construct the BindingEvaluationState. Change-Id: Icfa9fd81fc6f54623d384c4d3fce33f4d4d549b9 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit e5aff7f3d9e90860fe24b8fe931a71e115f5413b)
* macOS: Fix leaked NSMutableArray in applicationActivationChangedTor Arne Vestbø2021-08-081-1/+1
| | | | | | | | | | The +[NSObject new] method is a combination of alloc and init. Fixes: QTBUG-95619 Change-Id: I341f8a3958fb7a016cf4c346750ea6d46eeebe9f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit ab70aa362ee5dd5b1375b198dcd6d6445ab2daeb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Rename qt6_add_plugin TYPE option to PLUGIN_TYPEAlexandru Croitor2021-08-0671-79/+108
| | | | | | | | | | | | | | The intention is to remove TYPE as a keyword completely before 6.2.0 release, but in case if that's not possible due to the large amount of repositories and examples, just print a deprecation warning for now and handle both TYPE and PLUGIN_TYPE. Task-number: QTBUG-95170 Change-Id: If0c18345483b9254b0fc21120229fcc2a2fbfbf5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit b2f00dfb46af633b00946cb1ebfe963964f803ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCalendar: Delete registered calendar backends on program exitIevgenii Meshcheriakov2021-08-062-17/+76
| | | | | | | | | | Add code to check if the calendar registry is destroyed to all QCalendar methods that dereference QCalendarBackend pointer. Change-Id: I9b562355e2e0579396b52968f6065c6927cc9ca8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 84a93d94ac8dfa3c962c0dda0ab19bbd80ac50ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCalendar: Thread-safe calendar backend registrationIevgenii Meshcheriakov2021-08-0615-416/+499
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All calendar backend accounting was moved into QCalendarRegistry class (renamed from Registry). Calendar backends are no longer registered inside constructors, because in multithreaded environment this may lead to incompletely initialized instances becoming visible via QCalendar API in multithreaded environment. All system backends are registered by QCalendarRegistry itself when they are needed. New method QCalendarBackend::registerCustomBackend() is provided to register any 3rd-party calendar backends. Registration by names was also simplified. The list of names is now passed to QCalendarBackend::registerCustomBackend(). The checks are provided to ensure that all system backends have non-conflicting names. Name conflicts for custom backends are resolved in favor of earlier registered backends, as it is already the case in the existing code. The documentation was updated to reflect that. Method QCalendarBackend::names() was added to query the list of names associated with a backend after it is registered. Calendar backend deregistration was completely removed because it is not possible to perform it safely without reference counting. Fixes: QTBUG-93004 Change-Id: I0ab1eccc02fdd1e1c66b5e5dd076c93de32d5a49 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit d0ae1ef33a6eed02acde7304298794f4f0119e16) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve translations loading code in standarddialogs exampleFriedemann Kleint2021-08-061-7/+8
| | | | | | | | Change-Id: I799724b633f1b52675ca2aa69b22fdb678b84421 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 74515a7a30b809a3ab0a2d67496e870ea3c872e6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Partially fix QUIETness of find_package(Qt6 COMPONENTS Foo)Alexandru Croitor2021-08-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | When Qt5Config.cmake was ported to Qt6, the assignment of _Qt6_FIND_PARTS_QUIET was accidentally left out. Make sure that when find_package(Qt6 QUIET COMPONENTS Foo) is called, the underlying component find_package(Qt6Foo) call gets a QUIET option as well. This will silence short-form warnings like -- Could NOT find Qt6Foo (missing: Qt6Foo_DIR) It currently won't silence any warnings produced by the transitive find_package calls in QtModuleDependencies.cmake. That will require a separate change. Remove usage of _Qt6_FIND_PARTS_REQUIRED which was always empty. See details of QTBUG-95573 why it's currently not used. Task-number: QTBUG-95573 Change-Id: I3822c068eecbe84c306a1b04f4187278d35ec3d5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 7d86cf02c1f3341056ea9463e93ad336e0e63a52) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Improve component / package not found error messagesAlexandru Croitor2021-08-062-13/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide better error messages when a Qt package / component is not found. Mention the location of the expected Config file on the file system, whether it exists Also mention the location of the Config file that was specified by the user when configuring the project or which CMake computed and stored in QtModule_DIR cache var. Mention that a package is not found in case if the main target exposed by that package is not found. If the target is not found, mention that it might be due to QT_NO_CREATE_TARGETS being set to TRUE (when it is set to true). If it is set to true, the assumption is that the target must have been defined by something else before the find_package call (either an earlier find_package call without QT_NO_CREATE_TARGETS set to TRUE or maybe it's the use case of Qt being built together with its examples or it's a super build). Unset _Qt_NOTFOUND_MESSAGE to ensure that the Qt6 not found error message is not spilled into any subsequent find_package(Qt6) calls, causing a cascade of unwarranted warnings / errors. Make sure to unset it only if components were specified, so the message is not shown or unset in any of the recursive find_package(Qt6) calls which is a dependency for regular Qt module packages. This works fine, because find_package(Qt6) calls with components are only done in project code and not done by the transitive dependency code (which looks for Qt6Foo packages directly). Remove some dead code. Task-number: QTBUG-95532 Change-Id: Ie93d18e25e33aa0fe9e9da9a60e3d3e4cd6adb58 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 825cb50c27fc0942a76771f9fb2ec052dc9142bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qurlinternal: Add a test for Punycode handling of non-BMP codepointsIevgenii Meshcheriakov2021-08-061-0/+4
| | | | | | | | | | | | | Use U+102F7 as an example. The current code is not able to handle conversion of Unicode codepoints outside BMP correctly, so mark the test as expected failure. Task-number: QTBUG-95577 Change-Id: Ifd50cf306bce4940f84cb412de148eac952e6c09 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 1f20606fa3aee1e6d152a6f7203ef1fea6ade0b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* testlib: Indent CDATA element in JUnit reporterTor Arne Vestbø2021-08-0622-2290/+2290
| | | | | | | | | | | The data itself is not indented, as consumers may read it as verbatim data. Change-Id: Ia934616cea273feadc3a45d7c74726d4f804f0dc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 0ce70a29b36a43f08ff3c8cdecde7ea75af0840f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslCertificate::verify - remove QSKIPTimur Pocheptsov2021-08-067-254/+121
| | | | | | | | | | And re-generate certificates. Fixes: QTBUG-95429 Change-Id: Id970a0a9315d146d6dd1e66c9cff9b7d75657e2d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit e7ab17ade170a8fbc5061fffe5334b26cdc54ed3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add native interface for X11 application, exposing display and connectionTor Arne Vestbø2021-08-068-13/+137
| | | | | | | | | | | | | | | | | | | | | | The major use-case of the now private QX11Info from Qt X11 Extras was getting hold of the Xlib display and XCB connection, for example in KDE: https://lxr.kde.org/search?%21v=kf5-qt5&_filestring=&_string=QX11Info A new native interface for QGuiApplication has now been added that exposes these two properties, e.g.: if (auto *x11App = app.nativeInterface<QX11Application>()) qDebug() << x11App->display() << x11App->connection(); To avoid type clashes one of the enum values of QXcbNativeInterface's ResourceType had to be renamed. Task-number: QTBUG-93633 Change-Id: I2e366a2bb88bd3965ac6172ad000ae32209f43e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit f5203eeada83bbe8e316a5188e24636af3e83b09) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Turn off feature timezone for emscriptenEdward Welbourne2021-08-061-0/+1
| | | | | | | | | | | We don't (yet) have a workable back-end for it. Task-number: QTBUG-95314 Change-Id: I8cf0fd11f315bc7d6cac351d485f4cbc676ed95d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit e158502e332e482267d8585b791f5e2a7f82888c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>