summaryrefslogtreecommitdiffstats
path: root/src/svg/qsvggraphics_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Enabler: Pass filename through QSvgImage nodeEskil Abrahamsen Blomfeldt2024-04-291-1/+5
| | | | | | | | | | | If the image is loaded from a file and not from encoded data, it can be useful to access the data later for the svgtoqml tool, allowing the generated code to reference the original source path for instance. Change-Id: Ibce8169fb649f3c172b9bbf5bf9212be9521e280 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add missing getters for SVG nodesEskil Abrahamsen Blomfeldt2024-02-271-0/+2
| | | | | | | | | We should be able to get any property that's set on the svg nodes. This gets important when implementing the visitors for e.g. the svgtoqml tool. Change-Id: I23cfe13d975fb398064a864b0522f067584f351c Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* Add enabler functions for svgtoqmlHatem ElKharashy2024-02-221-0/+1
| | | | | | | | | - Add a getter to QSvgUseNode to access the start position. - Add an overloaded function to the QSvgVisitor that operates on a QSvgNode. Change-Id: I5f4058df0b3e11a49207ce12ac1b726324aadf1d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove the use of Q_SVG_PRIVATE_EXPORTAlexey Edelev2023-12-221-11/+11
| | | | | | Task-number: QTBUG-117983 Change-Id: I44ae75bdd91e84dcca95e3a69e969978fcf42241 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add symbol and marker to QSvgMatthias Rauter2023-11-231-11/+3
| | | | | | | | | | | | | | | The QSvgHandler can now parse the symbol and marker element and the marker-start, marker-mid and marker-end attributes of paths, polygons, polylines and lines. [ChangeLog] Added <symbol> and <marker> to the supported elements of QtSvg. Task-number: QTBUG-115223 Task-number: QTBUG-115545 Task-number: QTBUG-115546 Change-Id: I1a615e9977bd8ddd19d7711651a0988c0f41f83f Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Refactor QSvgNode draw architectureMatthias Rauter2023-11-031-26/+19
| | | | | | | | | | | | | In preparation for the mask and filter tag, the draw infrastructure is changed from a C-style macro to virtual member functions. Commonalities between all nodes are encapsulated in the draw() function. The actual draw command is encapsulated in the drawCommand() function that is called by the draw function along with some common code for setting styles, masking, filtering and benchmarking. Change-Id: I19aa79be9500eff6faa6b6f12fd13d6c0fe2d0ad Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Private API for iterating over QSvgTinyDocumentPaul Olav Tvete2023-10-301-4/+22
| | | | | | | | | | | Expose more node information in the internal API. Also use the new API to implement a debug operator for QSvgTinyDocument. Includes a drive-by fix: use floating point instead of int for rounded rect radius. Task-number: QTBUG-116883 Change-Id: I238b7313c10b88abd7c2ca755b898ecb6f8c3e8b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Refuse to load SVGs with circular referencesPaul Olav Tvete2023-09-151-0/+1
| | | | | | | | | Circular references are not allowed according to the SVG specification. Fixes: QTBUG-113042 Pick-to: 6.6 6.6.0 6.5 6.2 Change-Id: I50cf1ef56c01cbe32066101966404fa55638c8e1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Sanity check against too large text elementsEirik Aavitsland2023-06-211-0/+1
| | | | | | | | | | | | | | Before doing any text layouts (either in bounds() or when drawing), we need to make sure the text layout will not overflow later. We do this by calculating the maximum font size we can get. Since we always scale the main font to 100 pixels, we need to scale the font styles accordingly. Pick-to: 5.15 6.2 6.5 6.6 Done-with: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Fixes: QTBUG-95237 Change-Id: I3490e37554ae5697454be7edf3452f9c85f50be9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Don't rasterize gigantic shapesEskil Abrahamsen Blomfeldt2023-04-171-0/+8
| | | | | | | | | | | | | | | We set a limit for the bounding rect of shapes to avoid stalling applications for several minutes while rendering unreasonably large shapes. The limit can be disabled using an environment variable. [ChangeLog][Performance] Unreasonably large shapes are now ignored in SVG files to avoid stalling the application. The check can be disabled by setting QT_SVG_DISABLE_SIZE_LIMIT=1 in the environment. Pick-to: 6.2 6.5 Fixes: QTBUG-111850 Change-Id: Id8154049c96a565aad237ee007da0ee879446448 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-131-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ie5a75414af5fda27f5b5f527f3543b088b674677 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Implement QSvgRenderer::boundsOnElement() for text nodesEirik Aavitsland2021-05-101-1/+4
| | | | | | | | Fixes: QTBUG-32405 Change-Id: Ifb8c418546b378d9e3d6b272fc782775f6010faa Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-081-1/+1
| | | | | | Task-number: QTBUG-84469 Change-Id: I8c3e80c77422abeb23fff747bf4ca479ff0d35b3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix stack overflow on indirect self-referralAllan Sandfeld Jensen2019-04-241-0/+1
| | | | | Change-Id: If2b13c3dc4a09ce6d18aff97855179172f92878b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix QSvgRenderer incorrect render of svg:imageDavid Crémoux2019-02-061-2/+2
| | | | | | | | | | The bounds of QSvgImage are integer based (QRect) which cause rounding issues when decimals values are used to define image (image shifted and with incorrect size). Changing the bounds to QRectF solves the issue. Fixes: QTBUG-73445 Change-Id: I49828e2c0b1917ec878844d520aac182581c23fb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix parsing of forward referrals in use elementsEirik Aavitsland2018-08-201-0/+7
| | | | | | | | | | SVG <use> elements may refer to a node that is defined later in the file. The parser would then fail to resolve the link. Implement delayed link resolution in the parser to handle such cases. Task-number: QTBUG-69694 Change-Id: I94ffb3511dbd0fac822bb56991415b2d99ccf90e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add missing override and remove redundant virtualAlexander Volkov2016-12-061-37/+37
| | | | | | Change-Id: I9c6bc47803b5decb47787ad69f42259e85470f57 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Updated license headersJani Heikkinen2016-01-251-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I4bbd8b2a35222b925c6e5cef6337e6237d3e1716 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Ie7d37928ebd680c6f1b20045de11abcd5595c73f Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Export private symbols for use from other Qt modulesv5.4.0-rc1v5.4.0Louai Al-Khanji2014-11-181-12/+13
| | | | | Change-Id: I74aa76cb485cb652eba04ff2387165bab9663c99 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Update license headers and add new license filesv5.4.0-alpha1Antti Kokko2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I847adeea20fd98e5c9a18b8c44a15de84283f216 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* remove pointless #ifndef QT_NO_SVGOswald Buddenhagen2013-10-291-3/+0
| | | | | | | the way to disable the feature is to not compile the module. Change-Id: I96f18d037243f7d6e3b3cb2c23922cc4c05c30a8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix module name format in file headersSze Howe Koh2013-01-291-1/+1
| | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Change-Id: I418bbd3817d433a1b82f0f0fea68f2235d2abc5a Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: Icf9d15a0f1f38ab60f0dd8fc2bc6ac936dd7dc62 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-241-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie28eae89f2ad032f174ff840cc6a44d8dd511eed Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I5f2eda9477944e22ec5f6dd07dcb53feaa9fc03b Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: Ia89ccb618e630103d60a6e2703e3fbedae0616a6 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | | Change-Id: I2dda86020c6d4b3edf8461733b14a95b9e519afc Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtsvg Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+262
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12