summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* vulkan: Try loading libvulkan.so.1 firstLaszlo Agocs2022-03-112-9/+35
| | | | | | | Change-Id: I876899fbfc126136f2842e9361e21ac10af8f14b Pick-to: 6.3 Fixes: QTBUG-101592 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix deprecated uses of QScopedPointerMårten Nordheim2022-03-0813-47/+66
| | | | | | | | | By changing it to unique_ptr. Pick-to: 6.2 6.3 Change-Id: I91abb69445b537d4c95983ae735341882352b29d Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QText*Format: future-proof by adding own QDataStream stream operatorsThiago Macieira2022-03-082-2/+62
| | | | | | | | | | | | | | These five classes add no members to QTextFormat, so their streaming must, by all means, be identical to QTextFormat. But should that change in the future, we don't want to accidentally slice the objects by calling the parent operators. Required by "Cause compilation errors if you forget to declare QDataStream operators" Pick-to: 6.3 Change-Id: Ic15405335d804bdea761fffd16d4a4193db28bc4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QColor: port string-parsing from out parameters to optional<>Marc Mutz2022-03-083-44/+37
| | | | | | | | | Makes for easier reading of code, and allows qt_get_hex_rgb(), which is called from different TUs, to be marked as PURE. Change-Id: Ie7d4e5a164ca1daf521e18ff47f17885bc1443c1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QColor: remove setColorFromString()Marc Mutz2022-03-082-31/+9
| | | | | | | | | | | | | | | | This private method doubled as the implementation of both fromString() and isValidColorName(). By reformulating isValidColorName() as fromString().isValid(), we can then turn setColorFromString() into fromString(), by returning the data, instead of setting it on *this through use of exported functions. Since we need to touch the if's anyway, to remove braces, use C++17 if-with-initializer to turn the second if into an else-of, saving one return {}. Change-Id: If3f8182a40c0c6d6ad514431b5870e69d0e95769 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Long live QColor::fromString()!Marc Mutz2022-03-082-10/+78
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* eglfs: QNX uses own QPA plugin and not eglfsPasi Petäjäjärvi2022-03-071-1/+1
| | | | | | | | | | | | | | | | Remove compilation workarounds to get rid of warnings as those QPA plugins are not supported by QNX. warning: cast from 'void*' to 'EGLNativeDisplayType' {aka 'int'} loses precision [-fpermissive] warning: invalid conversion from 'EGLNativeDisplayType' {aka 'int'} to 'void*' [-fpermissive] Pick-to: 6.2 6.3 Task-number: QTBUG-101382 Change-Id: I515708a8869498eb91df4fcba85a7b751d13a25c Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
* Miscellanea fixes for QT_TYPESAFE_FLAGS in our headersGiuseppe D'Angelo2022-03-076-29/+29
| | | | | | | | | | | | | | | | | | | | | In preparation for adding it to headersclean. Some remarks: * QStandardItemModel builds just fine (QFlags has comparison operators against literal zero); the warning we however get is about 0 converted to a null pointer constant. There's nothing we can do about that one (even <compare> gives such a warning). * Several code was depending on flags->int conversions. Add toInt(), but also cast again to the expected type to avoid warnings in case toInt() returns unsigned int. * Ported to explicit casts to bool rather than test(Any)Flag to minimize confusion for people unfamiliar with the test*Flag methods. Change-Id: I5be280ac33a0b38e2680096f0e79129fd55ba241 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix QWindow::mapTo|FromGlobal() for the embedded caseSergio Martins2022-03-041-2/+2
| | | | | | | | | | | | | The code didn't make much sense: - QHighDpi::fromNativeLocalPosition should not take global positions - QPlatformWindow::mapFromGlobal() should not take local positions Tested with a basic MFC window that has a QMainWindow as child (parented with QWinWidget from QtWinMigrate). Menus would be off when on a secondary screen with dpi factor > 1 Change-Id: Ib5cbf5d29ed97c786f7f7ba4e868b70cb5435239 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QBitmap::fromPixmap: document \sinceGiuseppe D'Angelo2022-03-041-0/+2
| | | | | | Change-Id: Ia8b4e20dc98e3b184b6e2ba9844907f813dbc1ab Pick-to: 6.2 6.3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix off-by-one for "typically" lowest value INT_MINClemens Werther2022-03-031-2/+2
| | | | | | Pick-to: 6.3 6.2 5.15 Change-Id: I0e1115dc21e700dc79fb54be953573c75b41e70f Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix Q_FLAG declaration over enumerationsGiuseppe D'Angelo2022-03-021-1/+1
| | | | | | | | | | One should use Q_ENUM, not Q_FLAG, to mark an enumeration. Q_FLAG should go on the respective flag type. Change-Id: I16cd5c0d405c3db1951569b72805fdae18898c45 Pick-to: 5.15 6.2 6.3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix painting clipping glitches with fractional scalingEirik Aavitsland2022-03-024-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QTextFormat: remove unnecessary namespace-scope stream op declarationsThiago Macieira2022-02-241-10/+0
| | | | | | | | These two pairs already exist as hidden friends inside the two classes. Pick-to: 6.3 Change-Id: Ic15405335d804bdea761fffd16d4a3bc633e6d53 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Make sure all qtbase private headers include at least one otherThiago Macieira2022-02-2432-22/+52
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QGuiApplication: use translation-based layout direction unless explicitly setVolker Hilsheimer2022-02-241-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Make QGuiApplicationPrivate::lastCursorPosition.toPoint() safe to useShawn Rutledge2022-02-222-3/+25
| | | | | | | | | | | | | | | | | | | QGuiApplicationPrivate::lastCursorPosition is initialized with qInf(); so before Qt has seen a mouse move event, attempting to convert to QPoint is an error. It's best to have one place where we do the qIsInf() check rather than several (and otherwise prefer using the QPointF as-is rather than converting to QPoint at all). Introduce a helper class that contains a QPointF, and provides a safe conversion to QPoint, as well as simple accessors for clients using QPointF. Fixes: QTBUG-52472 Task-number: QTBUG-45045 Change-Id: I83fad1bfb658e03fa876344552f1d5bb751d9f81 Pick-to: 6.2 6.3 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Install 3rdparty headers for static buildsMichal Klocek2022-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | For static builds we need 3rdparty headers to be installed. Leaf modules like qtwebengine needs 3rdparty libs and header for zlib, freetype, harfbuzz, png, jpeg. Without those the Chromium bundled versions are used, however it might end up badly if qt has already bundled one. Introduce new header only modules with additional arguments for qt_internal_add_module: * EXTERNAL_HEADERS to pick exactly which headers are public * EXTERNAL_HEADERS_DIR to include whole directory preserving the files directory structure Fix qtsync so it keep directory structure for all non-qt modules when syncing headers and do not generate warnings for headers files. Task-number: QTBUG-87154 Task-number: QTBUG-88614 Change-Id: If1c27bf8608791cd4e0a21839d6316a445a96e9f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QDesktopServices: make QOpenUrlHandlerRegistry a non-QObjectMarc Mutz2022-02-181-7/+5
| | | | | | | | | | | | | | | | | | It seems to have been a QObject solely for its single slot. But since Qt 5, slots need no longer be defined on QObjects, so we can remove the inheritance from QObject now. We still need a QObject as the context object in connect(), but that can be just be an aggregated naked QObject. Saves 26 relocations, ~1.5KiB in TEXT and ~0.3KiB in DATA on optimized GCC 11.2 Linux AMD64 C++20 builds. Pick-to: 6.3 6.2 Change-Id: Ic45a8e892ec2bd5de5de8fbd32ec7a167c501803 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QColor: avoid Unicode table lookups in fromString()Marc Mutz2022-02-181-4/+15
| | | | | | | | | | | | | | All color names supported by QColor are US-ASCII. Enforce this with a static_assert, then use this fact to perform the case-folding of the input in US-ASCII instead of Unicode. Avoids lookups in the Unicode tables. Add QtMiscUtils::toAsciiLower() to foster sharing. Change-Id: Ie0e123405d772943313dc4be1808667b152770b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QColor: port parsing to QAnyStringViewMarc Mutz2022-02-182-26/+24
| | | | | | | | | | | | The private setColorFromString() function was never called from inline code in Qt 6 (didn't check Qt 5, which doesn't matter for BC purposes). This is in preparation of adding a QColor::fromString(QAnyStringView). Change-Id: I265d7c388370e2e7bb417db1573658346aad4690 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QGnomeTheme: remove unneeded Q_DNoah Davis2022-02-171-1/+0
| | | | | | Change-Id: I3fcb1de9487bfdfab16bae5603fed09ef72e01ba Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Respect AT_SPI_BUS_ADDRESS env var on LinuxPatrick Griffis2022-02-171-0/+8
| | | | | | Change-Id: Ic277b5ebe2d752360cebdb2ff728ca219f9d7124 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
* QGnomeTheme: Allow Space, Return, Enter and Select to press buttonsNoah Davis2022-02-161-0/+4
| | | | | | | | | | GTK buttons can be pressed with Space, Return and Enter, so this should be considered native behavior for GTK based desktop environments. Qt::Key_Select is also included here because QAbstractButton has been pressable with Qt::Key_Select for a long time. Change-Id: I2c279ad05d1a10e5968a18996b8b40a83d2251fa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add missing dependency to the qvkgen tool when generating vulkan codeAlexey Edelev2022-02-161-2/+6
| | | | | | | Pick-to: 6.3 6.2 Fixes: QTBUG-100574 Change-Id: Ib68a3d77e5d3c9a9fc541a69a2748b94ade3ceef Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QPA: add ButtonPressKeys ThemeHintNoah Davis2022-02-162-0/+5
| | | | | | | | | | | | Platforms should allow more than just Qt::Key_Space and Qt::Key_Select to press buttons. KDE Plasma developers want to be able to press buttons with Return/Enter. GTK allows buttons to be pressed with Return/Enter, so this should be considered the native behavior for GNOME as well. Adding this ThemeHint allows customizing the keys that can press a button via a QPlatformTheme subclass. Change-Id: I73284e9b73590fbdd0b94a0cb4557e94b3722af9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QColor: eradicate QT_STRINGVIEW_LEVELMarc Mutz2022-02-162-12/+0
| | | | | | | | | It's not used and not useful. Task-number: QTBUG-100861 Pick-to: 6.3 6.2 Change-Id: I30f7f41311182f056f2f6d5a9b49385fb09d194e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Convert Vulkan instance setup from Qt Quick into a Gui helperLaszlo Agocs2022-02-155-1/+211
| | | | | | | | | Make it possible to reuse what's in QSGRhiSupport from other modules as well. Both Gui (texture-based widget/backingstore composition) and Multimedia are potential users of this in the future. Change-Id: I1b50cc5efd6811e9bc95f6287b9576931d4bcc44 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* QDesktopServices: deprecate destroying URL handlers w/o explicit ↵Marc Mutz2022-02-151-0/+18
| | | | | | | | | | | | | | | | | | | 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>
* Update docs for QSurface::MetalSurface to include iOSTor Arne Vestbø2022-02-151-3/+3
| | | | | | Pick-to: 6.3 6.2 Change-Id: I67fc47b3dc33960e7dfa78890d16d1e7450e30ab Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QBitmap: de-inline dtorMarc Mutz2022-02-152-0/+7
| | | | | | | | | | | | | The destructor of this polymorphic class was incorrectly marked for removal in Qt 6, and, unfortunately, that was carried out. Now it delivers one of the most-duplicated vtables across all of Qt (at least four duplicates), and we can never add anything to it until Qt 7 (because existing code de-virtualized it as a no-op). Task-number: QTBUG-45582 Pick-to: 6.3 Change-Id: I85bd3b13dca9f1fc8cb62ca079a1168a33f71323 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* De-duplicate vtables, 2022 editionMarc Mutz2022-02-158-0/+24
| | | | | | | | | | | | | | | | | | | This de-inlines destuctors of classes whose vtables are proven to be duplicated even within the set of Qt libraries. Since these are all private API classes, we can pick all the way back to 6.2, and we don't need the comment that the dtor must always stay empty, like for public classes. As a drive-by, also de-inline the QPaintDeviceWindowPrivate ctor. That's just code hygiene, it doesn't partake in vtable duplicating. Pick-to: 6.3 6.2 Task-number: QTBUG-45582 Change-Id: I3477063d6f42edc9a5d352c47900366fd50c3ef6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix integer overflow for broken QPainterPathsEskil Abrahamsen Blomfeldt2022-02-141-1/+1
| | | | | | | | | | | | | With some bogus input, we can end up with NaN in the bounding rects of the control points. This in turn causes problems later when it is converted to ints and used in code. To avoid it, we exit early if the rect is invalid (negative or NaN size). Pick-to: 5.15 6.2 6.3 Fixes: QTBUG-100217 Change-Id: Idbc6700b85cb30198d69fedbf8f3be3e1ab65e40 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Core: Remove 'properties' featureKai Köhne2022-02-142-3/+0
| | | | | | | | | | | | | Even QtCore alone cannot be built without the properties feature since Qt 5.5. While fixing this is easy, other modules like dbus, networking are also using QObject::property() and friends liberally. All in all I doubt that anybody will miss the feature (otherwise it would have been fixed in the last decade). Change-Id: Iaf3cc20bda54ee2ff3b809fac8fa82b94ecc88c0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QPkmHandler: make const what it never modifiedMarc Mutz2022-02-121-1/+1
| | | | | | Pick-to: 6.3 6.2 5.15 Change-Id: I0bda0d93ebe60d4923f3e9eb059cddb61192b1b5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDesktopServices: fix ABA problem in QOpenUrlHandlerRegistryMarc Mutz2022-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The registry is designed to be thread-safe, as is openUrl(), and handlers are required to be thread-safe, too: "the handler will always be called from within the same thread that calls QDesktopServices::openUrl()". The handlerDestroyed() slot was invoked using AutoConnection semantics, which, if the registry and the handler happen to not be on the same thread, is QueuedConnection, which means there's a window in which the handler is destroyed, but it's still listed in the registry, and a call to openUrl() may make a call to the (deleted) handler. Worse, if a handler is deleted and new one registered they may end up on the same address (ABA, or rather, AA problem), and then the delayed call to handlerDestroyed() may remove the entries to the new handler, as well as those to the old. Fix by using Qt::DirectConnection. This fixes the ABA problem, but doesn't completely fix the partially-destroyed problem, since QObject::destroyed() is simply too late. We need to require explicit unsetUrlHandler() calls, which should happen before destruction of the handler object starts. [ChangeLog][QtGui][QDesktopServices] Fixed a bug where destroying and re-creating a handler object in quick succession could cause the registration for the handler to be lost. Fixes: QTBUG-100778 Pick-to: 6.3 6.2 5.15 Change-Id: I76fd81724504cc7f38ac262b43e3e9539fe5ebca Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDesktopServices: fix UB (data race on handlers)Marc Mutz2022-02-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The handlerDestroyed() function is connected to the handler QObject's destroyed() signal and removes all entries from the registry for which the destroyed object was listed as the handler. While handlerDestroyed() is always executed in the context of the thread owning QOpenUrlHandlerRegistry-as-a-QObject, the documentation explicitly states that "the handler will always be called from within the same thread that calls QDesktopServices::openUrl()", implying that calling openUrl() from a non-GUI thread is supported. The presence of the mutex also indicates that this should work. But then the unprotected access to the handlers variable in handlerDestroyed() is a data race, because nothing prevents a handler object from being destroyed concurrent to an openUrl() call. Fix by locking the mutex. Fixes: QTBUG-100777 Pick-to: 6.3 6.2 5.15 Change-Id: I9ef857efa609b4d16ee21063ccccd316e119576b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make indicator-application hack work in flatpakIlya Fedin2022-02-121-1/+6
| | | | | | | | | | | | | | | Flatpak doesn't share $XDG_RUNTIME_DIR with the host making QSystemTrayIcon not to work on Xubuntu/Ubuntu MATE/Ubuntu Budgie. Although, it shares a subfolder, according to https://docs.flatpak.org/en/latest/sandbox-permissions.html Amends 0baa26638d7d14b6609dab191c4ea0cc1d3ff50a Pick-to: 6.3 6.2 5.15 Change-Id: I2d0043fc5a4c2c51e8fa1a920f3cada3b07eba6d Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
* Remove documentation of non-existing QAccessible stateAllan Sandfeld Jensen2022-02-111-1/+0
| | | | | | | | invalidEntry is commented out Pick-to: 6.3 6.2 5.15 Change-Id: Iffb661ec85b1b633f56c9aba94c1f0727a93c987 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: improve qstdweb::EventCallbackMorten Johan Sørvig2022-02-111-1/+1
| | | | | | | | | | | | | We are storing a copy of the this pointer in the constructor, and later deference it to access EventCallback object memebers. This makes the class noncopyable: delete the copy constructor to make sure it isn’t. Also change the callback API to propagate the event to the event callback. Change-Id: Ida4bb192b3e905b260ebeec30293aad71b7d8c49 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix compiling with C++20 on macOSAllan Sandfeld Jensen2022-02-101-6/+6
| | | | | | | | | | | This code triggers warnings about mixing enums of different types, which breaks compiling with warnings-are-errors. 'bitwise operation between different enumeration types is deprecated' Pick-to: 6.3 6.2 Change-Id: Ib6c19f02f7c7593c9e22da5e648ea1f2f2ae757b Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QPageSize: pack StandardPageSize structMarc Mutz2022-02-101-5/+6
| | | | | | | | | | | | | | | | | | | | On most platforms, the old struct had a padding hole before the FP members, as well as after the character array. By packing the integer members into bit fields, we compress five ints incl. the padding hole (24 bytes) into 64 bits w/o padding (8 bytes). The size of the struct shrinks from 80 to 64 bytes, saving almost 2KiB in TEXT size. Four bytes of tail padding remain, and are available to grow the character array in the future. More compactification could be had by changing the FP members (either by turning them into floats and/or by making them a union over {mm, in}, because one can be calculated from the other), but these are for another patch, because they change return values. Pick-to: 6.3 6.2 Change-Id: I0e7f354a0341e94e9a9401a7d3b4529a8ff20a3d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't replace IntersectClip with ReplaceClip on a QPictureChunLin Wang2022-02-101-2/+3
| | | | | | | | | | QPainter should not try to be smart and optimize IntersectClip with ReplaceClip when working on a QPicture paint device. Doing so will change the end result as the actually state when replayed might be different from the one it was recorded in. QPainter will no longer try to replace IntersectClip with ReplaceClip if the paint engine is a QPicture.Consistent with QPainter::setClipRect and QPainter::setClipRegion. Fixes: QTBUG-100420 Pick-to: 6.2 6.3 Change-Id: I1e0ebbc2d6e1ffd98b9f3f537e83893579606a4b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Convert string tables in QShaderDescription to use string literals [2/2]Marc Mutz2022-02-091-79/+81
| | | | | | | | | | | Avoid allocating all these strings on load. Part 2: JSON keys. Pick-to: 6.3 6.2 Change-Id: I1724a58d700509c3af90ad1b87cb1bccae1075b8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* QPageSize: remove 119 relocationsMarc Mutz2022-02-091-1/+1
| | | | | | | | | Also saves ~1.4KiB in combined TEXT and DATA size on optimized Linux GCC 11 C++20 AMD64 builds. Pick-to: 6.3 6.2 Change-Id: I53922ccd191e412a13e3e23f2e26fdb3bf43af33 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid file-static initialization of symbols that need @availability checkTor Arne Vestbø2022-02-091-26/+27
| | | | | | | | | | Fixes crash in key mapper on iOS < 13.4, where the symbols are not available. Pick-to: 6.2 6.3 Fixes: QTBUG-100518 Change-Id: I9bb1a75b17e5f0f50205b757fdb673218d7fb5e0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* qaccessible: Split QAccessible into own headerFabian Kosmale2022-02-094-384/+457
| | | | | | | | | | | | | | | | | | | | qaccessible.h includes quite a few heavy headers. While QAccessibleEvent and QAccessible can be forward declared, the enums in QAccessible cannot. By moving QAccessible into its own lightweight header, we can significantly reduce the cost of using the enums. qaccessible.h still includes qaccessible_base.h, and the syncqt rules are adjusted to ensure that this changes is source compatible. Additionally, we no longer include cstdlib, as we only need cstring. [ChangeLog][Potentially Source-Incompatible Changes] <QAccessible> no longer includes <stdlib.h>. This might break code that relied on transitive includes. Task-number: QTBUG-97601 Change-Id: I15fbd9c85f5746885f9e89eabfc6d07b9bb1f968 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix accuracy with screen compositionAllan Sandfeld Jensen2022-02-091-4/+4
| | | | | | | | | | | | It was using a faster divide by 256 instead of an accurate divide by 255. This meant black screen wasn't a null operation as it should be. This also fixes alpha mixing for a few other compositions. Pick-to: 6.3 6.2 5.15 Fixes: QTBUG-100327 Change-Id: I149ad39147176e00ce753979d55dc8633704dc1a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix regression when displaying emojis on WindowsEskil Abrahamsen Blomfeldt2022-02-091-1/+1
| | | | | | | | | This amends b0e8ba783b6c6225fcedf5130726ee43f8ce1aa4. A copy-paste error accidentally broke emojis on Windows. Change-Id: I758572604370d170b8effd6c0ff97e09489fafa4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Doc: Fix minor grammar issues in qtgui landing pageAndreas Eliasson2022-02-091-16/+15
| | | | | | | Task-number: QTBUG-100369 Pick-to: 6.3 Change-Id: I89497facbb33c4a47420a1ba0dd61f51ab407a77 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>