summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* doc: Add details about what to use instead of QMouseEvent::source()Shawn Rutledge2021-12-041-0/+10
| | | | | | | Pick-to: 6.2 Fixes: QTBUG-98875 Change-Id: I2678edccf68d754d191b9eb6cdfe09bba327e85a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Document which header to include for the various native interfacesTor Arne Vestbø2021-12-042-0/+4
| | | | | | | Fixes: QTBUG-98654 Pick-to: 6.2 Change-Id: Ic5ea3cc7d90ed336a5b6e827d1523bdd58fabc13 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't change resolve mask when setting brush doesn't change paletteVolker Hilsheimer2021-12-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 556511f9f39ddc887481e0cd5a877134ceb0da6b, which moved the resolve mask storage into the palette's d-pointer, modifying the resolve mask requires a detach. As of now, we only detached when setting a different brush, but always modified the resolve mask, which broke palettes that shared the d-pointer (likely the global default palette). However, detaching has negative side effects when styles set brushes on temporary palette objects and then use that palette object's cache key to build a cache of pixmaps. As each drawing would detach the palette (even if the palette doesn't change, which is likely), the cache key changes with each detach, and the cache would quickly increase in size. This was addressed in changes d7bcdc3a442b99c2caebd4cfd38de67e14090e05 and 1e75dcf2518e37a7b83d006a4e002f972615b43b. We can either detach and find other ways to address the issues from QTBUG-65475, or we can not change the resolve mask when the brush doesn't change and completely ignore the call. Since QFont ignores the setting of any attribute to a value that is identical to the current value, and since it's possible to force that the resolve-bit is set by calling setBrush twice with different brushes, ignoring the call seems like the better solution. [ChangeLog][QtGui][QPalette] Setting a brush on a palette that is identical to the current brush no longer sets the resolve mask bit for that particular role, so items using the palette will continue to inherit changes from parent items. Fixes: QTBUG-98762 Task-number: QTBUG-65475 Pick-to: 6.2 Change-Id: Ife0f934b6a066858408ef75b7bb7ab61193ceb47 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFontDatabase: unify relevant documentation piecesAndrei Golubev2021-12-031-9/+3
| | | | | | | | | | | | | | | | addApplicationFont and addApplicationFontFromData basically do the same thing (with one reading the data from a file and another reading it directly from QByteArray) The documentation is not quite identical, so fix that by using \include magic of qdoc As a drive-by, remove outdated \note within addApplicationFont() description Fixes: QTBUG-98752 Pick-to: 5.15 6.2 Change-Id: I29738e7411d241c26a4b2e1dd91d0af867fcc111 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QLayoutPolicy: fix annoying -Wdeprecated-enum-enum-conversionMarc Mutz2021-12-031-10/+10
| | | | | | | | | | | | | | | | | | | | Says GCC -std=c++20: src/gui/util/qlayoutpolicy_p.h:127:30: warning: bitwise operation between different enumeration types ‘QLayoutPolicy::Policy’ and ‘QLayoutPolicy::PolicyFlag’ is deprecated [-Wdeprecated-enum-enum-conversion] 127 | if (verticalPolicy() & ExpandFlag) | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ Fix by making Policy a QFlags<PolicyFlag>, which we can do because the class is private. In QSizePolicy, this would break BC. Since a QFlags cannot be opened for constants like an enum, we need to define the ex-Policy-enumerators as static inline constexpr objects instead. Pick-to: 6.2 Change-Id: I29bc938f86508deed3f99ad9d1c1892547206c05 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Restrict clang warning disabler to affected versionsEdward Welbourne2021-12-021-0/+2
| | | | | | | | | | | Apparently -Wdeprecated-copy got added between clang 9 and 11. Versions without it warn about the attempt to suppress this option's warnings. This follows-up on commit 8662fbdd7e0c8c5b089a3c9871ae0cd71790858e Change-Id: I7fe9258cfe8a79d24c1f8b331a56468415b25cdb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't let text table cells shrink below their minimum widthVolker Hilsheimer2021-12-021-0/+1
| | | | | | | | | | | | | | We calculate the minimum width, but then use it only to make sure that the maximum width is at least as large as it. Without setting the layout struct's minimumWidth as well, table cells can be smaller. Add a test case. Fixes: QTBUG-86671 Fixes: QTBUG-97463 Pick-to: 6.2 5.15 Change-Id: Idf4ad015938abb8d3e599e9a58e002f29c0067be Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Freetype: adjust underlinePosition to match our expectationsMårten Nordheim2021-12-021-1/+2
| | | | | | | | | | | | | | | | | We expect underlinePosition() to be the topleft corner of where we start drawing the underline but freetype reports the _center_ of the underline: "underline_position: [...]. It is the center of the underlining stem." - https://freetype.org/freetype2/docs/reference/ft2-base_interface.html Pick-to: 6.2 5.15 Fixes: QTBUG-62602 Change-Id: I96808816f50f3f37b18f579adf285502c88e6ea5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix overlapping text for Osaka font on macOSEskil Abrahamsen Blomfeldt2021-12-021-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | The Osaka font on macOS has all zeroes in the OS/2 table, probably because it is not intended to be cross-platform. In Qt 6 (since f761ad3cd9ad1252f24b76ae413298dc7bed8af3) we are trying using the same vertical metrics on all platforms, but this only works if they are valid. To work around this issue, we detect the case when ascent/descent values are both 0, since this is very unlikely to be intentional, so we fall back to the system-provided ascent and descent in these cases. Adding the test also revealed that we had missed the check for a macOS-specific bitmap font format when skipping the check for bitmap fonts in 7a18b7e2c2394b2b2cc95833c755f91193d9ba2e. [ChangeLog][macOS][Text] Fixed a problem where using the Osaka font would lead to overlapping text. Pick-to: 6.2 Fixes: QTBUG-96880 Change-Id: Ifea7918641a68829e8f5ef20a4fb61c0a7e5b757 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix missing characters or assert with certain font sizesEskil Abrahamsen Blomfeldt2021-12-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The alphaMapBoundingBox() only exists to prefetch the size of rendered alpha maps, to reserve space in the glyph cache. Since 104e6d0f5427f5ebaab106b1651eb76c4c56df98 we have not used the QPainterPath fallback code path when actually rendering the glyphs, but that patch neglected to update the code that retrieved the bounding box. This could in some cases cause a mismatch, and if the alpha map we ended up with in the end was larger than the reserved space, this could trigger an assert or an empty spot in the cache. [ChangeLog][Text][Freetype] Fixed an issue where characters would in some rare cases be missing from text, depending on font metrics, font size and system scale factor. Pick-to: 5.15 6.2 Fixes: QTBUG-86633 Change-Id: Ic8ade168115e4f51bac71539325936bbae993120 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Don't shrink a column when it spans multiple columnsVolker Hilsheimer2021-12-011-0/+2
| | | | | | | | | | | | | | | | | | If a cell spans multiple columns, then the merged cells' starting column's maximum width should never become smaller than what was calculated from previous rows. Otherwise, we'd distribute the space of the column that has a span across all merged columns, resulting in unnecessary line breaks esp if WrapAnywhere is enabled. Add a test case. Fixes: QTBUG-91691 Fixes: QTBUG-95240 Pick-to: 6.2 5.15 Change-Id: Ic27dbdb128071e50fba049de85c9f23ba2f059b3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix gaps between lines of selectionEskil Abrahamsen Blomfeldt2021-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | When a font has fractional metrics, we could get visible gaps between lines in a multi-line selection, if the bottom of the rect was not aligned to the pixel grid. In Qt 5, this was primarily an issue on macOS, but since making vertical metrics consistent in f761ad3cd9ad1252f24b76ae413298dc7bed8af3, we could also get this on other platforms, causing a regression on these platforms. The fix is to align the rect to the pixel grid. [ChangeLog][Text] Fixed an issue where there would sometimes be visible gaps in selections spanning multiple lines. Pick-to: 6.2 Fixes: QTBUG-98372 Change-Id: I03cb1465602b6d78c60a0c764d920f7f092418a8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QTextDocument: fix an off-by-one in the changed signal for listsEirik Aavitsland2021-11-291-1/+4
| | | | | | | | | | | | | | | | | When blocks are added or removed in block groups, i.e. items added or removed from text lists, the whole group is marked as changed, but the calculation of the before/after group length would be one off. That was reflected in the contentsChange signal. Add unit test. Since the whole group changes when list items are added, text is removed and the change-begin is not where the cursor was when the change was made. Fixes: QTBUG-82455 Pick-to: 6.2 5.15 Change-Id: I99ee2cfef4944fcac8aca492741fd0f3b0de4920 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* gui: add QInputDevice::seatNames()Liang Qi2021-11-282-0/+20
| | | | | Change-Id: Ie6cedd62dcd684a8fd9adbc2409e5aa1f3490ede Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QLayoutPolicy: un-export the classMarc Mutz2021-11-271-5/+5
| | | | | | | | | | | | The class is almost completely inline. Don't export it wholesale, only export the few out-of-line members. Also acts as a test-case for the new Q_GADGET_EXPORT feature. Task-number: QTBUG-55458 Change-Id: I699a774614183960d7ac4e0afcdb57cfef76db15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* wasm: Move Blob creation code to qstdwebMorten Johan Sørvig2021-11-271-19/+5
| | | | | | | | | | | | | | Add Uint8Array::copyFrom() and Blob::copyFrom(), which constructs JS data containers with content copied from the C heap. These should not be confused with e.g. the Uint8Array(buffer, size) constructor, which creates a Uint8Array which references content on the heap, without making a copy. Change-Id: Id7d25d8044ee3914d74698e5a15c93226568eaf3 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* rhi: metal: Ignore baseInstance if not supportedLaszlo Agocs2021-11-261-3/+9
| | | | | | | | | | | | | | | | | | | | | | A previous patch already introduced calling the correct variant of drawIndexedPrimitives, but it was not done for drawPrimitives. When base vertex and instance is not supported (e.g. on the iOS simulator), it does not mean that the value cannot be other than 0, but rather that the version of the function taking this arguments must not be called at all, otherwise a Metal failure occurs. The docs and logic is all in place, just add it to draw() as well. Amends 213755a86622ae8b3ed3d7ad34a6aecd051b2b03 which fixed this for indexed draw calls. Now we also prevent aborting Qt Quick applications that trigger non-indexed draw calls. Change-Id: Icb4313ffd2d3a77a73f7b5f49d7ce63c935254d3 Pick-to: 6.2 Task-number: QTBUG-95795 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Optimize context/surface changesLaszlo Agocs2021-11-262-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there is a context with a surface current, keep on using that whenever ensureContext() is called without specifying a QWindow. Consider the following sequence: <component A> beginOffscreenFrame render to texture 1 endOffscreenFrame <component B> beginOffscreenFrame render to texture 2 endOffscreenFrame <component C> beginFrame (with swapchain) render something using texture 1 and 2 endFrame repeat all over again, continuously (in practice this is what a top level widget with QOpenGLWidgets and/or QQuickWidgets in it would lead to with the QRhi migration in place) Besides being more readable, the new version recognizes that resource and offscreen operations do not need one specific surface (like the one QOffscreenSurface every GL backend of QRhi has), but are functional with any surface (or with surfaceless even) as long as the context is correct. Thus with the above example we can work with only ever making the one QWindow current. Change-Id: I633071cae88f02e1d45e445ee55c8a58f9ec5a8c Pick-to: 6.2 Fixes: QTBUG-96405 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* wasm: Move streamFile() to qstdwebMorten Johan Sørvig2021-11-261-39/+1
| | | | | | | | | This function is useful also outside of local file access, for example when reading clipboard (file) content. Change-Id: I132546deb6df2969467051c348c05d9331d2cfd2 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* d3d11rhi: remove leftover of pre-win10 codeYuhang Zhao2021-11-261-3/+1
| | | | | | | | | Amends commit 1e085b9e15abeb45bbbf7995818fcd9c94bfefe1 Task-number: QTBUG-84432 Pick-to: 6.2 Change-Id: Id48fb6c2a9c7d24f1525975c6c154dbc323bbc25 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QImageReader: check allocation limit for minimum 32 bppEirik Aavitsland2021-11-222-2/+13
| | | | | | | | | | | | | | | | | Also, as a driveby, add an environment variable so the limit can be changed at runtime. [ChangeLog][QtGui][QImageReader] When checking allocation limit during image reading, the memory requirements are now calculated for a minimum of 32 bits per pixel, since Qt will typically convert an image to that depth when it is used in GUI. This means that the effective allocation limit is significantly smaller when reading 1 bpp and 8 bpp images. Pick-to: 6.2 6.2.2 Change-Id: If1b204d413973b0975eea531e29c260fdcec931d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up line clipping code in rasterizerEirik Aavitsland2021-11-191-36/+59
| | | | | | | | | | | | | | Replace old code with the line clipper from qcosmeticstroker. Also avoids tripping some issue with the current clang 13 that would cause paint errors on macOS. Fixes: QTBUG-98403 Fixes: QTBUG-98388 Pick-to: 6.2 6.2.2 Change-Id: I257eeec6f71153ec51b4176df3be8c443938484c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Clarify validity of image returned from QPlatformBackingStore::toImage()Tor Arne Vestbø2021-11-181-0/+5
| | | | | | | | | | | | The backingstore may reconfigure the internal data, so clients should not assume that the image is valid beyond any new operations on the backingstore. Pick-to: 6.2 Change-Id: I137ad4f2adb45ec8bb78a989fbb5bac1e72965ce Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix deserializing Qt 5.x fonts through QDataStreamEskil Abrahamsen Blomfeldt2021-11-181-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5, fonts had both singular family and plural families properties, and both were stored separately when streaming through QDataStream. The families list was treated as an extension of family in this case, and the primary font family was always the singular family property. In Qt 6, it has been merged into one and family() is now just a convenience for families().at(0). But when reading files generated with Qt 5, we would ignore the fact that these were previously separated. We would first read the family entry into the families list, and then we would later overwrite this with an empty families list. Instead, we detect streams created with Qt 5.15 or lower and make sure we append the families list instead of overwriting it in this case. In addition, we need to make sure we split up the list again when outputting to Qt 5.x. This adds a file generated with QDataStream in Qt 5.15 to the test to verify. [ChangeLog][Fonts] Fixed a problem deserializing the family of fonts that had been serialized using QDataStream in Qt 5. Pick-to: 6.2 Fixes: QTBUG-97995 Change-Id: Id3c6e13fc2375685643caee5f8e3009c00918ccb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Increment reference count when restoring referenceAllan Sandfeld Jensen2021-11-181-0/+1
| | | | | | | | | | Otherwise the count will be wrong after an out of memory failure in reinterpretAsFormat. Pick-to: 6.2 5.15 Fixes: QTBUG-98377 Change-Id: Ice51d47a6db9277126a5c7337e14aaf5ddee3a10 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* CMake: Enable -bundled-xcb-xinput by defaultPovilas Kanapickas2021-11-181-0/+1
| | | | | | | | | | | | | | | | | | | | This is done by disabling system-xcb-xinput feature by default. It will require user to pass -no-bundled-xcb-xinput to the configure script to override this. The reason for the change is that touchpad gesture implementation requires new code from libxcb, yet this new code is not even released yet. Even if it was released today, at least several years will pass until the new version is common enough. [ChangeLog][Third-Party Code][X11] The xcb plugin is now compiled with the bundled xcb-xinput library by default, in order to enable support for touchpad gestures. Change-Id: Iebb27ecee7facf070ef23f37a55aab0578698f16 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Reject truncated and corrupt ascii pnm imagesEirik Aavitsland2021-11-161-22/+27
| | | | | | | | | In contrast to the binary decoder code, the ascii decoder would not abort and fail on premature end of file. Pick-to: 6.2 6.2.2 5.15 5.12 5.12.12 Change-Id: If27bce0afa8d1de6c4dbeb2bc0e623c1dcc2f1e0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Do not include qloggingcategory.h in public headersKai Köhne2021-11-161-0/+1
| | | | | | | | | | | | | | | Reduce overhead for including qguiapplication.h by splitting up qnativeinterface.h into a public and a private part. [ChangeLog][Potentially Source-Incompatible Changes] The qguiapplication.h header no longer implicitly includes qloggingcategory.h. If your code depends on the transitive include, explicitly include <QLoggingCategory> where needed. Pick-to: 6.2 Task-number: QTBUG-97601 Change-Id: Ic02327a1c3092e21730160af5c59a9d58dc1239c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix return type documentation of QFileSystemModel::fileName()hjk2021-11-151-1/+1
| | | | | | | Pick-to: 6.2 Pick-to: 5.15 Change-Id: I5de4214766eccd5b0086d1230b4267fb49e1b58f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QInputMethod: check if focusobject supports the "new" IM function before ↵Richard Moe Gustavsen2021-11-111-6/+10
| | | | | | | | | | | | | | | calling it We use QMetaObject to invoke the "queryFocusObject" function. But if the current focus object doesn't implement this function, we get a "QMetaObject::invokeMethod: No such method" warning. This patch will add a check if the focus object supports IM queries before trying to call "queryFocusObject", to avoid the warning. Task-number: QTBUG-91545 Change-Id: I3aa8bd2d4bf57bd42c2d77ed71174ec4f9951f81 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QGuiApplication: properly decode path command-line argumentsThiago Macieira2021-11-101-2/+2
| | | | | | | | | Using QFile::decodeName, not QString::fromLocal8Bit. Pick-to: 6.2 Change-Id: Ice04365c72984d07a64dfffd16b47dcbfee23341 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* rhi: Expose the maximum uniform buffer range limitLaszlo Agocs2021-11-108-1/+62
| | | | | | | | Pick-to: 6.2 Task-number: QTBUG-97715 Change-Id: I7f0a52c410b9b77f735fb3b7fd33141674bb0cda Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Tidy up QPixmapCache to prevent potential segfaultVolker Hilsheimer2021-11-051-23/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following reports of segfaults in long-running programs leading to QPixmapCache corruption, clean up some code smells: * check pointers before dereferencing We did this in some places, and a default constructed or moved-from key could have a nullptr KeyData, so check everywhere. * don't trunctate qsizetype to int Still plenty of int APIs left, but no need for ints in internal code. * don't underflow maxCost to -1 if totalCost was 0 * use ranged-for to iterate over list of keys * guard any public function that might create the cache with the thread- test This avoids that the cache ends up living in the wrong thread. * don't use reinterpret_cast when static_cast is enough (which is always from void*) Since the crash is not reproducible so far, and the reports indicate that it can only be observed when the program has run for a long time, there is no test case included. However, this removes some code smells that might be responsible for data corruption. Pick-to: 6.2 Task-number: QTBUG-97903 Task-number: QTBUG-91445 Task-number: QTCREATORBUG-26473 Change-Id: Ibdd8963d7dd44caab1468ecc6f81ace761719c69 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Make QPlatformTheme a gadgetMitch Curtis2021-11-031-0/+3
| | | | | | | | | | So that we can wrap it and expose that wrapper to QML. Also, make the ThemeHints enum available with Q_ENUM. Change-Id: I920e7cc29c45c81c3a381b14ddb077f259f66b6c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add ShowDirectoriesFirst platform theme hintMitch Curtis2021-11-032-0/+7
| | | | | | | | This allows Qt Quick Dialogs to accurately check how it should show files and directories. Change-Id: I0f5102553ff9a0484b3714ba176f7e5e668fd05c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* FreeType: allow falling back to synthesized bold if desiredAndy Shaw2021-11-031-1/+3
| | | | | | | | | | Some users still prefer the fake bold look even if in some cases it does not look good. So add an environment variable - QT_NO_SYNTHESIZED_BOLD_LIMIT - to allow that fallback to stay in place. Pick-to: 6.2 5.15 Change-Id: I8212c1fa36edb4730b187dc4a23ea45f94981154 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* rhi: Extend docs regarding QImage and data lifetimeLaszlo Agocs2021-11-021-0/+11
| | | | | | Change-Id: I45e0e53af7e6ba084f6305c3097c6a0ff65fb458 Pick-to: 6.2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: vk: fix offscreen frame command completion waitLaszlo Agocs2021-11-021-11/+11
| | | | | | | | | | | | | | | Remove the if-there-is-more-than-one-swapchain condition. Surely in a (onscreen) 0, (onscreen) 1, (offscreen) 0 frame sequence the wait is essential when starting the offscreen frame. Otherwise we may be deferred-releasing resources from the still active onscreen #0 frame. The problem is only apparent with certain frame slot change sequences. For instance (onscreen) 0, (offscreen) 1, (onscreen) 0 would not show any problems. Pick-to: 6.2 Change-Id: I705a0a3ab0b4bc9e4dc2b1c6ff60025d04c739b3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Revert "Add support for EGL_EXT_platform_xcb"Paul Olav Tvete2021-11-021-4/+0
| | | | | | | | | | | This reverts commit 816c5de460439faac0745cb364c374162b7fc651. Reason for revert: Causes crash on Nvidia when Qt is configured with -opengl es2 Fixes: QTBUG-97738 Change-Id: I9fe43146b922fc770890a144fdb1bd1c564635bb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove pre-Win10 code paths in QtBaseYuhang Zhao2021-11-022-38/+5
| | | | | | | | | | | | | | Mostly a removal of dynamically loaded API. They should all exist on Windows 10 1809 (Qt6's minimum supported version). accessibility parts left untouched to make sure MinGW still compiles. Task-number: QTBUG-84432 Pick-to: 6.2 Change-Id: I7a091fc967bd6b9d18ac2de39db16e3b4b9a76ea Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Add QMenu::menuInAction as a static helperVolker Hilsheimer2021-11-011-1/+1
| | | | | | | | | | | | | | QAction::menu is deprecated, as it makes QAction (a QtGui class) depend on QtWidgets. The template hack works, but shouldn't become a permanent solution and is already deprecated. To get the QMenu out of a QAction that contains it, add a static helper to QMenu instead. QAction continues to store the menu pointer so that we don't have to use a dynamic property or an associative container in QMenu. Change-Id: Ieb6a2b1900d2fc2f16dd5a4a8ab7da98604642d3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add const to read only local variablesOliver Eftevaag2021-11-012-3/+3
| | | | | | Pick-to: 6.2 Change-Id: Ideb34a5009277b919a8a3834e53af4ff550dfc6e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* rhi: Add texture array supportLaszlo Agocs2021-10-2913-112/+367
| | | | | | | | | | | | | | Arrays of textures have always been supported, but we will encounter cases when we need to work with texture array objects as well. Note that currently it is not possible to expose only a slice of the array to the shader, because there is no dedicated API in the SRB, and thus the same SRV/UAV (or equivalent) is used always, capturing all elements in the array. Therefore in the shader the last component of P in texture() is in range 0..array_size-1. Change-Id: I5a032ed016aeefbbcd743d5bfb9fbc49ba00a1fa Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Update clipping area when antialiasing changesChen Bin2021-10-273-0/+41
| | | | | | | | | | | | | | | | | | | Antialiasing is disabled when the painter's antialiasing attribute is set behind the clipping function(example `setClipPath` or `setClipRegion`). The cause of this problem is that the antialiasing state of the clipping region is not updated after the antialiasing attribute is set. A variable is required to record the painter's transformation state set before the clipping function, because the transformation will be applied to the clipping region, resulting in the abnormal clipping region. The value of `s->matrix` is not accurate for the clipping fun- ction. Pick-to: 6.2 Fixes: QTBUG-97269 Change-Id: I409a9db32efc3b991ebb97ec9aed19bbddb273d8 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove unused statements in QWindowDavid Skoland2021-10-261-2/+0
| | | | | Change-Id: I91f0d23d22923f7c2b8c9099371288d226d541c6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Enforce zero warnings for QtCore, QtGuiTopi Reinio2021-10-261-0/+3
| | | | | Change-Id: I7b39f9bf8d7bc9c9c5c21c4bd648a86281162740 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix qdoc warnngsVenugopal Shivashankar2021-10-232-2/+4
| | | | | | | | | | | qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:75: (qdoc) warning: Cannot tie this documentation to anything [qdoc found a /*! ... */ comment, but there was no topic command (e.g., '\fn', '\page') in the comment and no function definition following the comment.] qt5/qtbase/src/gui/text/qtextformat.cpp:1500: (qdoc) warning: Overrides a previous doc qt5/qtbase/src/gui/text/qtextformat.cpp:1487: (qdoc) warning: (The previous doc is here) qt5/qtbase/src/gui/text/qtextformat.cpp:1533: (qdoc) warning: Overrides a previous doc qt5/qtbase/src/gui/text/qtextformat.cpp:1520: (qdoc) warning: (The previous doc is here) Change-Id: I5a089bef1841d6d69bff4c780805d20e5926fe6f Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Add QFontMetricsF methods taking text options into accountAllan Sandfeld Jensen2021-10-222-6/+201
| | | | | | | | | | This is needed by Qt Quick to be able to calculate font metrics using design metrics matching Quick text rendering. Task-number: QTBUG-85936 Task-number: QTBUG-94023 Change-Id: I67c74e2a912bd58df7a57349a858f20f04609f0f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix inconsistencies between advanceWidth and bounding rectsAllan Sandfeld Jensen2021-10-213-117/+57
| | | | | | | | | | | | | | | | Unify the logic in QTextEngine Ensure tightBoundingRect, and the FreeType boundingRect, calculates from the shaped x offset when calculating the max x coordinate for a glyph. Fixes: QTBUG-7768 Task-number: QTBUG-70184 Task-number: QTBUG-85936 Task-number: QTBUG-94023 Change-Id: I6daafb25c79158dc7e777529abb5e8d3a284dac0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QFactoryLoader: continue the port from JSON to CBORThiago Macieira2021-10-201-6/+5
| | | | | | | | | | | | | | This continues the effort from the previous commit, by not passing through the JSON conversion at all, and simply using CBOR directly. The port in qtbase is complete, but in order to support the conversion in other modules without introducing breakages, there's a temporary class used for converting to QPluginParsedMetaData from QJsonObject. It'll be removed once all other modules have finished converting. Change-Id: I2de1b4dfacd443148279fffd16a3ed4ddaf34afc Reviewed-by: Lars Knoll <lars.knoll@qt.io>