summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
Commit message (Collapse)AuthorAgeFilesLines
* Wayland: Remove XFAIL after underlying bug was fixedEskil Abrahamsen Blomfeldt2022-08-091-2/+0
| | | | | | | | | | The intialSize bug has been fixed in Qt Wayland Client, and thus this test will now start XPASSing. Pick-to: 6.4 Task-number: QTBUG-66818 Change-Id: I4b9cb8bd9306a67f04295eb23f09574dad0e97f7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* tst_qimage: skip exifReadComments when the feature is not activeJanne Juntunen2022-08-081-0/+3
| | | | | | | | | | We need to skip the exifReadComments test case if reading text from image has been configured off, like in webOS's Yocto recipe for QtBase. Fixes: QTBUG-105393 Pick-to: 6.4 Change-Id: If45872ca7ed26620fa38bc6b47132363d661acdc Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Don't skip QDoubleConverter's digit-count check for non-whole boundEdward Welbourne2022-08-081-0/+1
| | | | | | | | | | | | | | | | Using convertDoubleTo() to get a whole number, from which to determine the number of digits we're allowed before the fractional part, fails if the double isn't a whole number, which lead to the skip being checked. Use qFloor() of the double (as this should have as many digits as the double had before its decimal point, which is what we care about; qCeil() might round up to a power of ten). This amends commit ff6d2cb0d5779d81e89d94d65c8d164602fa2567 Fixes: QTBUG-105341 Pick-to: 6.4 6.3 6.2 Change-Id: I4e0105d4602682c59e9830ec9a37556c96db884e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qputenv: port to QByteArrayViewMarc Mutz2022-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | The vast majority of in-tree users pass simple and short C string literals as the value. By porting to QByteArrayView, we document that we'll accept non-NUL-terminated data, and do the NUL-termination internally, using SSO'ed std::string, saving memory allocations in the common case of short strings. I didn't bother to check which direction std::string takes for nullptrs these days (there was a change accepted in that area for C++20 or 23), so play it safe and protect against them. Follow-up to Task-number: QTBUG-105302 Change-Id: I2369acc62f1d5cbc26135396cfe0602d8c75300c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add license headers to cmake filesLucie Gérard2022-08-03124-0/+372
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* rhi: gl: Avoid magic adjustments to the context/window formatLaszlo Agocs2022-08-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...by removing the entire adjustedFormat() helper. Qt Quick has never used this, which indicates it is not that useful. Same goes for Qt Multimedia or Qt 3D. Ensuring depth and stencil is requested is already solved by using QSurfaceFormat::setDefaultFormat() or by adjusting the formats everywhere as appropriate. The helper function's usages are in the manual tests that use it as a shortcut, and in the GL backend itself. Remove it and leave it up the client to set the depth or stencil buffer size, typically in the global default surface format. (which in fact many of the mentioned manual tests already did, so some of calls to window->setFormat(adjustedFormat()) were completely unnecessary) By not having the built-in magic that tries to always force depth and stencil, we avoid problems that arise then the helper cannot be easily invoked (thinking of widgets and backingstores), and so one ends up with unexpected stencil (or depth) in the context (where the GL backend auto-adjusts), but not in the window (which is not under QRhi's control). It was in practice possible to trigger EGL_BAD_MATCH failures with the new rhi-based widget composition on EGL-based systems. For example, if an application with a QOpenGLWidget did not set both depth and stencil (but only one, or none), it ended up failing due to the context - surface EGLConfig mismatches. On other platforms this matters less due to less strict config/pixelformat management. Pick-to: 6.4 Change-Id: I28ae2de163de63ee91bee3ceae08b58e106e1380 Fixes: QTBUG-104951 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* CMake: Remove unnecessary INCLUDE_DIRECTORIES . in testsAlexandru Croitor2022-07-281-1/+0
| | | | | Change-Id: Iafc4f9fcc2a68d299d6d3f255bbcaf90acd0399b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-28111-131/+131
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QMetaType: don't record trivial construction function pointersThiago Macieira2022-07-271-6/+61
| | | | | | | | | | | | We can implement the trivial {default,copy,move} construction outselves inside qmetatype.cpp and qvariant.cpp, simplifying the QMetaType interface object, removing up to three relocations per QMTI. This adds the testing for QMetaType::isXxxConstructible and isDestructible that couldn't be added before. Change-Id: Ic44396b31ba04712aab3fffd16ff0a28f541d507 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QMetaType: merge flags and flagsStaticlessThiago Macieira2022-07-261-1/+10
| | | | | | | | | And rewrite them with templates. QMetaType::typeFlags() simply calls flags() anyway. Pick-to: 6.3 6.4 Change-Id: I3859764fed084846bcb0fffd170323f9d8c80466 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix test being flaky on LinuxDimitrios Apostolou2022-07-262-7/+1
| | | | | | | | | | | | The cause is that the first EXPOSE event comes with the window not having focus yet. See QTBUG-105177. Also remove processEvents() as events are always processed when doing qWaitFor...(). Task-number: QTBUG-105177 Change-Id: I2260d1885388bbf7091c423bc9b4c16e2ed0090f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Test fails always on Android, so skip itDimitrios Apostolou2022-07-261-0/+3
| | | | | | | | | Previously the failure was been ignored because of the very generic "linux" entry in the BLACKLIST file Task-number: QTBUG-105201 Change-Id: I6914fe350f78266fc18541eb8fcd881f5a4ac511 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Test is no longer flakyDimitrios Apostolou2022-07-261-4/+0
| | | | | | | | | | + I could not reproduce the flakiness on OpenSUSE Tumbleweed. + No significant flakiness can be seen for this test in our testresults statistics. + Ubuntu-16.04 is no longer part of our CI Change-Id: I7a18fc3fe2e58af8533171ebae0457b08424e810 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Ensure list has elements before getting themDimitrios Apostolou2022-07-221-6/+9
| | | | | | | | | | | | | | | | | Before a recent fix it would happen occasionally that lastNormalizedPositions.at(0) would segfault because the list was empty. The cause of the flakiness was fixed, but make the test more resilient anyway by checking first the list is correctly populated. Furthermore on some platforms this check fails: qAbs(leftWidget.lastNormalizedPositions.at(1).x() - 0.8) < 0.05 So instead of QVERIFY use QCOMPARE_LT to print the values when it fails. Task-number: QTBUG-104268 Change-Id: Id5430eb53c133cf5d23647cfd9749f01f266efce Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix test flaky-crashing on OpenSUSE with KDE window managerDimitrios Apostolou2022-07-221-1/+1
| | | | | | | | | | | | | Sometimes XCB_EXPOSE event is being propagated twice, once before and once after qWaitForWindowExposed(). But the window has focus only after the second expose event. Changing it to qWaitForWindowActive() fixes the issue. Fixes: QTBUG-104268 Pick-to: 6.2 6.3 6.4 Change-Id: Ibc78dd4958ed1a4a8d0967b29d2a53457ab9ae8b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Do not use QTextFormat::FontFamily when building with ↵Ivan Solovev2022-07-211-5/+5
| | | | | | | | | | | | | | | | | | QT_DISABLE_DEPRECATED_BEFORE >= 0x060000 The QTextFormat::FontFamily enum is deprecated since Qt 6.0, however it is still used in the code. To retain backward compatibility with the old data stream formats, we introduce a new internal QTextFormat::OldFontFamily enum value, which has exactly the same value as QTextFormat::FontFamily, and use it instead. Task-number: QTBUG-104857 Pick-to: 6.4 6.3 6.2 Change-Id: Ibf5258b621c2b0aa507005dfe2c1e80c26ddb0d4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QGuiApplication: do not emit deprecated signalsIvan Solovev2022-07-211-0/+9
| | | | | | | | | | | | | | ... when QT_DISABLE_DEPRECATED_BEFORE is past the deprecation version. This commit actually stops using the deprecated signals when we build Qt with QT_DISABLE_DEPRECATED_BEFORE >= 0x060000. Otherwise we will get a compilation error because the signals will be removed. Task-number: QTBUG-104857 Pick-to: 6.4 6.3 6.2 Change-Id: Ie513ecc9451bf2d88f80857cf19f3d2b4958d022 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* CMake: Rename test to tst_gui_variant_no_applicationAlexandru Croitor2022-07-201-1/+1
| | | | | | | | Coin test collector expects tests to start with the tst_ prefix. Pick-to: 6.2 6.3 6.4 Change-Id: I5cd49bf75fddc121fdfbde80d8a24a6110098011 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QOpenGLBuffer: add move-SMFs and swap()sMarc Mutz2022-07-201-0/+7
| | | | | | | | | | | | | | | | | | - add move special member functions (docs copied from QHostInfo) - add member swap - use move-and-swap, not pure-swap, because these objects hold resources (handles) other than just memory - Q_DECLARE_SHARED (it's not implicitly shared, but explicitly) - adds ADL swap and Q_DECLARE_TYPEINFO [ChangeLog][QtOpenGL][QOpenGLBuffer] Added member-swap(), move constructor, move assignment operator. Change-Id: I22dc92108bdd393fff4361db23e94eaf3d7ea9cc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QPalette: detach before modifying resolve mask when resolvingVolker Hilsheimer2022-07-151-0/+7
| | | | | | | | | | | | Amends 1d961491d817490da156769ddce6fce48a0bce4a. We modify the resolve mask after making a shared copy of 'other', so we must detach. Call the setter designed for that purpose. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-98762 Change-Id: I4f45223e74764a341378992172787fae73efb8b7 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Relayout QStaticText when dpi changesEskil Abrahamsen Blomfeldt2022-07-141-25/+2
| | | | | | | | | | | | | | | | | If the cached font has a different DPI than the one used in QPainter, we need to treat this the same as if other font properties have changed and redo the layout. This happened when running the QStaticText test on Wayland, because the default dpi was 100 and the QPixmap we ended up drawing to was 96. This caused the pixel size of the font to be calculated differently when doing drawText() (using 96 dpi) and drawStaticText() (using the cached 100 dpi). Pick-to: 6.4 Fixes: QTBUG-100982 Change-Id: Ie4270341bb8a64b6458eb67ba460a282c65dc26b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Do not use QExposedEvent::region() in internal codeIvan Solovev2022-07-132-27/+1
| | | | | | | Task-number: QTBUG-104857 Pick-to: 6.4 6.3 6.2 Change-Id: I5ee41802ecc4d6291aaaa1f0efddd20027c1c1e4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* rhi: Clean up some inconsistenciesLaszlo Agocs2022-07-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the offsets are already quint32 in the API (vertex input attributes, dynamic offsets, offsets in draw calls), matching the reality of the underlying 3D APIs, but many buffer-related functions use int as of now, simply because that used to be the default choice, and the same goes for sizes (such as buffer or range sizes). This is not quite consistent and should be cleaned up if for nothing else then just to make the classes consistent, but also because no 3D API use a signed type for offsets, sizes, and strides. (except OpenGL for some) When it comes to strides (for vertex inputs and raw image texture uploads), those are already all quint32s. This is straightforward because most of the 3D APIs use 32-bit uints for these regardless of the architecture. Sizes and offsets are often architecture-dependent (Vulkan, Metal), but there is at least one API where they are always 32-bit even on 64-bit Windows (UINT == unsigned int, D3D11). In addition, we do not really care about buffer or texture data larger than 4 GB, at least not without realistic use cases and real world testing, which are quite unlikely to materialize for now (esp. since we still have the width/height of 2D textures limited to 16 or 32K in many cases even on desktops, whereas 2GB+ buffers are not guaranteed in practice even when an API seemingly allows it). In any case, the important change here is the signed->unsigned switch. A number of casts can now be removed here and there in the backends, because the offsets and sizes are now unsigned as well, matching the underlying API reality. The size can be potentially increased later on with minimal effort, if that becomes necessary for some reason. Change-Id: I404dbc365ac397eaeeb3bd2da9ce7eb98916da5f Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Always update QPalette resolve mask, regardless of QBrush changeJiDe Zhang2022-07-081-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 56bd1b76d2e81c58a80bf6b5d74219c6b1ab8499 changed the update resolve mask behavior in QPalette to avoid detaching brush data when modifying the resolve mask if the brush value is not changed. But this behavior broke compatibility, it introduced unknown risks, and we cannot ensure that other code in Qt does not depend on the old behavior. We both need to ensure that we don't detach when the value is not changed, and ensure that the resolveMask is always updated regardless of whether the value changes, so we need to split them up and independently share the brush data. QFont will update its corresponding resolveMask even if the value has not changed, so it is better to correct this behavior so that QPalette and QFont are consistent. [ChangeLog][QtGui][QPalette] Always update resolve mask in QPalette::setBrush, even if the value of brush has not changed. Fixes: QTBUG-98762 Pick-to: 6.4 6.3 6.2 Change-Id: Ib845361b30f21c3d78c16ced923c1678b12e05ac Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Revert "Apply ScaleFactorRoundingPolicy to QT_SCREEN_SCALE_FACTORS"Morten Sørvig2022-07-071-14/+1
| | | | | | | | | | | | | Unblock the qtdeclarative dependency update. This behavior change is causing a regression for QQmlPreviewHandler's zoom feature. Back out of the change for now, until we can find a way to make both use cases work. This reverts commit 1c0a56a2f3300750978f2d6c703b2b917e03e718. Change-Id: I1b3d84504bbcb4f2b2250a20194fdaf4ab4fd97f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Revert "QFutureCallOutEvent: de-export again"Sona Kurazyan2022-07-061-7/+1
| | | | | | | | | | | | QFutureCallOutEvent is used externally, so it needs to be exported. This reverts commit 3141a13b2a5c3cf770e072e49d43c86f376688e5. Fixes: QTBUG-104732 Pick-to: 6.4 Change-Id: I82c9e7414192ee948f78259bd74a404691a7805a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Apply ScaleFactorRoundingPolicy to QT_SCREEN_SCALE_FACTORSMorten Sørvig2022-07-061-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QT_SCREEN_SCALE_FACTORS in many cases set on behalf of the user, instead of by the user, so we should make it less sharp and more in line with standard high-dpi configuration. Specifically, make it subject to the rounding policy set by QGuiApplication::setHighDpiScaleFactorRoundingPolicy(). This means that applications which support integer scale factors only will see integers only, also when QT_SCREEN_SCALE_FACTORS specifies a fractional factor. Users who want to override can set QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough to restore the default Qt rounding behavior. [ChangeLog][QtGui] The high-DPI scale factor rounding policy (settable with QGuiApplication::setHighDpiScaleFactorRoundingPolicy() or QT_SCALE_FACTOR_ROUNDING_POLICY) now applies to scale factors set with QT_SCREEN_SCALE_FACTORS. Pick-to: 6.4 Fixes: QTBUG-95930 Fixes: QTBUG-99546 Change-Id: Ibb0aa5cb9d3a356d33429d0efe69d984b2530728 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* High-dpi: Add test for setting the scale factor rounding policyMorten Sørvig2022-07-061-0/+56
| | | | | | | Test setting both via QGuiApplication property and environment. Change-Id: Iaccc920adb6294d610b02d4c844aa5b15eb7eecd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_qwindow: modify some abnormal touch testsTang Haixiang2022-07-051-39/+39
| | | | | | | | | | | | Under normal circumstances, when the second point is touched, the first point has not been released, and the message at this time should contain two touch points. We are simulating the case where the message is lost when the popup is closed by touch. Amends efc02f9cc301f98c77079adae026ffd07f50d5ab Pick-to: 6.4 6.3 6.2 Change-Id: Ic722e3dbd615c46076ede26611d0107501c5e274 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* rhi: Keep track of pipeline creation timesLaszlo Agocs2022-07-051-0/+34
| | | | | | | | | | | | | | | | | | | | | Make our QRhiMemAllocStats struct a bit more generic, drop the memory allocation part in the naming, and use the same getter and struct for reporting some important timings. (we are free to rename for now, there are no users in other modules yet) The time spent in graphics (or compute) pipeline creation has a special relevance in particular with the modern APIs (as it is the single biggest potentially time consuming blocking operation), but also highly interesting with others like D3D11 simply because that's where we do the expensive source-to-intermediate compilation is HLSL source is provided. In order to see the effects of the various caching mechanisms (of which there can be confusingly many, on multiple levels), the ability to see how much time we spent on pipeline creation e.g. until we render the first view of an application can be pretty essential. Task-number: QTBUG-103802 Change-Id: I85dd056a39db7e6b25fb1f9d02e4c94298d22b41 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Make it possible to query the backend name beforehandLaszlo Agocs2022-07-051-0/+1
| | | | | | | | | | | | | | | | The goal is to make it possible to implement QSGRhiSupport::backendName() in Qt Quick with just a single line: return QString::fromUtf8(QRhi::backendName(m_rhiBackend)); instead of duplicating the strings and the logic. Similarly, QBackingStoreRhiSupport can now drop its apiName() helper entirely. Change-Id: Ia8cbb1f1243539ed4d7a98e71dcc2ed56b017e40 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Avoid including qopenglfunctions header files if Qt is built with GLES2Alexey Edelev2022-06-281-1/+3
| | | | | Change-Id: I3a7a69f5eef604408713934811efb984e78d68dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Emit autolinks in QTextMarkdownWriterShawn Rutledge2022-06-242-2/+4
| | | | | | | | | | | | | | | | | | | 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. Pick-to: 6.4 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>
* unblacklist passing tests 2022Anna Wojciechowska2022-06-231-2/+0
| | | | | Change-Id: Ifb09a997d39fc2c92503e77cf372d443c13c4c2b Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* BLACKLIST tst_qfont for Ubuntu 22.04Heikki Halmet2022-06-201-0/+2
| | | | | | | Pick-to: 6.4 6.3 6.2 5.15 Task-number: QTBUG-84248 Change-Id: I2978cd2a6ed07bb6fc5769b174d0a897dfa3566d Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* BLACKLIST: tst_QGlyphRun::mixedScripts for Ubuntu 22.04Heikki Halmet2022-06-201-0/+1
| | | | | | | Pick-to: 6.4 6.3 6.2 5.15 Task-number: QTBUG-68860 Change-Id: I79c085c7321e0bee78e8cb31daa8c7992d3a3ec6 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Work around lavapipe bug in tst_qvulkanLaszlo Agocs2022-06-161-7/+9
| | | | | | | | | | | Work around https://gitlab.freedesktop.org/mesa/mesa/-/issues/5875 by treating the driver as broken when both the driver and device UUIDs are all zeroes. Fixes: QTBUG-104231 Pick-to: 6.4 6.3 6.2 Change-Id: Ibf7973361d472ebb1cb433bc61b50b2828f75c6b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix typos in docs and commentsKai Köhne2022-06-152-2/+2
| | | | | | | | | Found by codespell Pick-to: 6.4 Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use consistent ordering in QShaderLaszlo Agocs2022-06-141-0/+11
| | | | | | | Fixes: QTBUG-101923 Change-Id: I62df3eba773350e47ed650acb00bc42b3ce6a899 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Update window geometry when QWindow::m{in|ax}imumSize is updatedJan Arve Sæther2022-06-131-0/+11
| | | | | | | | | | | | | | | | | | | | More specifically, if either minimum or maximum size are updated, make sure that the current window geometry is updated so that it is within the minimum and maximum sizes. Previously, these constraints was only respected by the window manager when the user resized the window. For widgets this already worked, because a top-level widget will take care of respecting these constraints if they are changed. Since QWindow::setMinimumSize and QWindow::setMaximumSize started to share so many common things, a new function (setMinOrMaxSize_helper()) is added. Task-number: QTBUG-102771 Change-Id: Ia4b2680dcf865f84a3cf6424187f9a6036b76386 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use CSS classes on html list items for checkbox supportShawn Rutledge2022-06-112-14/+30
| | | | | | | | | | | | | | If we replace the bullet character with a UC checkbox character, it looks ok in a browser, and the HTML parser can recover the BlockMarker attribute from the css class. [ChangeLog][QtGui][Text] Checkbox list items can now be read and written in both HTML and Markdown, including conversions. Task-number: QTBUG-103714 Change-Id: Ic6b74512075cd4ac16d6f80fdf55b221447491a9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Do metadata detach simpler than full detachAllan Sandfeld Jensen2022-06-011-0/+20
| | | | | | | | | Avoid a full data detach when only metadata changes. This paradigm was already used one place, and made generic. Fixes: QTBUG-81674 Change-Id: I605253babc6ad9fc130e19e8cef3812690933ac5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add new map methods for QColorTransformAllan Sandfeld Jensen2022-05-311-0/+93
| | | | | Change-Id: I520fc4f4bd958472c6d6359bf671835796c677fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Test prepared qcolortransformAllan Sandfeld Jensen2022-05-312-17/+90
| | | | | | | | | | Add test of explicitly prepared qcolortransform, this is a state a transform can get into if used for an image transform. Also cleans up the test code. Change-Id: I9445ed114bed0edc790e14024aaae6a42989220b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QTextDocument: add setLayoutEnabled()David Faure2022-05-261-0/+21
| | | | | | | | | | | | This allows to set up everything first - without paying for the layout calculation at every step - and only then trigger the layout once. Results: 0.065 msecs to create a QGraphicsTextItem with some text (layouted) 0.036 msecs to set everything up in a QGraphicsTextItem with 0 width Change-Id: I138bd1d58941d029bc0a36d2730216778f1fbd97 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Expand QColorTransformAllan Sandfeld Jensen2022-05-261-17/+31
| | | | | | | | | | Add comparison operators and an isIdentity() method to detect (1-1) transforms. [ChangeLog][QtGui] Added QColorTransform::isIdentity() method. Added QImage::colorTransformed() transitive method. Change-Id: I5fbcd14e75f2179e43e94e8c5f42cd0a5600790b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add test of QColorTransformAllan Sandfeld Jensen2022-05-263-0/+237
| | | | | | | | | Before it was only tested indirectly as part of the qcolorspace tests. This also fixes a rounding for maximum RGB64 values. Pick-to: 6.3 Change-Id: I6106e662c0f9d00c0b3a0c13213cb051ea39e14e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QKeySequence: Add missing modifier namesLaszlo Papp2022-05-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is that when someone is trying to use the following code: QKeySequence keySequence(Qt::Key_Shift); qDebug() << keySequence.toString(); This will print seemingly gibberish output. It is unicode in practice. For Qt::Key_Shift, this would be: "�_@\uDC20" The reason why this is happening is because we have platform-specific ways to handle this due to Mac glyphs which are not available on Linux or Windows. This works fine on Mac. But for the Linux and Windows codepaths, there is not really any mapping like for other keys. It seems that modifiers were left out. The solution is to simply amend the list of mapping from these modifier key codes to raw strings for Linux and Windows like it is done for other key codes. So, now, modifiers will also be included in the list. So, the expected output will be generated for the above code, as: "Shift". [ChangeLog][QtGui][QKeySequence] Added missing modifier names Fixes: QTBUG-69715 Fixes: QTBUG-40030 Change-Id: I460d54bc8e593b350ff95894f23c5b4a7c819a44 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qpainter: change the FP exception block-list to a pass-listThiago Macieira2022-05-241-1/+8
| | | | | | | | | | | | | | | | We should prefer to test this unless we know it won't work, but this is very hardware and implementation-dependent anyway. So I declare that we'll only guarantee FP exception cleanliness on a best-effort basis for a few platforms. The notable difference in this commit is the removal of QNX. I don't know why it began producing an FP exception with one of my changes, but since the toolchain isn't public, I can't debug and will not devote any time to figuring it out. If users of QNX require this, then someone with interest in that OS will need to spend time after my changes integrate. Change-Id: Ibcde9b9795ad42ac9978fffd16f1cb9c03a0ff66 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* 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>