summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* coretext: Support variable application fontsEskil Abrahamsen Blomfeldt11 hours2-6/+19
| | | | | | | | | | | | | | | | | | | | | | | Named instances of variable application fonts are exposed automatically through CTFontManagerCreateFontDescriptorsFromData() (and also for the URL equivalent). The main change here is just to call this instead of the overload which only returns the first font. Note that this also updates the test: This is because the conversion from CoreText normalized weight values to TTF values is not 100%. In the CoreText code, we map Heavy (0.56) to ExtraBold, but ExtraBold gets converted to 0.6, which is closer to the CoreText value for Black (0.62). To avoid hitting this inconsistency, the QtExtraBold has been changed to Black weight instead, which resolves to the same on all platforms. Task-number: QTBUG-108624 Change-Id: Ied6d42e9e3e1ba8b7102936c5be3d285b3d9e07f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Doc: Fix QIcon documentationTopi Reinio31 hours2-18/+20
| | | | | | | | | | | * Move \externalpage topics to external-resources.qdoc, as that command cannot be embedded in other topics. * Fix references to non-existent function fallbackIconTheme(). Pick-to: 6.6 Change-Id: I5d08206c53aea9c2d4c6fddf5d04df187b01ef53 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QKeyMapper::possibleKeys's event argument constTor Arne Vestbø32 hours2-2/+2
| | | | | | | To match the QPA layer (QPlatformIntegration, QPlatformKeyMapper). Change-Id: If1b4817eb334c6cdf1ccd587794701245076bd2f Reviewed-by: Liang Qi <liang.qi@qt.io>
* Support variable applications fonts with DirectWriteEskil Abrahamsen Blomfeldt36 hours14-112/+204
| | | | | | | | | | | | | | | | For GDI, there doesn't seem to be any way to do this, so it depends on selecting the DirectWrite font database explicitly. This moves the supportsVariableApplicationFonts() check into the QPlatformFontDatabase instead of the font engine, since that's where it belongs. [ChangeLog][Fonts] Added support for selecting named instances in variable application fonts when using the DirectWrite backend. Task-number: QTBUG-108624 Change-Id: I51e0fedd7a9616088a06453a1d17f48bd18fa5a7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* DirectWrite: Fetch correct style name in font infoEskil Abrahamsen Blomfeldt36 hours2-1/+22
| | | | | | | | | When getting the font info for a resolved QFont on DirectWrite, the style name would not be set, so there would be no way to check the style name of the actual resolved font. Change-Id: I5ff27e95619a330b7d2a0252222fad8629837418 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Support more verbose debug output for QKeyEventTor Arne Vestbø36 hours1-0/+4
| | | | | | | Sometimes it's useful to know the scan code and virtual key as well. Change-Id: Ic120189470a9ff44a5cb7f6dcc1405654136424f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add catch-all DPR update to expose event handlingMorten Sørvig39 hours3-3/+13
| | | | | | | | | | | | | | The platform plugin should already DPR (or DPI) change events, however if that does not happen we update in the expose event as well as a last resort to make sure the window's DPR value is in sync. Also print a warning and ask for a bug report. Pick-to: 6.6 6.0 Change-Id: Ibb144f163281a28216c2fa3353ed50237e91ce25 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Remove QKeyMapper::changeKeyboard()Tor Arne Vestbø4 days2-16/+0
| | | | | | | | | | | | | | | | | | | As described in QTBUG-27681, we no longer send KeyboardLayoutChange events in Qt 5 and up. We have QInputMethod::localeChanged, but that doesn't cover the cases where the input language stays the same, but the layout is changed. None of our widgets react to KeyboardLayoutChange these days, but ideally we should send KeyboardLayoutChange if we can plumb it from the platforms. However that plumbing wouldn't live in QKeyMapper, and having it around as dead code doesn't help, so remove it for now, and track the work to implement it in QTBUG-27681. Task-number: QTBUG-27681 Change-Id: I480590550f3bc741b829fb30aa85393b07d5c16f Reviewed-by: Liang Qi <liang.qi@qt.io>
* Remove QKeyMapperPrivateTor Arne Vestbø4 days3-38/+3
| | | | | | | | | | | | | | | | | | | There is no point in maintaining the keyboardInputLocale and keyboardInputDirection in the QKeyMapperPrivate, as these things are handled by QInputContext nowadays. The values were never updated either, so the base class implementation of QPlatformInputContext referring to them was confusing. With those gone, we can remove the entire class. Subclasses of QPlatformInputContext typically only override locale(), so we now base the input language direction on the current locale(), giving dynamic updates of the direction as well (without the signal, but this will be fixed in a follow up patch). Change-Id: I16ae4097eadadd278e60edea3c1101ab90ed7444 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Doc: Fix QRgbaFloat function signaturesTopi Reinio4 days1-4/+4
| | | | | | | | | Commit baac34de modified the set[Red|Green|Blue|Alpha] function signatures. Amend the \fn commands to reflect those changes. Pick-to: 6.6 Change-Id: I947995fc5c80baac111a04272cd848961c22eb73 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* revert "xkbcommon: make shortcuts persistent across layouts"Tor Arne Vestbø5 days1-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5e76a9569e37e6620a7ddf3a9d9620fbb9b9d04f. The change's stated goal was to make shortcuts "stable", i.e. work the same, regardless of which keyboard layout the user has selected. In doing so, it changed the semantics of shortcut handling to depend on the order of the keyboard layouts reflected by XKB, picking the first Latin layout in the list, instead of prioritizing the currently selected/active keyboard layout. This change in semantics is a major behavior change, and breaks common and valid setups such as having [en,fr] or [en,de] layouts. For example, the French layout uses an AZERTY layout, where the Q and A keys are switched compared to QWERTY. With the change in place, pressing the physical A key on a French keyboard, with Control pressed, no longer selects all text, but instead quits the application, as the shortcut is interpreted based on the English layout, which just happens to be first in the list. Similar issues exist for German layouts, which use QWERTZ, or more complex layouts such as the Neo layout. The semantics of prioritizing the order of declared layouts instead of the active one is inconsistent with both macOS and Windows, as well as other toolkits on Linux, including GTK and earlier versions of Qt. It's also not discoverable by the user that the order now matters. For example, there is no UX in the Gnome setting that tells the user to ensure the order matches their expectations for shortcut handling. And if there was, this would only apply to Qt apps built with 6.6.0, creating inconsistent behavior for users. Worse, the X server is limited to four concurrent keyboard layouts (groups), so if the user adds more layouts than that, Gnome will replace the X server's view of layouts only when switching to a layout beyond the first four. And in that case, the X server's view of the layouts is actually starting with the fifth layout declared in the Gnome preferences. The logic in the reverted patch does not take this into account, making it confusing for the user which layout actually takes precedence. Note that reverting this change does not affect our fallback logic for layouts that do not produce Latin symbols for the given key press, such as Greek or Russian. Those layouts will continue to fall back to a Latin layout for their QKeyEvent::key(). [ChangeLog][QtGui][X11/Wayland] A change in 6.6.0 that resulted in keyboard shortcuts not respecting the user's active layout has been reverted. Pick-to: 6.6 Task-number: QTBUG-108761 Change-Id: Iec2897cd1541c0c125cc5b1078d0beec12b501c0 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Avoid crash when keysymToQtKey(keysym, Qt::ControlModifier) is calledAlexander Volkov5 days1-0/+2
| | | | | | | | For example when Ctrl+Home is sent by virtual keyboard on Wayland. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I41f1d2a28c9091efa621d5826a3b9e3e0e481ceb Reviewed-by: Liang Qi <liang.qi@qt.io>
* QPen: port to QESDPGiuseppe D'Angelo7 days3-89/+64
| | | | | | | | | | | | | | Move from a manually managed d-pointer to QESDP. This is a long overdue change (QPen is one of the few classes still with manual management). At the same time: it's also one of the central classes, and in order to keep the impact minimal (and binary compatible), I'm not switching to something more sophisticated. As a drive-by: drop QPenData, a remnant only used by QPen itself, which nowadays is simply a typedef for QPenPrivate. Change-Id: I38834116d7d383f29bb69ff20b0a46dfe951bb53 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* rhi: vulkan: Print vma statistics on out of device memoryLaszlo Agocs8 days2-2/+21
| | | | | | | | | | | | | | | | Following a vmaCreate* it makes sense to test for VK_ERROR_OUT_OF_DEVICE_MEMORY and print the allocator statistics in order to give an idea of the application's (video) memory usage. For instance when running on a Raspberry Pi 4, this helps to indicate that the application is just too big for the device, and is more informative then just a Failed to create image: -2 message. Pick-to: 6.6 6.5 Change-Id: I666e2358303894efab9d12d2b3a3d98f0bd3a5b6 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
* qppmhandler: avoid implicit detachAnton Kudryavtsev9 days1-1/+1
| | | | | | | | by const method usage Change-Id: If8e4d0c543837917d29361a116b955890b8a279f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qtexthtmlparser: use tokenize instead of splitAnton Kudryavtsev9 days1-3/+2
| | | | | | | | to avoid needless tmp list Change-Id: I5f6bc9c3edd17c04e5293feb0aad86cd5ed49695 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* vulkan: Do not set the portability bit with old SDKsLaszlo Agocs9 days1-2/+7
| | | | | | | | | | | | | Because it's a validation error with old ones, but required in some cases from 1.3.216 on (MoltenVK). Ridiculous. Amends 7fbc741d107ab679f6abd680ec909ce9b2bf333a and b018bc6e2d27b95024ee8f1b8c719199df47c264. Fixes: QTBUG-117412 Pick-to: 6.6 6.5 Change-Id: I9b4cacbe611d4e557ee1c156527142eb919d6b77 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Avoid extending dirty region in beginPaintTor Arne Vestbø11 days2-3/+10
| | | | | | | | | | | | | | | | | | | | | | When the raster window is resized, we need to resize the backingstore, and make sure we repaint the entire window. We defer the backingstore resize to beginPaint, in case multiple resize events come in before we have a chance to paint, but we can't defer the invalidation of the paint device window, because QPaintDeviceWindowPrivate::paint() has already subtracted the paint region from its dirty region at this point. Invalidating yet again will result in the dirty region of window not clearing fully until after the final resize, and when that happens we will also repaint the window with the wrong dirty region, based on the window's original size. My moving the window invalidation to the resize event, while keeping the deferred backingstore resize we avoid this problem. Pick-to: 6.5 6.6 Change-Id: I44662778f5b1bcd259b20ca86124e6487561ef4f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QKeyMapper: Remove indirection via QKeyMapperPrivate for possibleKeysTor Arne Vestbø11 days2-16/+9
| | | | | Change-Id: I1988ac60689b3e6f4b29e38d1167d2b998702c09 Reviewed-by: Liang Qi <liang.qi@qt.io>
* QKeyMapper: Merge default implementation of possibleKeys into call siteTor Arne Vestbø11 days1-11/+5
| | | | | | | Task-number: QTBUG-116873 Change-Id: I9091f4a9d465fb928afcabce0536fcd2d03b7f82 Reviewed-by: Andrey Butirsky <butirsky@gmail.com> Reviewed-by: Liang Qi <liang.qi@qt.io>
* wasm: include qunixnativeinterface.cpp in buildMorten Sørvig12 days1-1/+5
| | | | | | | | | | | | Fix shared libraries build error: undefined symbol: _ZN16QNativeInterface7Private14QWaylandWindowD0Ev We are declaring QWaylandWindow for all Q_OS_UNIX in qplatformwindow_p.h, and must include the definition as well. Change-Id: I630538af475524659e9a476171994e600f2ec668 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove QShortcutMap::matches() and use QKeySequence::matches() insteadTor Arne Vestbø13 days2-37/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The custom matching function was added in 4d4857027db3 with the rationale that people were mixing up Key_hyphen and Key_Minus all the time, and tried to solve it by treating the two as one and the same in the match function. Unfortunately this doesn't work in practice, as when a keyboard event comes in we resolve a set of possible key sequences from that, and then look those up in the list of sorted shortcut sequences. That lookup is just a binary search, and does not take into account the added logic of the custom matching function. So the binary search will fail to find the matching key sequence, and as a result we never get a chance to call matches() with a potentially malleable key sequence (for example Qt::Key_Minus when the shortcut is Qt::Key_hyphen or vice versa). The only case we do hit the matches function is if we by chance happen to land the binary search iterator on the "unmatched" shortcut, e.g. Qt::Key_hyphen, but this relies on there not being any other shortcuts that sort between Qt::Key_Minus and Qt::Key_hyphen. Task-number: QTBUG-116873 Change-Id: Iaa90991911f32276e29e37e8c7ae87643898bfc9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QShortcutMap: Rename variables to clarify their useTor Arne Vestbø13 days1-52/+53
| | | | | | | | | | | The state machinery of QShortcutMap is complicated enough as it is, so let's use better variable names. In particular, let's distinguish the registered shortcuts (QShortcutEntries), from the candidate QKeySequence sequences that we compute based on the incoming events. Task-number: QTBUG-116873 Change-Id: I9bd59097e786ecfb9d241c2eb7b871a4bba9b44f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* a11y: No longer mark QAccessibleSelectionInterface as preliminaryMichael Weghorn13 days1-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since the interface was introduced as \preliminary in commit 9d16d5e2245c26e5746fd7609300b84a2a983457, everything mentioned as required to make it a publicly documented interface has been implemented: 1. An a11y bridge for macOS/VoiceOver was implemented in 98e4e992fee5152912852fb686fa3a9e546853f2 2. An a11y bridge for Windows/UI Automation was implemented in 4f9c66131d6bd4c61ef59d749ed2ec0ce402c409 3. An a11y bridge for linux/AT-SPI was implemented in ece2feee0317b582a56a0bfc783f11fe67d3edee 4. QAccessibletable implements the interface (see 092bbc9ad30c6cd7389053dc4b332cc762693676) and an implementation in QAccessibleTabBar is pending in Gerrit [ChangeLog][QtGui][QAccessibleSelectionInterface] The QAccessibleSelectionInterface that was added as preliminary in Qt 6.5 is no longer preliminary. Exposing selection to assistive technology can be achieved by implementing this interface. Change-Id: Ic6fbc67ada32122da58ce94fa0581a27ecb2ac48 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Support loading variable fonts as application fonts in FreetypeEskil Abrahamsen Blomfeldt13 days7-20/+242
| | | | | | | | | | | | | | | | When loading the fonts, we go through all the named instances and register these as subfamilies. In addition to exposing these variants by style name, we also register them with the according weights, italic style and stretch. This adds a field to FontFile to allow piping the instance index through to when we instantiate the face. [ChangeLog][Fonts] Added support for selecting named instances in variable application fonts when using the Freetype backend. Task-number: QTBUG-108624 Change-Id: I57ef6b4802756dd408c3aae1f8a6c792a89bee6a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QShortcutMap::find: Use plain for-loop instead of do-whileTor Arne Vestbø13 days1-19/+21
| | | | | | | | | | | | | | | | The logic was a bit convoluted, using a do-while loop when the base premise still was that we needed a valid iterator, and hiding the check of a QKeySequence::NoMatch to break out of the loop far from the match() that produced it. The tempRes (now match) variable no longer has to live outside the loop, and the oneKSResult variable has been renamed to clarify its use. Task-number: QTBUG-116873 Change-Id: I730e768eae2e9a653bf4e28ceece2fe7277ef45d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
* Improve QShortcutMap debug loggingTor Arne Vestbø13 days2-5/+7
| | | | | | | Task-number: QTBUG-116873 Change-Id: I6a2b8c25d3da8c9cbcaeb0979b4be85267ba7856 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
* Switch QRgbaFloat api to hardcoded float parameter and return valuesAllan Sandfeld Jensen13 days1-13/+13
| | | | | | | | | | This makes it source compatible with Qt 6.5 by allowing us to change FastType to something other than float, which we have done for Qt 6.6 on systems with AVX float16 instructions. Pick-to: 6.6 6.6.0 Change-Id: I7ebf0c178ba0ff7f04f6788d182a1a000fe31c0c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Backing store compositor: Use smart pointers for some QRhi resourcesLaszlo Agocs2023-09-192-46/+39
| | | | | | Pick-to: 6.6 6.5 Change-Id: I005b2efe23c7dda0b15d2156708055f3b96681fc Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Sync rhi backingstore d3d12 behavior with QuickLaszlo Agocs2023-09-191-1/+7
| | | | | | | | | | | | When adding the D3D12 code path in widgets it seems it was ignored that the retry-with-WARP logic was present both for D3D11 and 12 in Qt Quick. For consistency, the same logic must be used. Right now widgets only has the retry logic for D3D11. Pick-to: 6.6 Change-Id: I08d5728acfb9a68db7e0a4b0477050f08546ffac Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Fix gcc 13 fatal warning: emplace_back() rather than append()Shawn Rutledge2023-09-191-1/+1
| | | | | | | Fixes: QTBUG-116763 Pick-to: 6.6 Change-Id: Ie7c897deb14fcd1ff27277892f0c5a151ff63b41 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qdistancefiled: use rvalue overloads moreAnton Kudryavtsev2023-09-191-1/+1
| | | | | Change-Id: I8c665e6814967f3a0463cbad8686ca28d55ab124 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qplatformpixmap: use rvalue overloads moreAnton Kudryavtsev2023-09-191-7/+7
| | | | | Change-Id: Ie5b6f6d6ffbcc0bca7a1464ad2eadbf47a707abb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Sync rhi backingstore prefer-software env.var with QuickLaszlo Agocs2023-09-181-0/+5
| | | | | | | | | | | | | Behaving differently in QQuickWindow vs. a QRhi-based widget window is not great for WebEngine. The env.var naming is not the best (QSG prefix) but we already have some precedent for this (recognizing QSG_INFO in QRhi), and there is no other choice anyway. Pick-to: 6.6 6.5 6.6.0 6.5.3 Task-number: QTBUG-116445 Change-Id: Ibfd495cbd1d42502441d6629325bdeb033e813f3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QWindow: bail out early on resize() if size has not changedVladimir Belyavsky2023-09-151-9/+10
| | | | | | | | | | | | On some platforms, like Windows and Linux, calling resize() may unexpectedly reset window state even when the actual size has not changed. So, bail out early on QWindow::resize() if new size is the same. Task-number: QTBUG-115699 Change-Id: I64ad611044008964b5201951a50f3866e2108b49 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Add Python-specific note to QOpenGLContext::aboutToBeDestroyed() documentationFriedemann Kleint2023-09-151-0/+5
| | | | | | | | | | The signal is not received when emitted from the destructor. Pick-to: 6.6 6.5 Fixes: PYSIDE-2460 Change-Id: Ic2273c5b9ef1f53bd58615b6982016e646aee326 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QWindowsFontDatabase: drop an usage of an atomic typeGiuseppe D'Angelo2023-09-152-5/+5
| | | | | | | | | | | UniqueFontData has an atomic refcount internally. I guess this was deemed necessary because font engines living in different threads may call refUniqueFont / derefUniqueFont and the refcount has to be thread safe. Those functions now are mutex protected (as they access the same map), so we don't also need atomicity for the refcounter. Change-Id: Ic223a12f4a61b7dcc567b3a5dcbe367eaa916004 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix crash when reading corrupt font dataEskil Abrahamsen Blomfeldt2023-09-151-16/+51
| | | | | | | | | | | | | | | | When loading the font data, we had some unprotected reads. To harden this, we check everything against the length of the font data before reading. [ChangeLog][QtGui][Windows] Fixed a possible crash that could happen when loading corrupted font data. Fixes: QTBUG-116773 Pick-to: 5.15 6.2 6.5 6.6 6.6.0 Change-Id: I156df3b8833c9ed785fcc690821a7a74d9a51126 Reviewed-by: Lars Knoll <lars@knoll.priv.no> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QWindowsFontDatabase: fix a data raceGiuseppe D'Angelo2023-09-142-1/+10
| | | | | | | | | | | | | | | QRawFont::loadFromData can be called from any thread. It calls into QPlatformFontDatabase::fontEngine. The code path may end up creating a UniqueFontData and storing it a QWindowsFontDatabase member (a QMap). Two threads calling loadFromData (on different QRawFont objects) will therefore race on the mutation of the map. Add the missing mutex protection. Change-Id: Ib38c2b3539679c820d997a6548e4b397cbc2bb73 Pick-to: 6.2 6.5 6.6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QWindowsFontDatabase: avoid multiple map lookupsGiuseppe D'Angelo2023-09-141-6/+8
| | | | | | | | | | | | Use the iterator-based API, and avoid a quadruple (!) lookup into a QMap. I'm aggressively cherry-picking to avoid merge clashes with an upcoming fix. Pick-to: 6.2 6.5 6.6 Change-Id: I05968f4aec9e42f84f909a1103e43ba323a9544f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* GUI: give more warning when can't load xcb since 6.5.0Liang Qi2023-09-141-0/+4
| | | | | | | | | | | normally because new depedency of xcb-cursor0 or libxcb-cursor0 is missing. Pick-to: 6.6 6.5 Task-number: QTBUG-108796 Change-Id: I040e9c0932bbf1f9026b365ded462c7373b219b5 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* rhi: Map DXGI_ADAPTER_FLAG_SOFTWARE onto the driverInfo's CpuDeviceLaszlo Agocs2023-09-145-18/+29
| | | | | | Fixes: QTBUG-116756 Change-Id: I6218ea3f59716873853b8bf83b18e0a799eedcc3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QTextFormat: Allow merging unset propertiesViktor Arvidsson2023-09-141-5/+7
| | | | | | | | | | | | | | | | | | | | | | There was no way to merge removal of properties which is required in case you want to unset some property on the current selected text in a text document. For example in case your text has font size set in pixels and you want to change it to point size, that would be impossible before this change. With this change you can set the font point size to what you want and then set font pixel size to QVariant(). This is maybe not the most obvious way to do it but any other way I could think of would require new api and quite some code duplication. [ChangeLog][QtGui][Text] QTextFormat now allows setting properties to an invalid QVariant to allow clearing properties via a merge. This changes behavior slightly where code iterating over a QTextFormats properties would never encounter invalid variants, which is now possible if setProperty with an invalid variant was used instead of using the clearProperty function to remove properties. Change-Id: Ie8290088d457bf19d9c4785cfe91ae6a1de572c4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Update version for QPalette::accent API in documentationSanthosh Kumar2023-09-131-0/+1
| | | | | | | | Follow up patch to 3c391c159ce0e29a9a654edee45bd64bcde6ccd2. Pick-to: 6.6 Change-Id: I23235ae8516a53cf09c00b0daedc054df2f0cfa8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qtextlist::itemText: reduce allocationsAnton Kudryavtsev2023-09-131-8/+6
| | | | | | | Don't create tmp QBA, just append to QString directly Change-Id: Ib7c469ef7b9b459fbc2df662adbe613c8d74d88a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Mark feature API in QFont as preliminaryEskil Abrahamsen Blomfeldt2023-09-132-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Using ints for the tags is not ideal. There is no type safe way to do conversions from strings, and how the int corresponds to the four-byte tag is not clear from the API, so user code can end up being less readable due to this. Especially since this type of tag is a data type used several places in fonts, and we will need them again for implementing support for variable axes, it's worth giving this an extra round of polish. Since it was not addressed in a timely manner and we don't want this to delay the upcoming release, we mark the API as preliminary for now, to give ourselves the option of changing it to something. Pick-to: 6.6 Fixes: QTBUG-116929 Change-Id: I498478785dcd5ece954151f01f1a017828d6b8b8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Round the image scaling when not antialiasedKaj Grönholm2023-09-131-1/+8
| | | | | | | | | | | When painting an image with antialiasing not turned on, round the target area to closest integers (pixels). Task-number: QTBUG-116297 Pick-to: 6.6 Change-Id: I64e78a9087ee042aef0ea297c48b5ead36697d10 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* QTextDocument::toPlainText: avoid unconditional detachAnton Kudryavtsev2023-09-121-2/+10
| | | | | | | Let's find replaceable chars and then do detach Change-Id: I4a4360d73a97af2388f4f2f284949ffcfbc48836 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Update documentation for QPalette::accent APISanthosh Kumar2023-09-121-0/+8
| | | | | | | | | | | | The documentation for QPalette::accent had been missed and its updated as part of this patchset. Amends patchset 17c589df94a2245ee92d45839c2cba73566d7310. Fixes: QTBUG-116930 Pick-to: 6.6 Change-Id: Iaa53e15dbecaa3c741e2db013c96b4424be39e91 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QWindow: avoid extra window resize on changing min/max sizesVladimir Belyavsky2023-09-121-1/+4
| | | | | | | | | | | | | Amends e7477e8934ab38722f5589914d08b3f15e870109. Do not call QWindow::resize() on changing min/max sizes if bounded window size has not changed. Otherwise it may unexpectedly reset window's state on some platforms, like Windows and Linux. Fixes: QTBUG-115699 Pick-to: 6.5 6.6 Change-Id: I217ca3fd854a1f41d6df312e3258734d1d3bce45 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>