| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Credit to OSS-Fuzz
[ChangeLog][QtSvg] Fixed undefined behavior from using uninitialized
variable.
Pick-to: 6.5 6.2 5.15
Coverity-Id: 22618
Change-Id: Id52277bb0e2845f4d342e187dbb8093e9276b70c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This can help in debugging performance issues with some shapes.
Change-Id: Id94f8f3d016346b00a7c45f39f6c957607258bda
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
qt5/qtsvg/src/svg/qsvghandler_p.h:23:10: fatal error: private/qcssparser_p.h: No such file or directory
23 | #include "private/qcssparser_p.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~
Pick-to: 6.5
Change-Id: I058920a57e0d452c2b67ee69e32f363bc7587a74
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
| |
Pick-to: 6.5
Change-Id: I8720313b2bc9cf9312a1f1a3d40171e1b2c8a257
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
|
| |
A 1-bit signed bitfield can only hold the values of -1 and 0, but this
is not intended.
Change-Id: I71a26f5b2dbb8745cd9f3a43bb504f199f90bb24
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
|
|
|
|
|
|
|
|
|
| |
Let's not list CMake build instructions twice.
Pick-to: 6.5 6.4 6.2
Change-Id: I3245e84f3c2d6151fa146a1513daa01fc69f626e
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
|
|
|
|
|
|
|
|
|
| |
Default ctors should be implicit so return {} works.
Found in 6.5 API review, but not actionable for 6.5, only future Qt 7.
Change-Id: I8747aa2646bbfc2af46736f9585b0709541c37d9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
|
|
|
|
|
|
| |
Pick-to: 6.2 6.4
Change-Id: I94a183f4369144edde5f71345f5a0ff72af3669e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SVG 1.1 allows to specify clipping paths. Before they were silently
discarded, but now we can support them.
The SVG generator code is very simple at its core -- at *any* state
change of the painter, a new <g> tag is emitted with the new state
(brush, pen, transform, ...).
Clipping is slightly more complicated because:
1) it needs its own element (<clipPath>), which needs to be referenced
by a shape/group by using a clip-path attribute (specifying a url).
2) in QPainter clipping happens in the logical coordinates when the clip
was set. Then the coordinates may get transformed again, but the drawn
shapes still have to honor the original clipping. In SVG, if one
specifies both the clip-path and the transform attributes on a shape,
the transformation also affects the clip-path (!). This is the
'clipPathUnits' attribute [1], that however doesn't match QPainter
semantics. As a workaround:
a) store clip paths already transformed (using the transform existing
when the clip path got set)
b) when clipping is active, emit an untransformed group, clip that
group, then open another inner group with the current painter
transformation. This ensures that the clip path is unaffected by any
further modification of the painter's transform.
Add a manual test.
[1] https://www.w3.org/TR/SVG11/masking.html#EstablishingANewClippingPath
Change-Id: I78161091925dc09c86e35ed042e31cece2618b9d
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add an opt-in measure for QSvgGenerator to request SVG 1.1 output.
This will enable the generator to honor non-Tiny features, such as
clip paths, introduced in the next commits.
[ChangeLog][QtSvg][QSvgGenerator] QSvgGenerator is now prepared to
produce SVG 1.1 documents. This will enable QSvgGenerator to support
more SVG features in the future, such as SVG clip paths.
Please note that the actual feature set supported by QSvgGenerator is
still very limited; extensive testing is recommended.
Change-Id: Ief133953e4eb25bf9bde344320fadfb49b65fd31
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
|
|
| |
QSvgGenerator is not a QObject nor a Q_GADGET class; the point
of these Q_PROPERTY is to make qdoc generate property-like
documentation.
Change-Id: Ibe92122ebfac1b26518eced8dc0e716dbd669b47
Reviewed-by: Albert Astals Cid <aacid@kde.org>
|
|
|
|
|
|
|
|
|
|
|
| |
When the paint engine state changes and updateState gets called,
the engine unconditionally streams out the entire gstate.
To do so, the dirty flags are OR'ed with a all-1 mask, and then
its flags individually tested. But those tests are now always true,
because *we* just set every flag. Just remove the flag handling.
Change-Id: Ibd9bbaef91f189da5366bc24498926c3d3abed20
Reviewed-by: Albert Astals Cid <aacid@kde.org>
|
|
|
|
|
| |
Change-Id: Ie00f1cf11ed9d40772c8c5511d90ba352c1942a8
Reviewed-by: Albert Astals Cid <aacid@kde.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Task-number: QTBUG-99313
Change-Id: Id6b89c20f706350dbc632e1b48505cafc4cdbafb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
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',
with the extended set of container classes recognized.
Change-Id: I591240bbee393617e15beee71a2a5e1e7ba79510
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Pick-to: 6.4 6.2 5.15
Change-Id: I8e864ab4213d65866b0004f115f4e7c7bf7173d5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-105718
Change-Id: Ica4da2b513a5c8f58b9f955e5cdabb92bbf5f48a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
|
|
|
|
|
|
|
|
|
| |
CI will fail the documentation build if the commit introduces new
warnings as reported by QDoc.
Pick-to: 6.3
Change-Id: I0823ab86d2fd5bbea35e20fea7358d258510c354
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although seemingly not well specified, the common behavior of web
browsers and other SVG renderers is to give priority to attribute
values specified in the CSS style attribute, in case of conflict. So
make qtsvg do the same, by moving the CSS parsing block to after the
XML attribute parsing block.
Fixes: QTBUG-100068
Pick-to: 6.4
Change-Id: I769303d69509511103d96e8d26e2cfeac1f19494
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With some broken input files, we can end up with a matrix
that scales or translates so far that it ends up with
NaNs or Infs. This causes undefined behavior later when
doing comparisons. We protect against this by checking
for matrix validity after transforming and resetting the
matrix if it becomes invalid.
Pick-to: 5.15 6.2 6.3 6.4
Fixes: QTBUG-101698
Change-Id: Iabc745c1e7a0c36449f14c4c6d9bc8066eaa8eac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: Ic3d0ab6a3e3a32ce0bab59074242c0e17c6965dd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The values for title and description are not escaped. This leads to
the generation of incorrectly structured SVG documents if meaningful
characters are added in the title (<, >, ', " for example).
Fixes: QTBUG-104203
Change-Id: I26bc5cf31c0178352774f9c1e6f57697a671d507
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Fixes
qt5/qtsvg/src/svg/doc/src/qtsvg-index.qdoc:28: (qdoc) warning: Can't link to 'Build with CMake'
Change-Id: I43f1ba9c8bbe1f211a3ecf7a36eea672c62adeaa
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Remove the import directive sections, and include the global CMake and
qmake snippets. Also, reorganize some of the sections structure.
Task-number: QTBUG-100369
Pick-to: 6.3 6.3.0
Change-Id: I26a591f8ceb43469e6d31e263bd5b7ee58fb262d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Of the four functions returned by findStyleFactoryMethod(), two do in
fact take care to cope if the first parameter is null; but the other
two forward it to parseBaseGradient(), which did not, provoking a
warning from CodeChecker.
The single caller of parseBaseGradient() is in an if/else cascade in
which some branches do assert m_nodes.isEmpty() before passing
m_nodes.top() to their respective functions, but the
parseBaseGradient() branch did not. I infer that its returns should
check for null and duly add the missing null check, rather than
asserting against it.
Change-Id: I6c630f04522a0ae05021fe95d848be64abe6c20c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
| |
Ctors taking a string has been marked deprecated (ce83a03cfd1@qtbase).
Change-Id: I02caa6cbeb63de4190f0bcb6595f1c3ccb26d791
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
|
|
|
|
|
| |
Change-Id: Ida0c5d3ed25322c736617934aef9f3a8e4daf4c3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This is a left-over from Qt 5 times, where we didn't have a separate
Qt SvgWidgets module. Qt Svg doesn't depend on widgets and shouldn't
link against it.
Pick-to: 6.2 6.3
Change-Id: Ibfcf15907e803be965554492c7dacc2a75fad1c8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
| |
Follows up on qtbase:cb27ed30f7bc58474eba991f837843eb76cbd339.
Pick-to: 6.2 6.3
Task-number: QTBUG-99642
Change-Id: I94addd4467ab51697adac1042bdb15912930b539
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A QSvghandler may be created either with an external QXmlStreamReader
object, or with a bytearray/iodevice, in which case it will create its
own stream reader. The check to end parisng at the </svg> tag was
active only in the first case. This could result in different behavior
when reading an svg image from file vs. reading it from a bytearray
or resource.
Fixes: QTBUG-99407
Pick-to: 6.3 6.2 5.15
Change-Id: I187b39256f2b16ea952a3ae1b77c067ff96e4155
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Text layout calculations are done with a local scaling, and that was
mixed up with the node transformation when computing the bounds.
Fixes: QTBUG-98139
Pick-to: 6.2
Change-Id: Id3ab0500cfba4578989b5766677a53340e8cecde
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Add an upper limit for height and width at 0xffff, same as jpeg.
Fixes: QTBUG-95891
Pick-to: 6.2 5.15 5.12
Change-Id: I0dbc80dab3aab9b4743548772fb63fa69ea21f8a
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since QSvgUse nodes are the only ones that ever get stored in the
m_resolveNodes member, we can avoid extra cast and checks around it.
Also a more descriptive name wouldn't hurt.
Currently, the list is merely cleaned at the end of a parsing process,
but ideally it should not be stored at all, hence I left the comment
for possible future optimizations, if anyone's willing to do it.
Pick-to: 6.2
Change-Id: I86e83a8661679503e532c230e70f6d52092ad58e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
| |
Pick-to: 6.2
Change-Id: I26ecbed2ea48918df69fab4ec2a611a2e274919d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Replace the hardcoded cpp exports with a generated one where it's
applicable.
Task-number: QTBUG-90492
Change-Id: I51752fe30d5e0a25ae8725ac29ffe1d4bf193ece
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SVG spec mandates that path parsing should terminate on the first
error encountered, and an error be reported. To improve the handling
of corrupt files, implement such error handling, and also limit the
number of QPainterPath elements to a reasonable range.
Fixes: QTBUG-96044
Pick-to: 6.2 5.15 5.12
Change-Id: Ic5e65d6b658516d6f1317c72de365c8c7ad81891
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
|
|
|
|
|
|
|
|
| |
We know that c++11 uses nullptr to replace 0,
so we replace 0 with nullptr in the project.
Change-Id: I81eb8c13339bf235ca5eab719526680e31fa26ed
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-97422
Pick-to: 6.2
Change-Id: I4df2af0e657f241af69480e6e30d454870df51d8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
| |
Fixes: QTBUG-97421
Pick-to: 6.2
Change-Id: I41f3cbf8e747530a67fe5074a988ba49aeb43b8e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
|
|
| |
Doing so saves yet another approximation to pi/180 and spells out the
semantics.
Change-Id: Ied1bb9aa650a9535862622f891b716943de54cec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-95987
Change-Id: Ie7f54d06dec010aaeadfabfb12f282d3a1513603
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-95170
Pick-to: 6.2
Change-Id: I8f384971cadd07732310541e1e7edfaa158adf89
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The font size will be passed through a QFixed in
QFontEngineBox::ascent() and overflow there as well as in further places.
[ChangeLog] Avoid numerous overflows by limiting font size to 0xffff.
This fixes oss-fuzz issue 31701.
Pick-to: 5.15 6.1 6.2
Change-Id: I2d00c5639804af9b056f0efc979e9899c5358cf7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
The arc element takes some flag parameters, which could be mixed up
with the float parameters since svg does not require delimiting
characters here. Hence legal svg would be misread..
Fixes: QTBUG-92184
Pick-to: 6.2 6.1 5.15
Change-Id: I5885c50d47e2e06ab0f02afefb7a5585c5c713ff
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Color animation duration parsing mixed seconds and milliseconds.
Factor out a common function for all clock value parsing, and
add checking for overflow and illegal values as a driveby..
Fixes: QTBUG-94878
Pick-to: 6.2 6.1 5.15
Change-Id: Ie1d974cd2db55a3d65d7ce02c373021021070489
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pro2cmake.py conversion script faithfully reproduced the .pro files
for the plugins, which specified the libraries as public. But in CMake,
the implications of this are that public usage requirements should then
be propagated to consumers. We don't expect any consumers, since a
plugin is created as a MODULE library in CMake, so for Windows we don't
even have an import library to link with. The only exception to this is
for static builds where plugins are created as STATIC libraries
instead, but only in certain controlled situations do we then link to
plugins. Even then, usage requirements are not expected to propagate to
the consumers, so these relationships should always be specified as
private.
Pick-to: 6.2
Task-number: QTBUG-90819
Change-Id: Ifa2d76d6bff7b29d746455aa070a77cbd06879f0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
| |
Utilize imageIO's common QImage creation function that implements
QImageReader's allocation limit that was introduced in Qt 6.
Pick-to: 6.1
Change-Id: Ie273bd874d18aeba30fd6b37d91aa72bd3725cd0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-93990
Change-Id: Ib1714f8105d9bfc751faac69efa28e94546dc6c0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|