summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
Commit message (Collapse)AuthorAgeFilesLines
* xcb: Delete touch points without target windowsTang Haixiang2022-05-201-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | When XCB_INPUT_TOUCH_BEGIN closes a popup, we then receive XCB_INPUT_TOUCH_END, and cannot find a target window (because it's destroyed). If we don't deliver it, we need to at least clear the stored point from QPointingDevicePrivate::activePoints. Then when we deliver the next touch press, m_fakeMouseSourcePointId also needs to be reset. It's now even more paramount that autotests (and real-world touchscreens) must never omit any active touchpoint from a touch event. If a point doesn't move, it must be included in the QTouchEvent, with Stationary state. If not, QGuiApp::processTouchEvent() could generate multiple TouchBegin events in a row, which gets other bits of logic confused, here and there. Fixes: QTBUG-94557 Fixes: QTBUG-98519 Fixes: QTBUG-102751 Fixes: QTBUG-103706 Pick-to: 6.2 6.3 5.15 Change-Id: Ia95e410a2bb8bc7784aa5d296fac2b89e53a9f55 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Avoid ending Markdown fenced code blocks with gratuitous blank linesShawn Rutledge2022-05-203-6/+6
| | | | | | | | | | | | This caused unnecessary empty <pre> blocks when converting markdown to HTML, made code blocks too large using QSyntaxHighlighter to highlight the whole block, and caused assymmetry when rewriting markdown. Pick-to: 6.3 Fixes: QTBUG-101031 Change-Id: I08016577ccb92edb4afae31d7df3259cb011d5c8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Convert <pre> to Markdown ``` and vice-versa with nonBreakableLinesShawn Rutledge2022-05-192-2/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HTML parser calls QTextBlockFormat::setNonBreakableLines(true) when it sees a <pre> tag; so for symmetry, the markdown reader now does the same when it sees a fenced code block, and the markdown writer honors the nonBreakableLines property by writing a fenced code block. This preserves the meaning better when reading HTML and writing markdown or vice-versa, without modifying HTML reading or writing code. Added a test tst_QTextMarkdownImporter::fencedCodeBlocks() which unfortunately also highlights a known bug in the markdown reader: each fenced code block ends with an extra empty block. That can be fixed separately. tst_QTextMarkdownWriter::fromHtml(preformats with embedded backticks) that we re-enabled in 1abaf9d5d6ea9c6554362e851903ddd214a6f659 was not a very useful test: ``` with a space and some words but no newline is not a fence: it's just like a `monospace` span. We have had trouble with those in CI because of missing monospace fonts, or inconsistency when a supposedly mono font's QFontInfo::fixedPitch() returns false. So just test proper <pre>/fence conversion for now. Pick-to: 6.3 Fixes: QTBUG-100515 Fixes: QTBUG-100981 Task-number: QTBUG-101031 Change-Id: I88f0ede0810d8a9480b30eb0cd780e1af67cc5f2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* unblacklist passing tests 2022Anna Wojciechowska2022-05-181-2/+0
| | | | | | Pick-to: 6.2 6.3 Change-Id: I7d37dd58eaede1bd0d1b53fe264b45be83cbca57 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Un-blacklist markdown tests: QSKIP when fonts are scrambledShawn Rutledge2022-05-184-31/+92
| | | | | | | | | | | | | | | | | | | | | On QNX in CI we see system fonts: fixed: monospace 9; general: Sans Serif 9 and "monospace" isn't really a fixed pitch font. On B2Qt arm7 in CI we see system fonts: fixed: monospace 9; general Sans Serif 9 and Sans Serif is actually fixed pitch. So these tests can go wrong both ways; we need to skip them whenever the fonts would lead QTextMarkdownWriter astray. Pick-to: 6.3 6.2 Task-number: QTBUG-89819 Task-number: QTBUG-99676 Task-number: QTBUG-100515 Task-number: QTBUG-103484 Change-Id: I7b9adca967eaf9b8d33d1e03ef2627f70f375196 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use QAbstractItemModelTester or QFileSystemModelAndreas Buhr2022-05-181-0/+35
| | | | | | | | | | | | This patch enables usage of QAbstractItemModelTester on QFileSystemModel. QAbstractItemModelTester called fetchMore() on all items. QFileSystemModel represents the whole file system. This led to very long test runs. To avoid this, this patch introduces a new feature in QAbstractItemModelTester, namely to disable calling of fetchMore(). Change-Id: Ie5d2e22fa4c143be7c080d9f79632cd2cbe07aac Reviewed-by: David Faure <david.faure@kdab.com>
* Use SPDX license identifiersLucie Gérard2022-05-16114-3090/+229
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add QTextDocFragment::to/fromMarkdown() & QTextCursor::insertMarkdown()Shawn Rutledge2022-05-141-0/+222
| | | | | | | | | | | | | | | | | | | | | Also add the beginnings of an autotest for QTextCursor::insertHtml(), for comparison purposes. We can see that the block to be inserted is merged with an existing block by default rather than being inserted as a new one, with both HTML and Markdown insertions. So now we test for leading and trailing newlines in the markdown to be inserted, to determine whether we need a new block into which to insert, and to "hit enter" at the end of the insertion. QSKIP the toMarkdown() comparisons if GeneralFont is mono. This happens on Boot2Qt systems in CI. Task-number: QTBUG-76105 Task-number: QTBUG-94462 Task-number: QTBUG-100515 Task-number: QTBUG-103484 Change-Id: I51a05c6a7cd0be4f2817f4a922f45fa663982293 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add floating point color space conversionsAllan Sandfeld Jensen2022-05-141-0/+51
| | | | | | | | | | This allows color space conversions that produces values outside the 0.0->1.0 range, which is one of the intended functions of the floating point image formats. Change-Id: I63b37b0f6934d4382edafb4709486c785a637c67 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QPolygon: add toPolygonF()Marc Mutz2022-05-101-0/+12
| | | | | | | | | | | | | This was forgotten when implementing QTBUG-73160, but suggested in passing in QTBUG-64. [ChangeLog][QtGui][QPolygon] Added toPolygonF(). Task-number: QTBUG-73160 Task-number: QTBUG-64 Change-Id: I9b33cf47a0d432aa842ab0f8337001c66e4ca41c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Optimize the QPalette::resolve from the other paletteJiDe Zhang2022-04-281-0/+8
| | | | | | | | | If all the palette's colors are resolved, nothing needs to be done in QPalette::resolve(const QPalette &other). Change-Id: I1573cfa5b5cd1e7eb15f3242aff6ab92e9f8c84b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* rhi: Make QRhiRenderTarget's rp getter functional with swapchainsLaszlo Agocs2022-04-261-0/+1
| | | | | | | | | | | | | | | | | swapchain->currentFrameRenderTarget()->renderPassDescriptor() is not functional at the moment, it returns null. This is because no backend ensures that the internal renderpass descriptor object is exposed via that getter in a QRhiSwapChainRenderTarget. Whereas in a QRhiTextureRenderTarget this would work by design because there the setter must be called by the user. Fix this up, providing better API symmetry, and also reducing the need to pass along QRhiRenderPassDescriptor objects seprately alongside a QRhiRenderTarget in some places, e.g. in Qt Quick. Change-Id: I42c4e9aaee3202c1d23bd093d840af80c5f8cd0f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Add a feature flag for non-fill polygon modesLaszlo Agocs2022-04-221-1/+2
| | | | | | | | It's one thing that this is not part of OpenGL ES, but it is optional even with Vulkan, with some mobile GPUs not offering the feature at all. Change-Id: I4e2c6642eccb0793e69074b4b6eeb2b7cef3516e Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* QFutureCallOutEvent: de-export againMarc Mutz2022-04-141-1/+7
| | | | | | | | | | | | A previous commit Q_CORE_EXPORTed this class so it could be used in tst_qevent. But we can also keep it Q_AUTOTEST_EXPORTed and make the testing of the class subject to QT_BUILD_INTERNAL on the test side. That's what this patch does. Change-Id: I9bd5f80ada856b7db4b39dfb59b32bd825416c13 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QEvent: start to de-inline copy ctor and clone() of all subclassesMarc Mutz2022-04-142-2/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no advantage to them being inline: Absent de-virtualisation, clone() is only supposed to be called through the vtable, and the copy ctor is only supposed to be used in the implementation of clone(). And when the compiler de-virtualises, we don't want the code duplication associated with inlining. Enforce this by introducing new macros to hide the boilerplate. This fixes missing out-of-line dtors in: - QSinglePointEvent - QApplicationStateChangeEvent - QFutureCallOutEvent Wrong covariant return in: - QFutureCallOutEvent And missing clone() reimplementations in: - QCloseEvent - QIconDragEvent - QShowEvent - QHideEvent - QDragEnterEvent - QDragLeaveEvent While these don't carry extra data or members, a dynamic_cast of the result of clone() as well as using the expected covariant return value would fail: QShowEvent *e = ~~~; QShowEvent *e2 = e->clone(); // ERROR: converting QEvent* to QShowEvent* Check that reimplementing clone() is binary compatible (covariant returns may change the numerical pointer value returned, cf. https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B). The copy-assignment operator stays inline for the time being, as the goal is to = delete it in the future. This patch covers, roughly, QtCore and QtGui. [ChangeLog][QtGui][QEvent subclasses] Fixed missing clone() reimplementations on QCloseEvent, QIconDragEvent, QShowEvent, QHideEvent, QDragEnterEvent, and QDragLeaveEvent. Task-number: QTBUG-45582 Task-number: QTBUG-97601 Change-Id: Ib8a0519dbe85a7a8da61050d48be338004dfa69a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace uses of _qs with _s in testsSona Kurazyan2022-04-073-13/+19
| | | | | | Task-number: QTBUG-101408 Change-Id: If092a68828a1e8056259cf90d035d9a87989244b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CI: blacklist fromHtml:preformats with embedded backticks for QNXPasi Petäjäjärvi2022-04-061-0/+2
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-100515 Change-Id: I82b06ef1d2e275e256f8d811bc70f425c6e6bf7e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* rhi: Add explicit subclass for RTs from swapchainsLaszlo Agocs2022-04-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | We want to enable gaining access to the underlying resource(s) by inspecting a QRhiRenderTarget. This is not currently possible for swapchains since there is nothing that references the actual QRhiSwapChain. To clean this up, make an explicit, new QRhiSwapChainRenderTarget subclass. Thus the logic already used in a couple of places to examine the resources attached to a QRhiTextureRenderTarget can now work with swapchain render targets too, by branching based on the resourceType(). This eliminates the somewhat odd setup where a "RenderTarget" resource is QRhiRenderTarget corresponding (but not exposing!) a swapchain, whereas a "TextureRenderTarget" is a QRhiTextureRenderTarget which is a subclass of QRhiRenderTarget. Now we correctly have an (abstract) base and two subclasses, one for each type of render targets. Besides, it allows us to clean up the oddly named Q...ReferenceRenderTarget classes in the backends, which initially tried to indicate that this "render target" merely references (or, in practice, is) a swapchain. We can now have a nice and symmetrical Q...SwapChainRenderTarget and Q...TextureRenderTarget naming scheme. Change-Id: Ib07e9be99a316eec67b94de0860e08f5f4638959 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* CI: Blacklist mixedScripts for QNXPasi Petäjäjärvi2022-04-051-0/+3
| | | | | | | | | QNX tests are run under QEMU so have the same problem as Ubuntu. Pick-to: 6.2 6.3 Task-number: QTBUG-100928 Change-Id: Id7c7639b743062c777502e2ba8b28f9bb18deb19 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Android: enable tst_QScreen::grabWindowIvan Solovev2022-03-312-2/+12
| | | | | | | | | | | | | | Two things are done here: - use showNormal() instead of show() to get an expected widget size. - skip the test if HighDPI scaling is enabled with non-integer scaling factor, because there can be rounding errors. Fixes: QTBUG-87390 Pick-to: 6.3 6.2 Change-Id: I653a17bac2142838b03a328e1629582384b6c7b3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: skip tst_QFileSystemModel::specialFiles()Ivan Solovev2022-03-252-3/+3
| | | | | | | | | | | The test will never pass on Android because it's missing permissions to read root filesystem. Skip the test instead of blacklisting it. Fixes: QTBUG-87427 Pick-to: 6.3 6.2 Change-Id: Ib57a49b1d2bc4204f8aa2c3028c7220d23ff2a91 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* rhi: d3d11/vulkan: Allow passing in an array range overrideLaszlo Agocs2022-03-241-1/+6
| | | | | | | | | | | | | | | | | | Only (straightforwardly) implementable with modern APIs, and only really exists to handle special platform cases, such as when a video framework gives us a D3D texture array with D3D11_BIND_DECODER | D3D11_BIND_SHADER_RESOURCE which is only possible to use as a shader resource if the SRV selects a single array layer. Has no effect on the normal usage of texture arrays, where all array layers are exposed, and it is the shader that selects the layer when sampling or loading via the sampler2DArray. That continues to be the standard way to work with texture arrays. Change-Id: I0a656b605da21f50239b38abb83067e0208c1dbe Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Android: don't QEXPECT_FAIL in tst_QTextDocument::task240325()Assam Boudjelthia2022-03-231-3/+0
| | | | | | | | | | This test doesn't fail on Android anymore, so don't use QEXPECT_FAIL. Pick-to: 6.2 6.3 Task-number: QTBUG-100470 Fixes: QTBUG-69242 Change-Id: I5a96566728a486c701656aede1818e7ab7f019be Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Replace deprecated QColor::fromString in tests and documentationVolker Hilsheimer2022-03-211-1/+1
| | | | | | | | Don't use deprecated methods in tests, and don't refer to them in documentation. Change-Id: I110480742d9a7b9b0a2e194e3fe610208c1e07da Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_qopengl: set surfaceType explicitlyJanne Juntunen2022-03-181-0/+1
| | | | | | | | | | Parent window in sizeLessWindow test was using software pipeline at least on webOS, causing a QCRITICAL() exit when the test was executed. Fixes: QTBUG-101869 Pick-to: 6.3 Change-Id: Ie8cc0ea0b6a09729475389be44197e01a45b217f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Tests: Do not depend on transitive includesFabian Kosmale2022-03-174-0/+5
| | | | | Change-Id: Ibc6a948480a904913a5427e6408d4d296784fb4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* GUI: add ScreenWindowGrabbing capabilityLiang Qi2022-03-171-2/+6
| | | | | | | | | On Wayland, there is no protocol to do it yet. Task-number: QTBUG-100792 Task-number: QTBUG-101145 Change-Id: Id72625a8161359111a2d0f43f3215e787778ba6b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QColor: deprecate isValidColor, setNamedColor, string-ish ctorsMarc Mutz2022-03-151-0/+23
| | | | | | | | | | | | [ChangeLog][QtGui][QColor] The constructors from string-ish type, as well as the setNamedColor() and isValidColor() functions, have been deprecated effective Qt 6.6 in favor of fromString() and isValidColorName(), resp. Fixes: QTBUG-101389 Change-Id: I002646bd48c1e4340dc6842fd136fc9f35bb9b61 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* gui: return first default device when seatName isNullLiang Qi2022-03-131-6/+45
| | | | | | | | | | | | | for QInputDevice::primaryKeyboard() and QPointingDevice::primaryPointingDevice(). This also reverts ae9fefe3c89fd5720ccaad0687f125e32f7c3fe6. Fixes: QTBUG-100790 Pick-to: 6.3 Change-Id: Id02f277db25f823eb29e939e25801325df8e4076 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Deprecate {QString, QByteArray}::count()Sona Kurazyan2022-03-121-1/+1
| | | | | | | | | | | | And remove their uses. [ChangeLog][QtCore][Deprecation Notice] Deprecated QString::count() and QByteArray::count() that take no parameters, to avoid confusion with the algorithm overloads of the same name. They can be replaced by size() or length() methods. Change-Id: I6541e3235ab58cf750d89568d66d3b1d9bbd4a04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live QColor::fromString()!Marc Mutz2022-03-081-21/+31
| | | | | | | | | | | | | | | | | | | | | | | | | It is customary for Qt types that can be constructed from string-ish to provide a fromString() named constructor. QColor didn't, relying instead on a set of overloaded implicit and explicit constructors. Add the named constructor, with the intent to deprecate the string-ish QColor constructors after a grace period. To prevent new users from using known-to-become-deprecated API, mark the old functions as \obsolete. Also rename isValidColor() to isValidColorName(). The only reason why these are lumped together in single commit is so that their docs can refer to each other instead of having to temporarily refer to obsolete API. [ChangeLog][QtGui][QColor] Added fromString() and isValidColorName(), both taking QAnyStringView. Task-number: QTBUG-101389 Change-Id: I2857c728257ad2f14c7c968b45547bdf07c44b63 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Blacklist: test cases blacklisted in tst_QTouchEvent:CI Insignificant Platforms Monitor Bot2022-03-071-0/+2
| | | | | | | | | | - multiPointRawEventTranslationOnTouchPad on windows-11 Pick-to: 6.2 Pick-to: 6.3 Task-number: QTBUG-101519 Change-Id: Idbba677893f559ee239739d8c78aa820d974e120 Reviewed-by: CI Insignificant Platforms Monitor Bot <ci_insignificant_platforms_monitor_bot@qt.io>
* tests: XFAIL a few in tst_QStaticText on WaylandLiang Qi2022-03-021-0/+23
| | | | | | | Task-number: QTBUG-100982 Pick-to: 6.3 6.2 Change-Id: I18cdb79d9261bac40cc619f9d327d0ef7ed722c4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: XFAIL tst_QOpenGL::bufferMapRange() on WaylandLiang Qi2022-03-021-0/+2
| | | | | | | Task-number: QTBUG-100918 Pick-to: 6.3 6.2 Change-Id: I1b892a80bcb44e0e4f658ed7073c54900d8a358c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: XFAIL tst_QImageReader::setScaledClipRect() SVG/SVGZLiang Qi2022-03-021-0/+2
| | | | | | | | | on Wayland Task-number: QTBUG-100917 Pick-to: 6.3 6.2 Change-Id: I66c42bb0ceca83fd0531159c606d22c58b18b371 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix painting clipping glitches with fractional scalingEirik Aavitsland2022-03-022-8/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QPainter, clipping can only be done on whole pixels. The various ways of specifying a clipping rectangle to the QPainter API have been inconsistent in how fractional rectangles (either specified directly, or as a result of fractional scaling) are mapped (rounded) to integer coordinates. Also, the mappings have not made sure to keep the edge-to-edge property of clip rects under scaling. This is particularly important when scaling QRegions with multiple rects, as QRegion is designed on the assumption that an area can be described as a set of edge-to-edge rects. The fix rounds a clip rect identically with a fill rect. (Indeed, a followup plan would be to merge QRasterPaintEngine's toNormalizedFillRect() with the rectangle rounding function in this commit). Notably, a QRectF clip is now interpreted the same as a QPainterPath clip describing the same area. This modifies d9cc1499954829faf9486fb72056e29f1bad58e3 Task-number: QTBUG-100329 Fixes: QTBUG-95957 Task-number: QTBUG-100343 Pick-to: 6.3 Change-Id: Iaae6464b9b17f8bf3adc69007f6ef8d623bf2c80 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CI: Blacklist systemFixedFont for QNXPasi Petäjäjärvi2022-03-021-1/+3
| | | | | | | | | | QNX tests are run under QEMU so have the same problem as b2qt Pick-to: 6.2 6.3 Task-number: QTBUG-100948 Change-Id: I2abc8a4bca9e8ba414197721301d493296e7ce0b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QGuiApplication: use translation-based layout direction unless explicitly setVolker Hilsheimer2022-02-241-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stored layout direction used to get changed during initialization to what was auto-detected based on the translation. Changing the translation then overwrote that stored value, even if an explicit call to setLayoutDirection was made by the application. Calling QGuiApplication::setLayoutDirection(Auto) has so far been a no-op. Change this logic so that the stored layout direction continues to be LayoutDirectionAuto also if it's set based on auto-detection, and only overwrite it when explicitly called with a non-Auto value. This way, applications can set a layout direction that stays unchanged even when translators are installed. Add test coverage that uses a QTranslator. In practice, this is not a change of behavior, unless applications called setLayoutDirection(Auto) (which is no longer a no-op), or called setLayoutDirection() and then installed a translator and expected the translator's layout direction to come into effect in spite of the explicit setting. [ChangeLog][Gui][QGuiApplication] Calling setLayoutDirection with a non- auto value now disables the auto-detection based on installed translators. Applications that explicitly set a layout direction and also want translators installed afterwards to take effect should reset the layout direction to Auto, which is now no longer a no-op. Fixes: QTBUG-100632 Pick-to: 6.3 Change-Id: I1fdcebd43a9b1b468ff95bf15f53f441bb214e08 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Blacklist tst_qscreen::grabWindow for all Windows versionsOliver Wolff2022-02-241-1/+1
| | | | | | | | | The test is not only flaky on Windows 10 but also on Windows 11. Pick-to: 6.2 6.3 Task-number: QTBUG-100412 Change-Id: I27e8179dafd4743c3eaf2c0dd8b70b804612c7c2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Activate tst_qtextdocument for AndroidAndreas Buhr2022-02-241-2/+1
| | | | | | | | | | | | tst_qtextdocument was disabled because it crashed. It does not any more. Task-number: QTBUG-87671 Pick-to: 6.2 6.3 Change-Id: Ie1bd75c21e481c2ecb8607c04ce9370fc6d7b00e Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Pekka Gehör <pekka.gehor@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Check if platform has enough RAM for hugeQImage testPasi Petäjäjärvi2022-02-171-1/+4
| | | | | | | | | | | The hugeQImage test loads, as its name suggests, a huge image. At 2.5 GiB it's too big for the hard-coded 1 GiB limit on RAM that the QNX toolchain hard-codes when it's started in QEMU. Pick-to: 6.2 6.3 Task-number: QTBUG-100929 Change-Id: I8e8caaff7fd1dd0e648ada5df613c793f72bcf5d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Set version for tst_qguiapplication and tst_qcoreapplicationAndreas Buhr2022-02-171-0/+3
| | | | | | | | | | | In tst_qguiapplication and tst_qcoreapplication, the application version should be set. On Android, this is done using QT_ANDROID_VERSION_CODE. Pick-to: 6.2 6.3 Change-Id: I6b473ad25092fb24df9400e0ab8fbb8ea4edbb6a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* tests: skip tst_QX11Info on WaylandLiang Qi2022-02-171-0/+10
| | | | | | Pick-to: 6.3 6.2 Change-Id: I927ee28f61719ff1b67f73dc31dfcae9b73d8329 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: XFAIL tst_QGuiApplication::genericPluginsAndWindowSystemEvents()Liang Qi2022-02-171-0/+2
| | | | | | | | | on Wayland Task-number: QTBUG-100891 Pick-to: 6.3 6.2 Change-Id: Iadf12364ded4549988ad75a9487c7e96e963a956 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: XFAIL 4 tests in tst_QWindow on WaylandLiang Qi2022-02-171-10/+9
| | | | | | | | | | Task-number: QTBUG-66818 Task-number: QTBUG-100887 Task-number: QTBUG-100888 Task-number: QTBUG-100889 Pick-to: 6.3 6.2 Change-Id: I05ba11e54c115380bbbb629fcba5cdd658dd5654 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: XFAIL tst_QScreen::grabWindow() on WaylandLiang Qi2022-02-171-0/+2
| | | | | | | Task-number: QTBUG-100792 Pick-to: 6.3 6.2 Change-Id: I1dc257abdc34c586c4c1eda96a43ea75395b1e4a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: XFAIL tst_QInputDevice::multiSeatDevices() on WaylandLiang Qi2022-02-171-0/+7
| | | | | | | Task-number: QTBUG-100790 Pick-to: 6.3 6.2 Change-Id: Ieec4791e4322286fedeeabacc43b9cb84ea27962 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QJsonObject: use QJsonValueConstRefThiago Macieira2022-02-151-63/+6
| | | | | Change-Id: I5e52dc5b093c43a3b678fffd16b608f32f8eb4b4 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QDesktopServices: deprecate destroying URL handlers w/o explicit ↵Marc Mutz2022-02-151-0/+19
| | | | | | | | | | | | | | | | | | | unsetUrlHandler() [ChangeLog][QtGui][QDesktopServices] URL handlers that have been passed to setUrlHandler() must now be removed by calling unsetUrlHandler() before they are destroyed. Relying on the handler's destructor to implicitly unset it is now deprecated, because it may already be in use by concurrent openUrl() calls. Support for implicit unsetting will be removed in 6.6 and, until then, a qWarning() is raised if it is exercised. Fixes: QTBUG-100775 Fixes: QTBUG-100779 Pick-to: 6.3 6.2 5.15 Change-Id: I0c4f91b78f847b135fdeb38766babc892bdc1379 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Repair tst_qcoreapplication to not segfault on AndroidAndreas Buhr2022-02-151-0/+1
| | | | | | | | | | | | | | tst_qcoreapplication.cpp is used both in tst_qcoreapplication and tst_qguiapplication. To distinguish these two compilations, the define QT_GUI_LIB was used. This led to an error on Android, where Qt::Gui is always linked, because the Qt Android Platform Plugin needs it. This patch introduces the preprocessor define QT_QGUIAPPLICATIONTEST which is to be used only in the compilation of tst_qguiapplication. This is then used instead of QT_GUI_LIB. Change-Id: Ifa5bfacb197d68365288c1da85573106515fc6c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>