summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-231-1/+1
|\ | | | | | | | | | | | | Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: If11da7799075cc2d5768da5603c5fc46773c4eae
| * QPainter: Avoid leaking memory on unbalanced save/restoreEirik Aavitsland2019-09-201-1/+1
| | | | | | | | | | | | | | | | | | If a QPainter ended without all saved states having been restored, the state stack would leak memory. Fixes: QTBUG-77843 Change-Id: I760904d6391de24a4867be54fa1bebf76be14ba7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Replace QPainter::initFrom() with begin()Christian Ehrlicher2019-06-131-11/+17
|/ | | | | | | | | | | | | | | | | | | It's deprecated since e56401818b1aae9856a5334f530c4eda33788429 but still needed for QWidget rendering - therefore move it to QPainterPrivate. Change-Id: I35880ffa22830c2921c6675b1acf7e4ca38601db Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix some QPainter-related deprecation warningsFriedemann Kleint2019-02-081-3/+3
| | | | | | | | | | | | | | | | text/qtextdocument.cpp:2666:48: warning: ‘QString QTextCharFormat::anchorName() const’ is deprecated: Use anchorNames() instead [-Wdeprecated-declarations] text/qtextdocumentfragment.cpp:545:87: warning: ‘QString QTextCharFormat::anchorName() const’ is deprecated: Use anchorNames() instead [-Wdeprecated-declarations] text/qtextdocumentfragment.cpp:546:68: warning: ‘QString QTextCharFormat::anchorName() const’ is deprecated: Use anchorNames() instead [-Wdeprecated-declarations] painting/qpainterpath.cpp:3321:34: warning: ‘void QPainterPath::addRoundRect(const QRectF&, int, int)’ is deprecated: Use addRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations] painting/qpainterpath.cpp:3342:48: warning: ‘void QPainterPath::addRoundRect(const QRectF&, int, int)’ is deprecated: Use addRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations] painting/qpainterpath.cpp:3366:47: warning: ‘void QPainterPath::addRoundRect(const QRectF&, int)’ is deprecated: Use addRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations] painting/qpainter.cpp:4233:49: warning: ‘void QPainter::drawRoundRect(const QRectF&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations] painting/qpainter.cpp:8349:27: warning: ‘void QPainter::setMatrixEnabled(bool)’ is deprecated: Use setWorldMatrixEnabled() instead [-Wdeprecated-declarations] painting/qpdf.cpp:1545:28: warning: ‘void QDataStream::unsetDevice()’ is deprecated: Use QDataStream::setDevice(nullptr) instead [-Wdeprecated-declarations] widgets/qtabbar.cpp:2096:17: warning: ‘void QPainter::initFrom(const QPaintDevice*)’ is deprecated: Use begin(QPaintDevice*) instead [-Wdeprecated-declarations] Change-Id: I76d98ea8146e7586d3763a5610781c7736d37204 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Add deprecation exclusion around deprecated calls in deprecated codeFriedemann Kleint2019-02-061-0/+3
| | | | | | | | | | | | Fix: io/qdir.cpp:1087:16: warning: ‘static void QResource::addSearchPath(const QString&)’ is deprecated: Use QDir::addSearchPath() instead [-Wdeprecated-declarations] io/qprocess.cpp:1178:34: warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations] image/qpixmap.cpp:997:48: warning: ‘static QPixmap QPixmap::grabWidget(QObject*, const QRect&)’ is deprecated: Use QWidget::grab() instead [-Wdeprecated-declarations] text/qfont.cpp:2218:29: warning: ‘QString QFont::lastResortFamily() const’ is deprecated [-Wdeprecated-declarations] itemviews/qitemdelegate.cpp:1008:41: warning: ‘static QPixmap* QPixmapCache::find(const QString&)’ is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations] Change-Id: I51259edc175b1f55f61ded3af50ebfffd8c304a8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QtGui: replace 0 with \nullptr in documentationChristian Ehrlicher2019-02-021-1/+1
| | | | | | | | | Replace 0 with \nullptr in the documentation. As a drive-by also replace some 0 with nullptr in the corresponding code. Change-Id: Ieffbfffa76e3018257b667a3e8ad6e3b88486cde Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QtGui/QPainter: mark obsolete functions as deprecatedChristian Ehrlicher2019-02-021-2/+20
| | | | | | | | | | | | | | Mark some long obsolete functions as deprecated so the can be removed with Qt6: - initFrom() - setMatrix()/matrix()/deviceMatrix()/resetMatrix() - setWorldMatrix()/worldMatrix()/combinedMatrix() - setMatrixEnabled()/matrixEnabled() - drawRoundRect() - setRedirected()/redirected()/restoreRedirected() Change-Id: I0daed72c0ef06c192309f02366a7201154e75ac9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QtGui: mark obsolete QPixmapCache::find() functions as deprecatedChristian Ehrlicher2019-02-021-1/+1
| | | | | | | | | QPixmapCache::find(QString) and QPixmapCache::find(QString, QPixmap&) are deprecated since Qt4 times. Explicit mark them as deprecated so they can be removed with Qt6. Change-Id: Iaf185f69afe02203559a1c812fbb4a95c9049a1d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add support for generating PDFs with losslessly encoded imagesAndre de la Rocha2018-10-251-0/+7
| | | | | | | | | | | | This patch adds the QPainter::LosslessImageRendering flag to QPainter::RenderHints and allows QPdfEngine to recognize it and encode images using a lossless data compression algorithm provided by zlib instead of using lossy JPEG compression, which can produce artifacts with some images. Task-number: QTBUG-54809 Change-Id: If9e2bc64da3bf3afcd5d6c74f0ee82336ef05a19 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Fix typo and add precision to method descriptionPaul Wicking2018-09-121-2/+3
| | | | | | | | | As transform() returns worldTransform(), point out that it is an alias in its description. Fixes: QTBUG-18117 Change-Id: I0eb1f78c6955b499906024105f9969cdccf13303 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Add ObjectMode coordinate mode to QGradientEirik Aavitsland2018-06-221-7/+11
| | | | | | | | | | | | | | | | | | | | | | The ObjectBoundingMode coordinate mode of QGradient allows specifying the gradient coordinates relative to the object being painted. But if the gradient brush also has a transformation, that transformation is applied in the logical, not object, coordinate space. That behavior is counterintuitive. However, changing it now would break existing code. Instead, we introduce a new coordinate mode enum with the expected behavior, and document the old one as deprecated. This prepares to fix the bugs below in qtsvg, by making it possible to specify the same behavior in Qt as SVG has. [ChangeLog][QtGui][QGradient] Add ObjectMode coordinate mode [ChangeLog][Important Behavior Changes] QDataStream version bumped up to 18 to account for changes in the serialization of QGradient. Task-number: QTBUG-59978 Task-number: QTBUG-67995 Change-Id: I8820a2555359812f3e1a46e37d6ac2cc29a2091d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Provide presets for QGradientTor Arne Vestbø2018-05-311-0/+31
| | | | | | | | | | | | | Similar to Qt::GlobalColor, the presets allow the user to create brushes based on predefined gradients, quickly getting pretty pixels on screen. The presets are based on the linear gradients from WebGradients, a free collection of gradients, hosted at https://webgradients.com/. The few radial and blended gradient presets have been excluded. Change-Id: I1ce8f2210a6045c9edb8829ab3eddcc313549127 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>