summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* xcb: update xkb_state mask as much as possiblev6.4.0-beta2Liang Qi2022-06-291-2/+2
| | | | | | | | | | | | | | | | Though we can get xcb_xkb_state_notify_event_t for the change, but it looks like not enough, especially when a new usb barcode scanner was used, it should be a slave keyboard, and Qt only uses core_device_id for now. It should be enough to update xkb_state mask when we get key event. See also https://xkbcommon.org/doc/current/md_doc_quick_guide.html . Fixes: QTBUG-95933 Change-Id: Ie1e82c19edd777630c7f9057a3b2b8b7cad59e38 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ef94aeef649f832bb201cb752407ce3ea5e66562) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QDockWidget move between screens with different dprThorbjørn Lund Martsum2022-06-292-1/+30
| | | | | | | | | | | | | | | | | | | | When partly moved back and forth between screens with different dprs (device pixel ratios) unexpected jumps and size changes could occur. (See the linked issue for details) This patch maps global coordinates to native ones and vice versa (in QDockWidgetPrivate::mouseMoveEvent()), so that the calculated position is the right coordinate on the right screen. Fixes: QTBUG-104205 Change-Id: I0e59792a946e0444fed2e2b857f2f8b140afc9b7 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 54f328f0e8205480749a6d8d2ebe0e58cb1cdb67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Revise Qt Test Module landing pageAndreas Eliasson2022-06-291-21/+24
| | | | | | | | | | | | | Most of the module landing pages now follow a certain content structure. In this case, the reference section should be placed before the licenses and attributions section. Also, to make the wording consistent across all module landing pages, use the globally available word snippets. Change-Id: I2b2164eb1b8a0eb91db0f1efea8390956d54b29e Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit a6df765b03d319347920b6fba209338ea27db40e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't trigger qBound assert in QExpandingLineEditVolker Hilsheimer2022-06-291-1/+1
| | | | | | | | | | | | Ignore the original width if it's larger than maximum. Fixes: QTBUG-104383 Fixes: QTBUG-104565 Change-Id: Id86d4f5bd1d50304d95c4711f1989f4dae416b69 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 9fcd5f0790fd01307cfece96d82df21c787fa5b3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Forward COMPILER_LAUNCHER to the ABI-specific external projectsAlexey Edelev2022-06-291-0/+8
| | | | | | | | | | This allows to speed-up the build of external projects. Change-Id: I3bbdbd6ec5b0920c9e912cb59a6e16c5a8efa0ec Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit c7231177df71879b6d3ebc48288a6d3d8fdab6d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use the main ABI's CMAKE_MAKE_PROGRAM in ABI-specific external projectsAlexey Edelev2022-06-291-0/+4
| | | | | | | Change-Id: Ie35b6a334be419d3182fe77f9d70153cd1fd8a51 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit f2d9e76451ffb4f890a97cb218fd733fb5960111) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: fix wrong position of cursor handle and editpopup menu in split screenPekka Gehör2022-06-292-6/+16
| | | | | | | | | | | | | Use activity location in the Window to handling a cursor handle and editpopup menu in Multi-Window mode. No effect when using full screen. Fixes: QTBUG-58503 Change-Id: I17f3119be4c3dda2fca50156bf62c1260c2ea1f6 Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit c27cca5c3421b08253535cfcfb9dd414986c7653) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Drop call to setPlatformScreen in QHighDpiScaling::setScreenFactorFushan Wen2022-06-294-24/+23
| | | | | | | | | | | | | | | | | | Drop call to setPlatformScreen since the only affected variables are logicalDpi and geometry. Replace setPlatformScreen with updateLogicalDpi which handles global scale factor changes in QScreen. Call updateGeometriesWithSignals() to check if there are any changes in geometry or availableGeometry, since the geometry or availableGeometry can also change when setting a scale factor. Move setPlatformScreen to QScreen ctor as the function is not used elsewhere. Change-Id: I7acf40bf0643e89a1d9177674d66dc503829f98f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 7b2ae3faab15913e006ece25d785e6a8453dd27a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Fix the offset of the EditPopupMenuPekka Gehör2022-06-291-3/+14
| | | | | | | | | | | Fix the offset of the EditPopupMenu on application window. Issue caused by a5bb7b3ca510c301baf84e1dd46d5aeeb4986eb2 Fixes: QTBUG-71900 Change-Id: Ib95e1544fe91c273bc5317bd338a50a74fb1090a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 526d62ee90d549177920eb567cb951c4b553c630) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Document missing methods in QDropEventKai Köhne2022-06-291-1/+22
| | | | | | | | | | Fixes: QTBUG-104484 Change-Id: I20068bb9e641545edad67910b4586aa38aec093b Reviewed-by: Kevin Keating Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit c2505751de802ae3e14df57c98ba9c3e9049dd50) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: fix const-init for WindowsThiago Macieira2022-06-292-5/+5
| | | | | | | | | | | | | | | | | | | References to __declspec(dllimport) is not a constant expression on Windows, so we can't have a direct reference to a staticMetaObject. Commit 9b8493314dd77f3e96b353187816bb7ef4dedbb5 fixed the Q_OBJECT parent link (added in 5.14, kicked in for 6.0 with the ABI break), but commit 656d6f2a9b221dbd5adfc46262cb243e696d8d62 added links for Q_GADGETs too without taking the need for Windows DLLs into account. This change is a no-op everywhere but Windows. On Windows, since we store the pointer to the indirect getter function, now you may get non- null pointers from QMetaObject::superClass(). Change-Id: I6d3880c7d99d4fc494c8fffd16fab51aa255106e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 688e8f63a2bb87469517166f90c50dec524f90c5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: move the qt_static_metacall below the staticMetaObjectThiago Macieira2022-06-291-10/+11
| | | | | | | | | | Just so we have data structures and functions grouped together. Change-Id: Id0fb9ab0089845ee8843fffd16fa171f6e1caf2b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 9af59838d7ba166966941199354f905b0a122cab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmetatype.h: remove unnecessary specializationThiago Macieira2022-06-291-7/+0
| | | | | | | | | | Commit 5db3fd29b42ec06ccb15fdd7f274bb20c326ffb6 removed the expansions that likely needed this. Change-Id: I6d3880c7d99d4fc494c8fffd16fbbe8dcde4a1b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3335b541e76903f312cf71944a857c11e221c512) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QKeySequenceEdit: Finish editing when losing focusLaszlo Papp2022-06-292-0/+11
| | | | | | | | | | | Do not wait for the timer to time out. When losing the focus, finish editing immediately since we cannot really edit it further without focus. Change-Id: If42926ef9b06fbea7592a294f48ea5e99ef57ef8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b6a953bb939cb5fe6305f4acf62003c766887f51) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMetaType: extern-template the built-in Core types' QMetaTypeInterfaceThiago Macieira2022-06-292-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This *should* make no difference in behavior, it just prevents the instantiation of the QMetaTypeInterface and all the lambdas used in it in every compilation unit, with a copy in every library. Now, a simple function like: QMetaType f() { return QMetaType::fromType<int>(); } produces only a single function, with a reference into QtCore: _Z1fv: movq _ZN9QtPrivate25QMetaTypeInterfaceWrapperIiE8metaTypeE@GOTPCREL(%rip),%rax ret The code above *does* work on Windows, producing: _Z1fv: movq __imp__ZN9QtPrivate25QMetaTypeInterfaceWrapperIiE8metaTypeE(%rip), %rax ret However, it breaks the staticMetaObjects' metatype listing, because getting the address of a __declspec(dllimport) variable is not a constant expression (it lacks data relocations). So this is disabled on Windows. This change also broke the INTEGRITY build. I've simply disabled the optimization there without attempting to understand why it fails. Task-number: QTBUG-93471 Change-Id: Id0fb9ab0089845ee8843fffd16f97748a00b4d64 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit dbf58407cb7f87b8d75ffd4e8af1393e80f30873) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QHttpHeaderParser: Allow larger fields but restrict total sizeLars Schmertmann2022-06-282-11/+40
| | | | | | | | | | | | | | | | | | | Our limit of 8k for a single header field was too small for certain services which returned Location values or WWW-Authenticate challenges longer than 8k. Instead, taking inspiration from Chromium, we have a limit of 250k for the full header itself. And increasing our field limit to 100k, which would occupy almost half of what the total header allows. Also took the opportunity to make it adjustable from the outside so we can set more strict limits in other components. Fixes: QTBUG-104132 Change-Id: Ibbe139445e79baaef30829cfbc9a59f884e96293 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> (cherry picked from commit e3ea1d02e6a2cbc63e8ae6fff6ccae49258fe5a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* fix androiddeployqt with user application with in-tree QML modulesMoody Liu2022-06-281-4/+9
| | | | | | | | | | | | | | | | | | | | | | when deploying user applications with QML modules located under user's subdirectories, (e.g. some third-party QML components used as git submomdule). The qmldir for such QML modules will be, typically, generated under BUILD_DIR/android-qml. if a BUILD_DIR is under the source directory, androiddeployqt will skip those QML modules incorrectly because they "appeared to be under the QML root path so that seems can be imported", however without deploying them, it's impossible to import those modules on an Android device. this patch adds a check that also tests if a root path plus the module's url can actually lead to the correct module path, so a QML module under android-qml subdir would not pass the test, and thus won't be skipped. Task-number: QTBUG-103593 Change-Id: I8af76bd38cd55700e17794cf2fff0e50a90ac87e Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 8a96c8a22ca2c81969bb5e06249c06143b7f8249) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qtestlib: exit with error if a test is invoked with unknown data tagDimitrios Apostolou2022-06-281-21/+22
| | | | | | | | | | | | | | | Previously trying to execute a test function with an unknown data tag would print an error message but exit with 0. This patch stores a test failure, and continues trying to execute the rest of the command line arguments, if any. In the end the process exits with the usual exit code (number of failed tests) which is now !=0. Fixes: QTBUG-24240 Change-Id: Id4d422035f173e01e77ca88028dfd94dc0f9085c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit d23dcc05425dcd2ab0eb621f5f2ea793a78fcc9f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid overflowing coverage in rasterizerAllan Sandfeld Jensen2022-06-281-11/+8
| | | | | | | | | | | A single examined pixel might have sampled corners outside the logical constraints, that needs to be ignore. Fixes: QTBUG-92485 Change-Id: I105fd42d3388a48f3bb03c00d640832e8e99477c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit aefb5c5a56dd6882179130b98fc44ac0fb366b03) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix an incorrect invocation of llvm-readobjVille Voutilainen2022-06-281-2/+2
| | | | | | | | | | | | | | | It's never been entirely sound or necessarily correct to use single-dash options for long options. Various other things invoked by androiddeployqt seem to provide only single-dash options, but llvm tools and GNU tools always provide a double-dash option. Therefore we can just change the --needed-libs option to use double-dash without any particular version checks or differences. Task-number: QTBUG-104580 Change-Id: I5649b0f9565989157d934c802da1f3c4c43fca0f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> (cherry picked from commit 40ddf2c7f34e429af4d18063ca947490cdc12ba9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QStyledItemDelegate: Fix the event filter docLaszlo Papp2022-06-281-2/+3
| | | | | | | | | | | | | The class actually also avoids filtering the tab and backtab keys for the mentioned classes: QTextEdit and QPlainTextEdit. So, the documentation needs to be extended to cover the hidden gems. Change-Id: Id993b055a105c6cfe5ee57be3863ce8bff448396 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 82309305a7869a5a7667bdd799d763a842cdf85b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ensure consistent cursor width under fractional scalingEirik Aavitsland2022-06-281-1/+14
| | | | | | | | | | | | | | | Under fractional scaling, an N units wide rectangle can in general cover either M or M+1 pixels, depending on placement. For a tall thin recangle like the cursor, this difference becomes very visible as the cursor moves from position to position. Avoid by instead painting the cursor as a cosmetic line in such cases, since that keeps its width independently of the current transformation. Fixes: QTBUG-95319 Change-Id: I31a31f89fe7eac3037694946aa452a9f2bd6e5be Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 3709bc3699ef0632bd2af53b02d44d130b8c0e13) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: metal: Switch back to presentDrawableLaszlo Agocs2022-06-281-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This convenience should be, according to the Apple docs, equivalent to calling present from a scheduled handler. (which on its own makes it unclear why we switched in the first place) In practice it seems the two approaches are not identical. It looks like that once a frame is submitted earlier than the next display link callback, the throttling behavior we implement in beginFrame() (waiting on the semaphore for the completion of the appropriate command list etc.) starts exhibiting unexpected behavior, not correctly throttling the thread to the refresh rate. Changing back to presentDrawable does not exhibit this at all. The suspicion is that presentDrawable is probably doing more than what the docs suggest, and so is not fully equivalent to calling present manually from a scheduled handler. Therefore, switch to presentDrawable now, which restores the expected cross-platform behavior, but make a note of the oddity, and also prepare the hellominimalcrossgfxtriangle manual test to provide an easy, self-contained application to allow experimenting in the future, if needed. This allows Qt Quick render thread animations to advance at the expected speed (because the render thread is correctly throttled to the refresh rate), even if the render thread decides to generate a new frame right away, without waiting for the next display link update. Without this patch, attempting to get updates not via requestUpdate(), but by other means (timer etc.) leads to incorrect throttling, and so the triangle in the test app is rotating faster than expected - but only with Metal. Running with OpenGL on macOS or with any API on any other platform the behavior will be correct. Even if scheduling updates without display link is not efficient, and should be discouraged, not doing so cannot break the core contract of vsync throttling, i.e. the thread cannot run faster just because it renders a frame not in response to an UpdateRequest. Amends 98b60450f7ce6b16464392747ab8721f30add15e (effectively reverts but keeps the code and the notes because we might want to clear this up some day) Fixes: QTBUG-103415 Change-Id: Id3bd43e94785384142337564ce4b2644bf257100 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit f814cc6a7911f6cf14ce443f41c2336bc1d213c6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android 13: Fix warnings on starting an applicationSamuel Mira2022-06-281-2/+2
| | | | | | | | | | | | | On Android 13, currently in beta, android triggers a warning because it is using a deprecated getDrawable function. The patch changes it to use the non-deprecated alternative as suggested in the warning. Fixes: QTBUG-103568 Change-Id: I3e629e7b75044bfb51874256895be0ec7e1088f8 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit e07fea6fb405c6e9affe6e377ad99a98a740c5be) Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Enabler for fractional scaling of text in Qt QuickEskil Abrahamsen Blomfeldt2022-06-282-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | As opposed to the raster engine, in Qt Quick we are using unscaled positions for the glyphs and using the vertex shader to scale these after the fact. However, when picking the correct subpixel rendering for each glyph, we would use the unscaled position's fractional part, meaning that we essentially rendered the glyphs at the wrong subpixel position. This was especially visible when doing fractional scaling, e.g. 125%. Thus we need to get the fraction of the actual on-screen position instead. This has to be done both when populating the cache for the Qt Quick case (this enabler adds it as opt-in) and also when actually selecting the correct rendering of the glyph (change in Qt Declarative). Task-number: QTBUG-101008 Change-Id: Ie67948b138f578b5f40d6a950c4aa92394a8f09a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 20ae170b351947e2cf8137504672fd5645151b9f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* FatalSignalHandler: print some more information from siginfo_tThiago Macieira2022-06-281-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The siginfo_t parameter allows us to show what process sent a signal or the crashing address. Additionally, it allows us to determine if the crashing signal was indeed sent due to a crash. The selftest tst_crashes produces now: $ QTEST_DISABLE_STACK_DUMP=1 ./crashes ********* Start testing of tst_Crashes ********* Config: Using QtTest library 6.4.0, Qt 6.4.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 11.2.1 20220420 [revision 691af15031e00227ba6d5935c1d737026cda4129]), opensuse-tumbleweed 20220428 PASS : tst_Crashes::initTestCase() Received signal 11 (SIGSEGV), code 1, for address 0x0000000000000004 Function time: 0ms, total time: 0ms [1] 201995 segmentation fault (core dumped) QTEST_DISABLE_STACK_DUMP=1 ./crashes The last line comes from the shell. The code isn't decoded, but on Linux it's a SEGV_MAPERR. macOS prints exactly the same thing. I've updated one of the expected_crashes_*.txt output that doesn't seem possible (the "Received a fatal error" message does not appear in Qt anywhere). Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16ebc8391234f0e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 5e67e7efaa2669252fd8c55392b7bc35b72c6079) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProcess: re-enable pdfork() on FreeBSDThiago Macieira2022-06-281-1/+1
| | | | | | | | | | | The forkfd_pidfd is a Linux feature, but we ended up disabling the equivalent functionality on FreeBSD. Change-Id: I6d3880c7d99d4fc494c8fffd16fabfbc38865f94 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5e60b2ab160bc5ff3bc41bb8991753785d2fc285) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAction: Fix the obsolete menu() docLaszlo Papp2022-06-281-1/+1
| | | | | | | | | | | | | 35ddf3498859dc184456346f2b070fe94dabaf26 added QMenu::menuInAction, but the documentation added to cover it contains a typo. The method added to replace QAction::menu() is menuInAction, not menuForAction. It was probably just an oversight. Change-Id: I2a6ec846bbe7ac8dd9e0c285bc62dd7e08820459 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dedf11a53b664c6901dd8d9656e6d7e1fb051974) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTest: switch some text-conversion functions to use qsizetypeMårten Nordheim2022-06-282-12/+10
| | | | | | | | | | To avoid potential narrowing. Task-number: QTBUG-104125 Change-Id: I37bfc5c49e7c919f5204a76a905758a92527d864 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 44927b801ab8afac901132f9505a42b41821cb55) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFont: don't detach the families list in family()Thiago Macieira2022-06-281-1/+1
| | | | | | | Change-Id: Id0fb9ab0089845ee8843fffd16f93a8b9306b89b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 68a1f9582b38b30add7c061caae1fd8acb356da9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Remove Gui dependency of androidtestrunnerAlexandru Croitor2022-06-271-2/+2
| | | | | | | | | | | It doesn't use any Gui classes and thus shouldn't depend on Gui. Also change PUBLIC_LIBRARIES to LIBRARIES, executables don't need to propagate library dependencies. Change-Id: I9edae7e555e1d74d63b00afbf9e3931963b502c2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 3eaf6a4cad4c12c1777cf7d5793e518f66f07780) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid reading outside allocated bufferAllan Sandfeld Jensen2022-06-271-0/+4
| | | | | | | | | | Bound the inverse lookup result on the low end as well. Fixes: QTBUG-104583 Change-Id: Id357fe1c39c88776075d737b08fc2864a2b6e829 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit a2501fff818971a375a927038792140aed6ef4b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QString(En|De)coder: Remove noexcept from ctor taking nameFabian Kosmale2022-06-271-2/+2
| | | | | | | | | | | | | It is necessary as the QStringConverter ctor is no longer noexcept, as it can now allocate memory. This change is ABI-wise safe, as the method was only changed to be noexcept in 6.4. Amends 122270d6bea164e6df4357f4d4d77aacfa430470. Change-Id: Ifab4302d659524e27f38f0f90e5813a2c2a4a452 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ba2ae1720a11692e2fc57c8be176f2dd9e126f2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QDBusInterface crashing with empty path on constructionMårten Nordheim2022-06-271-0/+5
| | | | | | | | | | | | | | On some machines having an empty path passed to QDBusInterface would cause a crash. This happened because the code created a QDBusMessage and manually marked it as validated when it was not. The validation would not pass for this object. Change-Id: I496dd922fa64353399655a1e84996b99990f5879 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 4d60ba61dca7d50c8eaf9f4525cb9565b363ca81) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QDom: Clean-up warnings about old-style cast usesSona Kurazyan2022-06-271-62/+66
| | | | | | Change-Id: I7cf2089f34e46a901f8b03987feed24773a72c00 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit c3f76a867b7f8f04c207b80a8fbfcb927ee23de2)
* Avoid SSE2 punningAllan Sandfeld Jensen2022-06-251-5/+6
| | | | | | | | | | It is technical UB, even if GCC promises to let it work, but it also generates inefficient code. Change-Id: I8f0cae3490d32287ecbaa16b1e9ace84223cda2a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 821aa1ff095ae66a89eb8725650dccac363f06ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Sync qt_scale_image_argb32_on_argb32_sse2 and qt_scale_image_32bitAllan Sandfeld Jensen2022-06-251-40/+16
| | | | | | | | | | | The rounding was different in the SSE2 version compared to the C version. Fixes: QTBUG-85109 Change-Id: I81f0a71ee5425b93da80b6a438e1778a02b9bcfa Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 7a146019e433e687de7a954c7791ac6fc6fa199c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: properly indent the output for the metatype arrayThiago Macieira2022-06-251-34/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7ff7d73f6ac68227500fa95731ce0f04626e600b added the indentation, but there were a few mistakes and it was off by 4 spaces anyway. So re-do it and take the opportunity to add some comments to explain what we're seeing. Before: qt_incomplete_metaTypeArray<qt_meta_stringdata_QTimer_t, QtPrivate::TypeAndForceComplete<bool, std::true_type>, QtPrivate::TypeAndForceComplete<int, std::true_type>, QtPrivate::TypeAndForceComplete<int, std::true_type>, QtPrivate::TypeAndForceComplete<Qt::TimerType, std::true_type>, QtPrivate::TypeAndForceComplete<bool, std::true_type>, QtPrivate::TypeAndForceComplete<QTimer, std::true_type>, QtPrivate::TypeAndForceComplete<void, std::false_type> , QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<int, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type> >, After: qt_incomplete_metaTypeArray<qt_meta_stringdata_QTimer_t, // property 'singleShot' QtPrivate::TypeAndForceComplete<bool, std::true_type>, // property 'interval' QtPrivate::TypeAndForceComplete<int, std::true_type>, // property 'remainingTime' QtPrivate::TypeAndForceComplete<int, std::true_type>, // property 'timerType' QtPrivate::TypeAndForceComplete<Qt::TimerType, std::true_type>, // property 'active' QtPrivate::TypeAndForceComplete<bool, std::true_type>, // Q_OBJECT / Q_GADGET QtPrivate::TypeAndForceComplete<QTimer, std::true_type>, // method 'timeout' QtPrivate::TypeAndForceComplete<void, std::false_type>, // method 'start' QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<int, std::false_type>, // method 'start' QtPrivate::TypeAndForceComplete<void, std::false_type>, // method 'stop' QtPrivate::TypeAndForceComplete<void, std::false_type> >, Change-Id: Id0fb9ab0089845ee8843fffd16fa152d040ef922 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 3816b14ee8bc6f9722f3b76a32f968e334d0ed27) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qmetatype.h: add QT_FOR_EACH_STATIC_PRIMITIVE_NON_VOID_TYPEThiago Macieira2022-06-251-7/+7
| | | | | | | | | | | This allows us to simplify the explicit specialization of the QMetaTypeInterface<void> explicit specialization, dropping the warning push/pop, and remove an unnecessary explicit instantiation. Change-Id: Id0fb9ab0089845ee8843fffd16f9bdccf1965b95 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5db3fd29b42ec06ccb15fdd7f274bb20c326ffb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmetatype.h: remove unnecessary EXPORT macroThiago Macieira2022-06-251-9/+2
| | | | | | | | | | | | | | | | | | | | It was introduced in commit d9f9bc9bada91e3ec2b6c496d3b2242506ca56bc for Qt 6.0 to avoid extern __declspec(dllexport), which MSVC doesn't like, but was made obsolete by commit 77b99e8111cdd06b4fe12f2e18950a1e40ee2b76 that removed the extern templates altogether for MSVC. This change is NOT a no-op because Q_CORE_EXPORT expands to Q_DECL_IMPORT which is __attribute__((visibility("default"))) on ELF platforms. That's actually a good thing, because the symbol is not defined in any library that is not called QtCore anyway. GCC and Linux are also going towards properly requiring imported symbols to be explicitly marked, which this is. Task-number: QTBUG-93471 Change-Id: Id0fb9ab0089845ee8843fffd16f99616883281e3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 97fbf7d151fbadb2c4541a5e0689810584a9a210) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSettings: fix a typo in the docLaszlo Papp2022-06-251-1/+1
| | | | | | | Change-Id: I059f603f3cc66a40e84179ac3f2a07de3bf31761 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit e35fc908fdb831e3aef9f539239662e434b1ef13) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add QDom internalSubset implementationYe ShanShan2022-06-252-0/+34
| | | | | | | | | | | | | QDom's internalSubset() always returned empty because nothing actually set the internal data member it returns. When parsing the DECLTYPE, extract the internal subset and save it to the doctype()'s member when present. Fixes: QTBUG-53661 Change-Id: I6e41ff8b914381168246073b3289d82205b1c255 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit c3b959733a739e9b2fc00b2af469fa44f3048e29) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typo in codeDuan Ting2022-06-251-1/+1
| | | | | | | | | | Found by codespell Change-Id: I75f4b14f3eded035a0c904d8a7174cb6f5b7d9ef Reviewed-by: Wang Bo <wangbo@uniontech.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit cd268e9e1d57ca2159371f3c4f93a63d3fe66c4e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add QStringDecoder::decoderForHtml()Lars Knoll2022-06-254-23/+60
| | | | | | | | | | | | | | | Now that QStringConverter can handle non UTF encodings through ICU, add a way to get a decoder for arbitrary HTML code. Opposed to QStringConverter::encodingForHtml(), this method will try to create a valid string decoder also for non unicode codecs. Change-Id: I343584da1b114396c744f482d9b433c9cedcc511 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9c1f3b6d4d5a5fe59396062c6f68cc1201665c62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: put the qt_meta_stringdata_XXXX_t type in an unnamed namespaceThiago Macieira2022-06-251-1/+6
| | | | | | | | | | | | Not all user code is compiled with hidden visibility, so make sure one of the types in the template parameters (the one that is supposed to be unique anyway) is local and therefore causes the full symbol for the inline variable not to be exported outside of the translation unit. Change-Id: I6d3880c7d99d4fc494c8fffd16fb262a59b81283 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 8726647df40c61ed6d79da1e3845ef289bcf8b38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: remove the attempt to create one large string literalThiago Macieira2022-06-251-58/+30
| | | | | | | | | | | | | | | | | | | | | | | | Commit dda9c9e2bc4fd2efe9e3fb0e451a8c3512f9a4d2 fixed some outstanding issues with moc's calculation of the maximum string length, but it missed one. This commit instead opts to remove the calculation entirely and instead have multiple char array members in the qt_meta_stringdata. We needed a single string back in Qt 4.0 when the stringdata *was* a single char array. Since 5.0, we've used a structure with multiple members and pointer arithmetic going past the end of the arrays, from the top of the object. That's UB, but since it's always been UB and can't be fixed until Qt 7 anyway, let's go full monty on it and have one char array per meta object string. The struct qt_meta_stringdata_Qt_t for namespace Qt now has 1217 stringdataXXX members. Change-Id: I6d3880c7d99d4fc494c8fffd16fb0d1573e387dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0978646a65f517f0026fbdd0639415d265876512) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Emit autolinks in QTextMarkdownWriterShawn Rutledge2022-06-241-6/+12
| | | | | | | | | | | | | | | | | | | | When a markdown document contains a "naked" URL, or an angle-bracketed <URL>, md4c recognizes it, and we set the AnchorHref charfmt property. There's no need to expand it into the [text](url) form if the text is the same as the url, there is no tooltip, and the url is valid. QTextMarkdownWriter now writes a CommonMark "autolink" in that case: https://spec.commonmark.org/0.30/#autolinks [ChangeLog][QtGui][Text] QTextMarkdownWriter now writes an autolink whenever a hyperlink has no custom text and no tooltip, including when the document was parsed from Markdown containing a naked URL. Fixes: QTBUG-94713 Change-Id: I432db8499c62e1e0b1e913bfd8ef2147e3c2bb2a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 846b314aaf484a3cb62d466660c08bbde00542cb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Support markdown in QTextEditMimeData; fix pasting trailing newlinesShawn Rutledge2022-06-241-5/+18
| | | | | | | | | | | | | | | | | | | | - Since 4edcea762d9ce334c4c1a78234c90c118b81da87 the dropsite example shows markdown if available; and now it shows that when we do DnD of a selection from the richtext example, text/markdown is available. - If we artificially make html unavailable, copying and pasting between widget-based rich text editors uses markdown. In case markdown writer output contains unnecessary backticks due to monospace fonts getting used, the workaround from 1ad456c908467212bc30223a69eb7524b64b86e1 is applied. Task-number: QTBUG-76105 Task-number: QTBUG-103484 Change-Id: Ie6ca4dbb450dbc36b3d09fd0df1ae5909aaebca7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 56f0ebfe860e440dcbba8997f44836debc901119) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAbstractItemModel: Add revisions to new methodsUlf Hermann2022-06-241-13/+13
| | | | | | | | | | | | These methods show up in QML-exposed types. They should be revisioned in order to keep those types backwards-compatible. Change-Id: I8e826dc2e7db49d8abe69f67605dfb1991855b96 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit c52e0a9582a0a06999d480b969b3b2895fe92217) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use [[noreturn]] attributeKai Köhne2022-06-231-1/+5
| | | | | | | | | | | | Use __has_cpp_attribute mechanism to check availability of [[noreturn]]. For MSVC 2019 and 2022, this is always the case, so we can also remove the (now dead) __declpsec(noreturn) definition. Change-Id: Ie7b39bd93bc5e1a173e245a3a5d5ff7e9067a59f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit bc06e345fe6e284e4dc72f3e02662641dcb9ed71) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>