summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Port QImage::Format_CMYK32 to CMYK8888Giuseppe D'Angelo2024-04-041-1/+1
| | | | | | | | | | | | Follow the established convention that byte-oriented image formats have the "8888" suffix, not "32". The old enum name is temporarily left to help port other submodules. This work has been kindly sponsored by the QGIS project (https://qgis.org/). Change-Id: I4b6f10cb22312b614cb9cf4b0ac439907276c538 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* GUI: add CMYK painting supportGiuseppe D'Angelo2024-04-031-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a CMYK 8bpp format to QImage. The idea is to enable the transport of CMYK images inside Qt, for instance to be loaded/saved from files or painted on CMYK capable paint devices (e.g. PDF). Also, rasterization support *from* a CMYK image is added (on top of a RGB surface), as well as CMYK image scaling/conversion. Conversion and rasterization between CMYK and RGB isn't particularly optimized nor it honors any colorspaces yet. The overall idea is to match 1:1 the existing behavior of CMYK QColor (which get naively changed to RGB; there isn't colorspace support in QPainter yet). There are no plans to add rasterization *towards* CMYK. Image save/load in native CMYK formats will be added in future commits. This work has been kindly sponsored by the QGIS project (https://qgis.org/). [ChangeLog][QtGui] Support for 8-bit CMYK images has been added. Change-Id: I4b024cd4c15119c669b6ddd450418a9e425587f8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Doc: Remove dead links to Concentric Circle ExampleKai Köhne2024-01-091-1/+1
| | | | | | | | Amends 33254fb41f29b510d Pick-to: 6.6 6.7 Change-Id: I81fee9ba277fdc6f3609440ddcf69cf7c3924c70 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Turn the "concentriccircles" example into snippets, update screenshotVolker Hilsheimer2023-12-141-13/+11
| | | | | | | | | | | | | The example has a lot of code and documentation, but in essence shows how to use float-based QPainter APIs and how to set a render hint. That is two lines of code, which we can show as snippets. Update the screenshot of the example with a higher-resolution version. Pick-to: 6.7 6.6 Fixes: QTBUG-119983 Change-Id: Iafcb813dff6ab8c269176f7994c95947ebf5e559 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QPainter: support painting at DPR < 1Morten Sørvig2023-11-231-2/+2
| | | | | | | | | | | | | | | | QPainter was clamping the DPR at 1, which makes Qt paint a blank window when the DPR is less than 1. Fix by not clamping and treating only DPR == 1 as a special case. This is particularly relevant on Qt for WebAssembly where the user can set the page scale to a value less than 100%. Fixes: QTBUG-111787 Change-Id: Iaa1f7a9b7837dd933c28380b5049422dc1ce9657 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make all QPainter operations warn if there's no engineSergio Martins2023-11-111-10/+30
| | | | | | | | | | | | | Otherwise, for example fillRect() will fail silently. Most operations already had the warning, but some were missing it. Pick-to: 6.6 Change-Id: I1ef6bf880d5b0722baadcf0ced68a968f0b1a070 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Avoid multiple transformation of the clip pathSanthosh Kumar2023-02-071-1/+0
| | | | | | | | | | | | | | | | | | The painter saves existing paint engine state in the stack and restore back to the previous state after performing required paint operation. The clip path stored as part of paint engine state is getting translated more than once during save and restore operation. This multiple transformation of the same clip path causes incorrect translation within the plane. To fix this issue, during restore, remove translation of clip path with redirection matrix. Fixes: QTBUG-109518 Pick-to: 6.5 6.4 6.2 Change-Id: I1509bc7fa4965f2802bce62c1ed27cdb90da617a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Check if fontEngine is valid in QStaticTextInho Lee2022-11-261-0/+2
| | | | | | | | | | | | When QuickWindow is set as setPersistentGraphics(false) and setPersistentSceneGraph(false), texItems' fontEngines can become invalid with hiding and showing. In this case, a new font engine is created but not used. Pick-to: 6.4 6.2 Fixes: QTBUG-108300 Change-Id: I2bd759724d78cecd62666beb6fb4a01f6063cae1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-4/+4
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Relayout QStaticText when dpi changesEskil Abrahamsen Blomfeldt2022-07-141-1/+4
| | | | | | | | | | | | | | | | | If the cached font has a different DPI than the one used in QPainter, we need to treat this the same as if other font properties have changed and redo the layout. This happened when running the QStaticText test on Wayland, because the default dpi was 100 and the QPixmap we ended up drawing to was 96. This caused the pixel size of the font to be calculated differently when doing drawText() (using 96 dpi) and drawStaticText() (using the cached 100 dpi). Pick-to: 6.4 Fixes: QTBUG-100982 Change-Id: Ie4270341bb8a64b6458eb67ba460a282c65dc26b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add painter render hint for brush pattern transformationEirik Aavitsland2022-05-311-0/+6
| | | | | | | | | | | | | | [ChangeLog][QtGui][QPainter] In Qt 5, the predefined brush patterns would always be transformed along with the object being painted. In Qt 6.0 onwards, they would or would not, depending on the SmoothPixmapTransformation render hint. Instead of this somewhat surprising behavior, make the default be untransformed (i.e. cosmetic), which makes sense when it comes to dpr scaling. For the cases where one wants scaling, a new render hint is introduced to enable that: NonCosmeticPatternBrushes. Change-Id: I2208c7a28af9056d7ab97a529b66bf2d502c3c4f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | 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>
* QtGui: includemocsMarc Mutz2022-04-291-0/+2
| | | | | | | | | | | 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>
* QtGui: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-281-1/+3
| | | | | | Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-131-12/+12
| | | | | | | | | 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>
* Painting: fix overriding and combining different clip typesEirik Aavitsland2022-03-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | In a recent improvement (6de36918c03e91933fbfb5bf7b53abbe03edf460) the last set clip region or path was stored in separate variables, in order to be set again if the aliasing mode changed. That solution was too simplistic, as it would break down as soon as more than one clip area was set, with the latter either replacing or intersecting the first. It was also unnecessary to introduce new storing of clip areas and transforms, as those are already recorded in the clipInfo stack in the painter state. This patch hence reverts much of that implementation. However the basic idea of setting the clip area again after AA change is good, so that part is kept, implementated instead by calling a pre-existing function to replay the clipInfo stack. One of the baseline test cases is extended to excercise the combination of clip areas. As a driveby, support for setClipRectF is added to the painting baseline test scripts, and the build of the manual lance tool is fixed. Fixes: QTBUG-101474 Pick-to: 6.3 6.2 Change-Id: Ide8b70d8cbf138deb06cbb84f69e62f7405886e6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix deprecated uses of QScopedPointerMårten Nordheim2022-03-081-4/+8
| | | | | | | | | 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>
* 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>
* Update clipping area when antialiasing changesChen Bin2021-10-271-0/+2
| | | | | | | | | | | | | | | | | | | 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>
* Handle DPR in QPainter's drawing methods taking a brush parameterEirik Aavitsland2021-10-181-35/+31
| | | | | | | | | | | | | | The emulation paint engine is required not only for non-LogicalMode gradient brushes, but also for texture (pixmap/image) brushes with DPR != 1. fillRect(), strokePath() etc. would check for the former case, but not the latter. Fix by factoring out a common checking function. Pick-to: 6.2 5.15 Fixes: QTBUG-89101 Change-Id: I3cddf8a86a321de97b12c85a187069e77d2acea6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* gui: Fix typos in documentationJonas Kvinge2021-10-121-2/+2
| | | | | | Pick-to: 5.15 6.2 Change-Id: I533f5a55cd0cd60a76990b552d7dab51a301ac1c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QPainter: replace manual memory management [5/5]: d_ptrsMarc Mutz2021-07-161-18/+5
| | | | | | | | Replace a manually-managed pointer + size with QVarLengthArray, allowing use of pre-allocated space. Change-Id: Ife3abea0b3b0f2577bb76c348513d52d46f79641 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPainter: replace manual memory management [4/5]: emulationEngineMarc Mutz2021-07-161-20/+7
| | | | | | | | | | | Use unique_ptr to indicate ownership. The QPainter dtor is now empty, = default it. As a drive-by, fix a non-sensical if (p) p = nullptr; Change-Id: I5c811eb7de6abf8a9f279cf3630d5f86db6b3864 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPainterPrivate: use NSDMI, outline ctorMarc Mutz2021-07-151-0/+6
| | | | | | | As a drive-by, make the ctor explicit. Change-Id: I4c0c597e4b6e96e800017c90acced33bbccd1d10 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPainter: replace manual memory management [3/5]: engineMarc Mutz2021-07-141-7/+5
| | | | | | | | | Use unique_ptr to indicate ownership, even though it's conditional (on QPaintEngine::autoDestruct()). That just requires a custom deleter. Change-Id: Icf8e356c333f9617b2e5172b14f13197e63c9502 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QPainter: replace manual memory management [2/5]: state/statesMarc Mutz2021-07-131-23/+21
| | | | | | | | | | | | | | | | | | Use unique_ptr to indicate ownership. Use std::stack to enforce stack-ness (QStack doesn't). Requires the addition of a clear() function, for which we spin a SmallStack wrapper. It also helps to not have to repeat the value_type... Because we use unique_ptr, `state` and `states` are now exclusive (before, `state` was always `states.back()`). Correspondingly, rename `states` → `savedStates`. As a drive-by, this fixes an off-by-one error in a qWarning() (checked `> 1`, but reported one saved state too many). Change-Id: I8faade59300401be802ddc52c64ce31b8f23dc52 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Support CSS text-decoration-color in underlines, overlines, strikethroughShawn Rutledge2021-05-071-0/+6
| | | | | | | | | | | | Also add a feature to the textedit example to set this value. [ChangeLog][QtGui][CSS] The CSS text-decoration-color attribute is now supported in rich text spans with underlines, overlines and strikethrough. Fixes: QTBUG-82114 Task-number: QTBUG-39617 Change-Id: I0065cb5431833da55b0f503ce7ff2b83b74b718a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Implement vertical subpixel positioning where availableEskil Abrahamsen Blomfeldt2021-01-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some use cases, vertical subpixel positioning may be useful, as it allows you to vertically align text with other painting primitives. This does impose an overhead, so we make it opt-int with a render hint on the painter. Note that this is only supported on Freetype currently. It might be possible to support on older macOS versions, prior to Mojave (which has disabled subpixel positioning entirely), but since it would have limited usefulness and Freetype is cross-platform anyway, I skipped that. Note: This drive-by-fixes an issue with subpixel positioning where glyphs would always be offset by 1/64, because we added the aliasing offset *after* we had determined the closest subpixel position. The idea of this, as far as I can understand, is rather to snap to nearest subpixel position upwards, not to add an offset to all glyphs, so it should be added before finding the correct position. It had a subtle visual effect when animating the position. It might be that we could get rid of it entirely, as I haven't been able to reproduce any issues with that, but I have moved it instead, to match what I believe the intention was. [ChangeLog][QtGui][Text] Added render hint flag QPainter::VerticalSubpixelPositioning which will position text at subpixel positions vertically whenever supported. In absence of this, text position will be rounded vertically as before. Fixes: QTBUG-35682 Change-Id: I8ce7a72a64e5a0924dac7c244e3e07c2938bfd09 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QPicture: Improve the documentation of Picture::play()Christian Ehrlicher2020-12-221-1/+3
| | | | | | | | | | QPicture::play() does not save/restore the painting state when called directly but this was not correctly stated in the documentation. Therefore add a small note about this. Fixes: QTBUG-83198 Change-Id: Ia820d32ccb4689d1e696fecffa9d6b5522e246b3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QFont: Prefer setFamilies() over setFamily()Andy Shaw2020-11-201-1/+1
| | | | | | | | | | | | | | | | By depending on setFamilies() then we can be sure that font names with spaces, commas, quotes and so on are correctly handled without being misinterpreted. For now it will split on the comma when a string containing one is passed to setFamily. But from Qt 6.2 this will be removed to preserve the family string as a convenience function. [ChangeLog][QtGui][QFont] Indicated that setFamilies/families is preferred over setFamily/family to ensure that font family names are preserved when spaces, commas and so on are used in the name. Change-Id: Id3c1a4e827756a4c928fed461a4aafa5a0f06633 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-1/+1
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Remove Qt4Compatible paintingAllan Sandfeld Jensen2020-11-121-14/+0
| | | | | Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port from devicePixelRatioF() to devicePixelRatio()Morten Johan Sørvig2020-09-101-3/+3
| | | | | | | This ports all of QtBase. Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix compiler issues when qreal is floatMichal Klocek2020-08-051-2/+2
| | | | | Change-Id: Ide3b5a3b0f2d93708409edac8aa999eb25c3ab54 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-071-9/+9
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QPainter: replace manual memory management [1/5]: dummyStateMarc Mutz2020-06-021-1/+0
| | | | | | | Use a unique_ptr to indicate ownership. Change-Id: I15e8c48fac1424d5605e869adcfba6965b16c218 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Specify QTextOption behavior in drawTextPaul Wicking2020-05-121-1/+2
| | | | | | | | | | Be more specific about overriding behavior when using the drawText overload that takes a QTextOption argument. Fixes: QTBUG-41894 Pick-to: 5.15 Change-Id: I8b38cb383005f1a07f4c6d70050e0d2cbb551521 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QtGui: fix deprecated QChar conversionsMarc Mutz2020-05-111-1/+1
| | | | | | | | | Conversions from non-char-types to QChar are going to be deprecated. Use QChar::fromUcs2(), fromUcs4(), QLatin1Char(), or convert the constructor argument to char16_t. Change-Id: Ib45ebd5560aa3a2bc460037ab09773607485c6e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove a bunch of deprecated members from src/gui/painting classesVolker Hilsheimer2020-05-061-170/+0
| | | | | | | | Also remove dead code that isn't compiled anymore in Qt 6 builds. Change-Id: I7a7ae35e61fb2ad9cc21180fb7224357ade1505f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Use qsizetype for size related methods in QVarlengthArrayLars Knoll2020-03-141-2/+1
| | | | | Change-Id: Ib94b9a4e6e17da21f592e71a36fd1b97d42dfe62 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Get rid of QMatrixJarek Kobus2020-02-281-227/+3
| | | | | | Task-number: QTBUG-81628 Change-Id: Iad66bfdf49b9ee65558a451108c086fc40dc3884 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace the QMatrix field of QTransform with qreal[3][3]Jarek Kobus2020-02-071-3/+3
| | | | | | | | | | | Remove temporarily the reference returned by QTransform::toAffine() since we don't keep the QMatrix object internally anymore. This is done in order to compile the rest of the code. The follow-up patch is going to remove that method completely. Task-number: QTBUG-81628 Change-Id: If7140eedb7582d81ac8da529017cf792174e86ab Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make text decorations consistent between ways of drawing textEskil Abrahamsen Blomfeldt2020-02-071-80/+71
| | | | | | | | | | | | | | | | | | | | | | | | | The drawGlyphRun() and drawStaticText() functions would calculate the horizontal origin of the decorations based on the left-most edge of the left-most glyph, in practice including the left bearing of that glyph in the position. But in drawText()/QTextLayout it will always be drawn from the position given as input by the user of the function. The inconsistency was detected in an upgrade of Harfbuzz NG, where the tests on macOS would get a -0.05 left bearing, and as a result the decorations would be painted one pixel to the left in drawGlyphRun()/drawStaticText() compared to QTextLayout. It is not a big deal in practice, but in order to get the Harfbuzz update in, we fix the inconsistency now, by passing the user-input position into the decoration function. This was also an opportunity to consolidate the two code paths, and to unexport the qt_draw_decoration_for_glyphs() symbol, which was exported in Qt 4 only to be usable by Qt Quick 1. Change-Id: I243404b2710ae378e84d7587efae719da3879944 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate all methods that use QMatrixJarek Kobus2020-01-281-3/+5
| | | | | | | | | | | Don't use QMatrix in implementation classes anymore. Task-number: QTBUG-46653 Fixes: QTBUG-81627 Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-181-2/+1
|\ | | | | | | Change-Id: I12148e7b20bcdb72d9b328035d528c99633b1e92
| * Doc: Fix qdoc compilation errors qtbaseNico Vertriest2020-01-171-2/+1
| | | | | | | | | | | | Task-number: QTBUG-79824 Change-Id: I5a39525e3e735415ba96e2d585c5de754deb15de Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-27/+27
| | | | | | | | | | | | | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Avoid initializing QFlags with 0 or nullptr in further casesFriedemann Kleint2019-11-221-9/+2
| | | | | | | | | | | | | | | | | | Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Where applicable, port over to member initialization, thus also fixing nullptr warnings. Change-Id: Iaaf2dbbbcf2952253390b8839fd15a1b17be32c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-8/+8
|/ | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>