summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* [qtx11extras] Replace references to QDesktopWidget with QScreenNicolas Fella2022-05-181-5/+5
| | | | | | | | | QDesktopWidget doesn't exist any more Pick-to: 6.3 6.2 Change-Id: Ie4e2f9ce14ebe89b52224a0be798cd3cc9ff6134 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QKeySequence: Add support for Eject and Clear glyphs on macOSLaszlo Papp2022-05-181-0/+2
| | | | | | | | | Presumably, these glyphs have not been needed thus far, hence missing from the corresponding list. Pick-to: 6.2 6.3 Change-Id: I72cb8811f087c40229105f65d52a9c1048d9f9eb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QTextDocument/QGraphicsTextItem: skip layout in setTextWidth(0)David Faure2022-05-172-5/+10
| | | | | | | | | | | | | | | | | | In a QGraphicsTextItem without a width yet, there's no need to do any layouting. The use case is obviously items with an app-defined size, not the default where text items adapt to their contents. 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 QTextEdit was abusing the width 0 to mean "no wrap, width comes from contents", but since the value -1 means that already in QTextDocument, QTextEdit now uses a width of -1 for that meaning. Change-Id: I67ad59c305e5dd34830886e4e6c56dde03c93668 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QKeySequence/Mac: remove NumEntries variableMarc Mutz2022-05-171-6/+3
| | | | | | | | | | | Keep it DRY. Just let the compiler figure out the size. Pick-to: 6.3 6.2 Change-Id: I2bf1c44d4e2060a9398700d16ab98d67c849814c Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Use SPDX license identifiersLucie Gérard2022-05-16809-31919/+1652
| | | | | | | | | | | | | 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>
* Correctly read and write CF_DIB bmp dataViktor Arvidsson2022-05-161-22/+38
| | | | | | | | | | | | | | | | | | | | When decoding CF_DIB data through the bmp handler we have to do some assumptions on where the pixel data starts since there's no file header to get the offset value from. We have to do this because theres some optional data after the info header that needs to be skipped over in some cases. These optional color mask values are now also written when putting a CF_DIB into the clipboard for maximum compatibility with other apps on Windows. This fixes the issue where pasted dibs would be offset by 3 pixels on Windows. Fixes: QTBUG-100351 Pick-to: 6.2 6.3 Change-Id: Icafaf82e0aa3476794b671c638455402a0d5206f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QKeySequence: Fix the one-off error in the mac glyph array sizeLaszlo Papp2022-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | It seems that the size of the corresponding array in the code has a one-off error. This is now fixed. The end of the array passed to lower_bound is wrong because the hard-coded size is size + 1. However, the end is array + size. This is what lower_bound expects from an array. Or any other algorithm for that matter expecting the end of a container as an argument. This can cause issues with something like lower_bound because a potential "empty" fill is not sorted as lower_bound would expect the data structure. It could have been fixed by decreasing the size by one, however it is a more future-proof solution to avoid hard-coding the size and just use std::size(array) instead. Pick-to: 5.15 6.2 6.3 Change-Id: I1d25a5b1a80a3b2634b229e0718108ad5e7808a0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add QTextDocFragment::to/fromMarkdown() & QTextCursor::insertMarkdown()Shawn Rutledge2022-05-144-6/+88
| | | | | | | | | | | | | | | | | | | | | 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-143-17/+311
| | | | | | | | | | 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>
* Use correct condition for the qopengles2ext.h fileAlexey Edelev2022-05-131-1/+5
| | | | | | | Amends b98706f12207112645cc02a6df4868ebda2db8be Change-Id: I5d7af699d0afed4deebc5afd39725f1af68833b5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix versioning of PixelScrollKai Köhne2022-05-131-1/+1
| | | | | | | | | | \since will mark the whole enum as new in 6.2 Amends 673ed80fa42a77c Pick-to: 6.2 6.3 Change-Id: I88bd73d3bf8b0da355e3200b7a9b67fc141a2b93 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Add missing header files to the module sourcesAlexey Edelev2022-05-122-6/+13
| | | | | | | | | All module header files should be listed in the corresponding sections of modules SOURCEs to be accessible in CMake routines. Task-number: QTBUG-103196 Change-Id: Ieb77ae70557e35e546a5b00387e1e0aa40338239 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove remnants of the old Intel C++ compilerThiago Macieira2022-05-113-3/+3
| | | | | | | | | | | | | We don't support it any more. I don't think it has ever properly compiled Qt 6 (and it's no longer working for me against GCC 12's libstdc++ headers). If you report a bug against it, Intel support's first question is if you can try instead the new Clang/LLVM-based oneAPI C++ compiler. So we support only that one, which identifies itself as Q_CC_CLANG. Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb57a092c8439e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Atomics: workaround GCC 12 warning about overflowing d->stateThiago Macieira2022-05-111-0/+7
| | | | | | | | | | | | | | | | | | I don't see a way this can be anything but a bogus warning. In member function ‘std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::fetch_or(__int_type, std::memory_order) [with _ITp = int]’, inlined from ‘static T QAtomicOps<X>::fetchAndOrRelaxed(std::atomic<T>&, typename QAtomicAdditiveType<T>::AdditiveT) [with T = int; X = int]’ at qatomic_cxx11.h:449:33, inlined from ‘T QBasicAtomicInteger<T>::fetchAndOrRelaxed(T) [with T = int]’ at qbasicatomic.h:168:36, inlined from ‘int switch_on(QAtomicInt&, int)’ at qfutureinterface.cpp:97:31, inlined from ‘void QFutureInterfaceBase::setThrottled(bool)’ at qfutureinterface.cpp:194:18: atomic_base.h:648:33: warning: ‘unsigned int __atomic_or_fetch_4(volatile void*, unsigned int, int)’ writing 4 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] A few more of those appear in other modules. I'm not fixing them all, assuming GCC will soon fix the warning. Pick-to: 6.2 6.3 Change-Id: I7fb65b80b7844c8d8f26fffd16e93f68e278d048 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix -no-freetype build on WindowsEskil Abrahamsen Blomfeldt2022-05-111-1/+3
| | | | | | | | | Just a missing #ifdef. Pick-to: 6.2 6.3 Fixes: QTBUG-103370 Change-Id: I4fc4605317d423acbf6280307362a087e427761b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Don't require system freetypeAlexandru Croitor2022-05-101-1/+0
| | | | | | | | | | | | | | | | We provide a bundled version. We didn't before when the commit was initially introduced, because we thought we'd depend on a 3rd party package manager, but we didn't follow through on that. Amends 5668522413c831d6f1c607e1c87a0b1e1ee3cbc5 Pick-to: 6.2 6.3 Fixes: QTBUG-103245 Change-Id: Ia4cb1340bbf3f4ffb3849d658d72e7cb6c7e2fb0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* rhi: d3d: Fix not resetting the pipeline tracking between passesLaszlo Agocs2022-05-102-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do what all other backends do. If we did not want to reset the pipeline tracking pointer, then more logic would be needed, in order not to end up in trouble with clients that do: loop: create a pipeline // [1] beginpass ... // use the pipeline endpass readback finish destroy the pipeline goto loop ...because we may get the exact same pipeline pointer (with a matching generation even since it's always 1 in this case) in the different passes, just because malloc decided to do so in [1]. This could be solved by checking the global resource id but won't do that now as no other backends do it either. This solves random broken rendering with the Qt Quick 3D lightmapper. The above outline is exactly what the UV rasterization stage does. Pick-to: 6.3 6.2 Change-Id: Id74a0a336634d99092181b09dd7137eaec355d48 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QPolygon: add toPolygonF()Marc Mutz2022-05-102-0/+16
| | | | | | | | | | | | | 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>
* QWidgetTextControl: port to new-style connects (faster)David Faure2022-05-102-3/+4
| | | | | | | | | | | | | | | This speeds up creating a QGraphicsTextItem by 14% in an optimized build Before: 0.070 msecs per iteration After: 0.060 msecs per iteration Those connects were showing up when profiling, because of the string parsing that is necessary when using SIGNAL/SLOT macros. The stacktrace was connect() => decodeMethodSignature() => argumentTypesFromString() => QArgumentType constructor => qMetaTypeInternal(const char*). Pick-to: 6.3 6.2 5.15 Change-Id: I3cf5655c5450f121005140bdb587fafa083cce6a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Prevent crashing when FcFontList failsJoni Poikelin2022-05-101-0/+2
| | | | | | | | | FcFontList can return null pointer in failure cases which would lead to null pointer dereference further down. Pick-to: 5.15 6.2 6.3 Change-Id: I6b407cf2f27ead9eb471d3ee7a521468cebf7572 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Implement missing QSupportedWritingSystems comparison operatorsTor Arne Vestbø2022-05-061-0/+20
| | | | | | | The operators were exported, but not implemented. Change-Id: I6c89c1f4b76040d2388b3a10afc6eeeb52638e1b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use Q_CC_{GNU,MSVC}_ONLY when comparing to particular versionsMarc Mutz2022-05-061-1/+1
| | | | | | | | | | | | | | | | | This prevents false-negatives and false-positives, as e.g. Clang 10.0.0 masks as GCC 4.2, so Q_CC_GNU is 402 on that compiler. Depending on the test (Q_CC_GNU > NNN or Q_CC_GNU < NNN), the result of the test is almost random. Q_CC_<comp>_ONLY makes sure we match only GCC or MSVC, not bycatch such as Clang or ICC. Pick-to: 6.3 6.2 5.15 Change-Id: I4c550a11ecf85fc9a2216b330b69bd03d45b47e0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Revert "a11y: Do not cache classes that don't have a factory plugin"Fabian Kosmale2022-05-061-4/+25
| | | | | | | | | | | | | | | This reverts commit 583668005d4d6399fc16d165dcb6a5af2b94323d, and provides an alternative fix for QTBUG-75106. Reason: This introduced QTBUG-103009, due to lack of caching. To fix the original issue, we still reduce the amount of caching we do, by only considering the first non-dynamic meta-object for QML related objects. Task-number: QTBUG-75106 Fixes: QTBUG-103009 Pick-to: 6.3 6.2 5.15 Change-Id: Ic76af26a719d1114208be9555286239c6c6df615 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QWindowsFontDatabase: fix handling of default EUDC fontVladimir Belyavsky2022-05-051-7/+33
| | | | | | | | | | | | There was a problem if default EUDC font is specified in user's Windows Registry as a font file name instead of full path. In that case we didn't handle this font properly and the warning was generated. Fixes: QTBUG-103003 Pick-to: 6.2 6.3 Change-Id: I946082af8dc31e6cf82cebca94ebbb03726239e0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Export the QVulkanInstancePrivate classJiDe Zhang2022-05-044-29/+98
| | | | | | | | | | | | | | | When needs by the QVulkanInstance::setVkInstance to use a existing VkInstance to a QQuickWindow, the VkInstance maybe is from a non Qt render system, in the case, the QPlatformVulkanInstance object of QVulkanInstance is can't create from the QPA, the all vulkan information is need get from the VkInstance owner(eg, getInstanceProcAddr). But providing it with a public interface is not a good idea, so by exporting a private class, you can use a private interface where needed to achieve the above purpose. Task-number: QTBUG-103021 Change-Id: I0312adcf55cfd7d49889ed112ab237c0b3ab3ef6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Namespace a few missing Objective-C categories and their methodsMichael Spork2022-05-031-0/+5
| | | | | | | Fixes: QTBUG-100059 Pick-to: 6.2 6.3 Change-Id: I7579c9ee027de6a133a8b5d95d8e56829e089dab Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace remaining uses of deprecated _qs with _sSona Kurazyan2022-05-021-1/+2
| | | | | | Task-number: QTBUG-101408 Change-Id: I1fda67c07e948af5017f0b99b67f8c20d7052033 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QAppleKeyMapper: Print key via QKeySequence instead of as QCharTor Arne Vestbø2022-04-291-1/+1
| | | | | | | | | | | The keys map beyond the Unicode range, so we can't print them as QChar. Luckily QKeySequence takes care of all of this for us in QKeySequencePrivate::keyName() via QKeySequence::encodeString(). Pick-to: 6.2 6.3 Change-Id: I822c4f925854e22af5a3b4a7028cb0ed18fb67b2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QtGui: includemocsMarc Mutz2022-04-2971-0/+142
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I1945741794c25679a9d94c0d68c8642e2c823502 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPdfEnginePrivate: generate link only when there is a hrefDmitry Shachnev2022-04-281-1/+1
| | | | | | | | | | | Otherwise, when anchor is just something that can be linked to (not a link itself), it will result in a PDF link pointing to an empty URI. See https://github.com/retext-project/retext/issues/580. Pick-to: 6.3 Change-Id: Ib3c71797b09579783d74505601bad08c84856719 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Optimize the QPalette::resolve from the other paletteJiDe Zhang2022-04-281-0/+14
| | | | | | | | | 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>
* QtGui: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-2828-90/+90
| | | | | | Task-number: QTBUG-98434 Change-Id: I98c27030c783f968cbf38dc966ce486dc366b302 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-2871-1043/+1143
| | | | | | Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* egl: Remove the disabling of surfaceless contexts for MesaLaszlo Agocs2022-04-271-9/+0
| | | | | | | | | The current check is based on the state of things in 2015, we will assume that this is no longer an issue with more modern Mesa versions. Change-Id: I60c4966eea817a6df1a1edf6064a978fbcd44cf7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Update comments in QQuaternion::getEulerAnglesInho Lee2022-04-271-2/+3
| | | | | | | | | | | A comment from the patch 6ffc8d8eb6c44fbd51e37770e7013c4610ead96d is a little ambiguous. This patch is just to give information about the modification. Task-number: QTBUG-72103 Pick-to: 6.3 6.2 5.15 Change-Id: I6bfc3ae926c118de0d969a4b44f438c24f8d4f72 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* rhi: d3d11: fail early with a broken deviceLaszlo Agocs2022-04-263-2/+312
| | | | | | | | | | | | | | | | | | | | | | | Broken meaning not being functional with shader model 5. This can happen with certain virtual machines where there is an accelerated DXGI adapter which then only supports a feature level lower than 11_0, and so SM 5.0 shaders do not work. Similarly, GPUs from 2009 and earlier may have a similar driver setup. We do not particularly care about such devices, however we should make sure it can be recognized early on (i.e. in create()) that something is not right and fail the entire QRhi initialization. Otherwise no error will occur until attempting to create the first shader via a QRhiGraphicsPipeline and that's way too late. This way clients such as Qt Quick can make an effort to retry with some other settings, most notably the PreferSoftwareRenderer flag, in order to pick the sw rasterizer based adapter (WARP). Task-number: QTBUG-78648 Change-Id: Ia4a3a0bc1a09e2864d426d4d55978dc6f759127c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Make QRhiRenderTarget's rp getter functional with swapchainsLaszlo Agocs2022-04-265-0/+5
| | | | | | | | | | | | | | | | | 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>
* DBusConnection: reuse pre-defined constat values where possibleSona Kurazyan2022-04-261-4/+3
| | | | | | Change-Id: Ie32a0e87b1eed2db104bb23d58e747e651e04e63 Pick-to: 6.3 6.2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* AtSpiAdaptor: fix debug messages to output the values before clearingSona Kurazyan2022-04-261-5/+10
| | | | | | Pick-to: 6.3 6.2 Change-Id: I945922c90396840128a79cb11443bf4ef5aadb13 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTextEngine: don't pass empty data to bidiReorderThiago Macieira2022-04-251-4/+6
| | | | | | | | | | | | | | | The algorithm in QTextEngine::bidiReorder() doesn't like an empty level and visual order list. Found by GCC 12's slightly misleading warning: qtextengine.cpp:3838:29: error: ‘levels’ may be used uninitialized [-Werror=maybe-uninitialized] qtextengine.cpp:1174:6: note: by argument 2 of type ‘const quint8*’ {aka ‘const unsigned char*’} to ‘static void QTextEngine::bidiReorder(int, const quint8*, int*)’ declared here qtextengine.cpp:3835:28: note: ‘levels’ declared here 3835 | QVarLengthArray<uchar> levels(nItems); | ^~~~~~ Pick-to: 6.2 6.3 Change-Id: If05aeeb7176e4f13af9afffd16e8490f131f160e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix unused variables in qtbaseAndrei Golubev2022-04-251-5/+1
| | | | | | | | | | | | | | | | | | | | | | | clang compiler recently got smarter and detects "pseudo used variable" patterns where we declare a variable and only use it in self-increments, self-decrements and other similar expressions Errors: qtbase/src/corelib/text/qlocale.cpp:3898:9: error: variable 'group_cnt' set but not used [-Werror,-Wunused-but-set-variable] int group_cnt = 0; // counts number of group chars ^ qtbase/src/corelib/text/qunicodetools.cpp:1372:21: error: variable 'uc' set but not used [-Werror,-Wunused-but-set-variable] const char16_t *uc = text + from; ^ and more of the kind Remove the ones that have no usage, mark others with [[maybe_unused]] Pick-to: 6.3 6.2 Change-Id: Ib2d0722110e3da8c39e29ec78c0ec290d064c970 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFontDatabase: Clear font cache before emitting fontDatabaseChangedTor Arne Vestbø2022-04-231-2/+2
| | | | | | | | | Matches the ordering in QFontDatabasePrivate::invalidate() and ensures that when the fontDatabaseChanged signal is processed by clients the cache is ready to be filled again. Change-Id: I9d09060284c6090ae2748147f6ee75b9f9b173c5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QFontDatabase: Allow partially populating the font databaseTor Arne Vestbø2022-04-224-17/+33
| | | | | | | | | | | | | | | | | | | | | | | | | We were using the count of the registered families as the way to determine if the font database had been populated yet. As a result we needed to invalidate the font database every time an application font was added to an empty database, as once the application font was added, the font database was no longer empty, and we would end up failing to populate any of the system/platform fonts. We now have a dedicated flag for tracking whether the font database has been populated, and we track whether an application font has been populated by looking at its properties list, avoiding a second round of populating when the full initialization happens. This also opens up the possibility of the platform font database populating (lazily or fully) fonts up front, for example as part of resolving theme fonts. The Windows font database had to be taught to invalidate itself at the right moment, instead of assuming doing so during populate was okey. Change-Id: I80c893df755d8d35fb8a84dd7a83c6756a8f24a2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Send ThemeChange event to all windows when system theme changesTor Arne Vestbø2022-04-223-6/+7
| | | | | | | | | | | | | | | | | | | The QWSI event for theme change has an optional window parameter to specify the window affected, but most platform react to global theme changes, and end up passing nullptr into the event. The reasonable thing to do in QGuiApplication in that case is send a theme change event to every QWindow, so that they are all notified about the situation. This approach is what the Windows platform plugin was doing already, but did so by iterating manually over the windows, resulting in multiple calls to QGuiApplicationPrivate::handleThemeChanged -- one for each QWSI event. Change-Id: Ifb27b6c31231377c0df389a592cafd0075d3d8bb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* rhi: Add a feature flag for non-fill polygon modesLaszlo Agocs2022-04-227-2/+23
| | | | | | | | 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>
* Remove last traces of old HarfbuzzEskil Abrahamsen Blomfeldt2022-04-222-38/+20
| | | | | | | | | | | | | | | | | | | | | | In Qt 6, we removed the "old" Harfbuzz and Harfbuzz-NG became the only option. But the QT_HARFBUZZ=old environment variable would still be read and would disable certain parts of the code path. This has caused some confusion when porting older applications, where QT_HARFBUZZ=old was used to work around issues with the earlier versions of Harfbuzz-NG. Setting it now causes text to disappear completely. To avoid this confusion, we remove traces of the QT_HARFBUZZ environment variable as well. [ChangeLog][Text] Fixed an issue where setting the legacy environment variable QT_HARFBUZZ=old would cause text to disappear from the application. Fixes: QTBUG-102774 Change-Id: I0f07cdb2418202fc36b82e766ad9547c34477175 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Rename QGuiApplicationPrivate::notifyThemeChanged to handleThemeChangedTor Arne Vestbø2022-04-212-16/+16
| | | | | | | | The work done by QGuiApplicationPrivate in response to a theme change goes beyond notifying. Change-Id: I27c74adf6549c553e659c7b8e271945ce753031c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* rhi: vulkan: Enable feature for line polygon modeLaszlo Agocs2022-04-211-0/+2
| | | | | | | | | | Turns out there is a fillModeNonSolid in VkPhysicalDeviceFeatures, so to be true to the spec we need to enable that when setting the polygonMode in a QRhiGraphicsPipeline to something other than the default Fill. This way the validation layer won't bark at us. Change-Id: I41f561a1796ba1d45229dc20bf1fb7bae3c43f48 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QEvent: start to de-inline copy ctor and clone() of all subclassesMarc Mutz2022-04-142-345/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-1350-311/+307
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>