├── .tag ├── tests ├── auto │ ├── qsvgplugin │ │ ├── invalid_xml.svg │ │ ├── checkers.png │ │ ├── simple_Utf16BE.svg │ │ ├── simple_Utf16LE.svg │ │ ├── simple_Utf32BE.svg │ │ ├── simple_Utf32LE.svg │ │ ├── simple_Utf8.svgz │ │ ├── simple_Utf32BE.svg.gz │ │ ├── simple_Utf8.svg │ │ ├── square.svg │ │ ├── xml_not_svg.svg │ │ ├── tall.svg │ │ ├── wide.svg │ │ ├── imageIncludeA.svg │ │ ├── square_viewbox.svg │ │ ├── square_size.svg │ │ ├── tall_viewbox.svg │ │ ├── wide_viewbox.svg │ │ ├── tall_size.svg │ │ ├── wide_size.svg │ │ ├── square_size_viewbox.svg │ │ ├── tall_size_viewbox.svg │ │ ├── wide_size_viewbox.svg │ │ ├── invalid_then_valid.svg │ │ └── imageInclude.svg │ ├── qsvgrenderer │ │ ├── heart.svgz │ │ ├── large.svgz │ │ └── CMakeLists.txt │ ├── qicon_svg │ │ ├── icons │ │ │ ├── heart.svgz │ │ │ ├── image.png │ │ │ ├── testtheme │ │ │ │ ├── 16x16 │ │ │ │ │ └── actions │ │ │ │ │ │ └── heart.png │ │ │ │ └── index.theme │ │ │ ├── rect_size_100percent.svg │ │ │ └── triangle.svg │ │ └── CMakeLists.txt │ ├── guiapplauncher │ │ ├── README.txt │ │ └── examples.txt │ ├── cmake │ │ └── CMakeLists.txt │ ├── qsvggenerator │ │ ├── referenceSvgs │ │ │ ├── fileName_output.svg │ │ │ └── radial_gradient.svg │ │ └── CMakeLists.txt │ ├── qsvgcss │ │ └── CMakeLists.txt │ ├── qsvgdevice │ │ └── CMakeLists.txt │ └── CMakeLists.txt ├── manual │ ├── CMakeLists.txt │ ├── rendertestsuite │ │ ├── rendertestsuite.pro │ │ └── README │ ├── examples │ │ ├── draganddrop │ │ │ ├── draganddrop.pro │ │ │ ├── delayedencoding │ │ │ │ ├── images │ │ │ │ │ ├── drag.png │ │ │ │ │ └── example.svg │ │ │ │ ├── delayedencoding.qrc │ │ │ │ ├── main.cpp │ │ │ │ ├── delayedencoding.pro │ │ │ │ ├── mimedata.h │ │ │ │ ├── mimedata.cpp │ │ │ │ ├── sourcewidget.h │ │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ │ ├── svggenerator │ │ │ ├── resources │ │ │ │ └── shapes.dat │ │ │ ├── svggenerator.qrc │ │ │ ├── main.cpp │ │ │ ├── svggenerator.pro │ │ │ ├── window.h │ │ │ └── displaywidget.h │ │ ├── embedded │ │ │ ├── desktopservices │ │ │ │ ├── data │ │ │ │ │ ├── sax.mp3 │ │ │ │ │ ├── Explosion.wav │ │ │ │ │ ├── designer.png │ │ │ │ │ └── monkey_on_64x64.png │ │ │ │ ├── resources │ │ │ │ │ ├── music.png │ │ │ │ │ ├── photo.png │ │ │ │ │ ├── browser.png │ │ │ │ │ └── message.png │ │ │ │ ├── desktopservices.qrc │ │ │ │ ├── desktopservices.pro │ │ │ │ ├── main.cpp │ │ │ │ ├── desktopwidget.h │ │ │ │ ├── linktab.h │ │ │ │ ├── linktab.cpp │ │ │ │ └── CMakeLists.txt │ │ │ ├── fluidlauncher │ │ │ │ ├── slides │ │ │ │ │ ├── demo_1.png │ │ │ │ │ ├── demo_2.png │ │ │ │ │ ├── demo_3.png │ │ │ │ │ ├── demo_4.png │ │ │ │ │ ├── demo_5.png │ │ │ │ │ └── demo_6.png │ │ │ │ ├── screenshots │ │ │ │ │ ├── deform.png │ │ │ │ │ ├── wiggly.png │ │ │ │ │ ├── digiflip.png │ │ │ │ │ ├── flickable.png │ │ │ │ │ ├── ftp_s60.png │ │ │ │ │ ├── lightmaps.png │ │ │ │ │ ├── qmlclocks.png │ │ │ │ │ ├── qmleasing.png │ │ │ │ │ ├── qmlflickr.jpg │ │ │ │ │ ├── spectrum.png │ │ │ │ │ ├── styledemo.png │ │ │ │ │ ├── anomaly_s60.png │ │ │ │ │ ├── mediaplayer.png │ │ │ │ │ ├── pathstroke.png │ │ │ │ │ ├── qmltwitter.jpg │ │ │ │ │ ├── raycasting.png │ │ │ │ │ ├── wiggly_s60.png │ │ │ │ │ ├── context2d_s60.png │ │ │ │ │ ├── elasticnodes.png │ │ │ │ │ ├── flightinfo_s60.png │ │ │ │ │ ├── qmlcalculator.png │ │ │ │ │ ├── qmldialcontrol.png │ │ │ │ │ ├── qmlphotoviewer.jpg │ │ │ │ │ ├── softkeys_s60.png │ │ │ │ │ ├── styledemo_s60.png │ │ │ │ │ ├── saxbookmarks_s60.png │ │ │ │ │ ├── concentriccircles.png │ │ │ │ │ ├── desktopservices_s60.png │ │ │ │ │ ├── embeddedsvgviewer.png │ │ │ │ │ ├── fridgemagnets_s60.png │ │ │ │ │ └── embeddedsvgviewer_s60.png │ │ │ │ ├── main.cpp │ │ │ │ ├── fluidlauncher.pro │ │ │ │ ├── demoapplication.h │ │ │ │ ├── fluidlauncher.h │ │ │ │ └── slideshow.h │ │ │ ├── embedded.pro │ │ │ └── CMakeLists.txt │ │ ├── textobject │ │ │ ├── resources.qrc │ │ │ ├── main.cpp │ │ │ ├── textobject.pro │ │ │ ├── svgtextobject.h │ │ │ ├── window.h │ │ │ ├── svgtextobject.cpp │ │ │ └── CMakeLists.txt │ │ ├── svgwidget │ │ │ ├── svgwidget.qrc │ │ │ ├── svgwidget.pro │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── embeddedsvgviewer │ │ │ ├── embeddedsvgviewer.qrc │ │ │ ├── embeddedsvgviewer.pro │ │ │ ├── main.cpp │ │ │ ├── CMakeLists.txt │ │ │ └── embeddedsvgviewer.h │ │ └── CMakeLists.txt │ └── cliptests │ │ └── CMakeLists.txt ├── baseline │ ├── data │ │ ├── images │ │ │ ├── sign.png │ │ │ ├── 20x20.png │ │ │ ├── cloudgsq75s.jpg │ │ │ ├── cloud411q25s.jpg │ │ │ ├── cloud411q75o.jpg │ │ │ ├── cloud411q75p.jpg │ │ │ ├── cloud411q75s.jpg │ │ │ ├── cloud444q65o.jpg │ │ │ ├── cloudoddq65o.jpg │ │ │ ├── cloud-ps411q4app.jpg │ │ │ ├── cloud411q65float.jpg │ │ │ └── viewport-fill-img.png │ │ ├── svg_12_testsuite │ │ │ ├── intro-compat-201-t.svg │ │ │ └── LICENSE.txt │ │ ├── animations │ │ │ ├── smil_animateColor_fill.svg │ │ │ ├── smil_animateColor_stroke.svg │ │ │ ├── smil_animateTransform_skewX.svg │ │ │ ├── smil_animateTransform_skewY.svg │ │ │ ├── smil_animateTransform_rotate.svg │ │ │ ├── smil_animateColor_fillAndStroke.svg │ │ │ ├── css_animattion_fill.svg │ │ │ ├── css_animattion_stroke.svg │ │ │ ├── animations_style_reverted.svg │ │ │ ├── css_animate_opacity.svg │ │ │ ├── css_animate_fill_stroke_opacity.svg │ │ │ ├── smil_additiveType_replace.svg │ │ │ ├── smil_additiveType_sum.svg │ │ │ ├── css_animate_transform_list_length.svg │ │ │ ├── css_animation_timing_function_linear.svg │ │ │ ├── smil_css_animation.svg │ │ │ ├── css_animate_transform_rotate.svg │ │ │ ├── css_animate_transform_skew.svg │ │ │ ├── css_animate_transform_scale.svg │ │ │ ├── css_animate_transform_translate.svg │ │ │ ├── css_animation_timing_function_steps.svg │ │ │ ├── css_animate_transform_list_order.svg │ │ │ ├── css_animate_transform_list_order2.svg │ │ │ ├── css_animate_props_multiple_values.svg │ │ │ ├── css_animation_timing_function_bezier.svg │ │ │ ├── css_animate_props_shorthand_longhand.svg │ │ │ ├── css_animate_transform_rotate_units.svg │ │ │ └── css_animate_transform_skew_units.svg │ │ ├── misc │ │ │ └── css_multiple_functions.svg │ │ ├── bugs │ │ │ ├── radialGradientPercentage.svg │ │ │ ├── description_title.svg │ │ │ ├── styling_cases_precedence.svg │ │ │ ├── text_invisible.svg │ │ │ ├── filterWithTransformsOnParent.svg │ │ │ ├── recursivlyRevertStyles.svg │ │ │ ├── text_with_opacities.svg │ │ │ ├── markerBoundingBoxCheck.svg │ │ │ ├── maskuseandinheritance.svg │ │ │ ├── miterLimitBoundingBoxTest.svg │ │ │ ├── zero_length_stroke_linecap.svg │ │ │ └── groupOpacity.svg │ │ └── extended_features │ │ │ ├── blur2.svg │ │ │ ├── pattern_userspace.svg │ │ │ ├── pattern_objectboundingbox.svg │ │ │ ├── pattern_xy.svg │ │ │ ├── femergenode.svg │ │ │ ├── patternWithImplicitSize.svg │ │ │ ├── femergenode2.svg │ │ │ ├── filter_premultiplied_1.svg │ │ │ ├── pattern_transform.svg │ │ │ ├── filter_premultiplied_2.svg │ │ │ ├── symbolLikeGroupOpacity.svg │ │ │ ├── filter_premultiplied_3.svg │ │ │ ├── blur.svg │ │ │ ├── marker2.svg │ │ │ ├── mask1.svg │ │ │ └── symbol.svg │ ├── CMakeLists.txt │ └── qsvgrenderer │ │ └── CMakeLists.txt ├── global │ └── global.cfg ├── benchmarks │ ├── CMakeLists.txt │ └── svg │ │ ├── CMakeLists.txt │ │ └── qsvgrenderer │ │ ├── data │ │ ├── text.svg │ │ └── opacity.svg │ │ └── CMakeLists.txt ├── CMakeLists.txt ├── README └── libfuzzer │ └── svg │ └── qsvgrenderer │ └── render │ ├── CMakeLists.txt │ └── main.cpp ├── .gitreview ├── src ├── plugins │ ├── iconengines │ │ ├── svgiconengine │ │ │ ├── qsvgiconengine-nocompress.json │ │ │ ├── qsvgiconengine.json │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ └── CMakeLists.txt │ ├── imageformats │ │ ├── svg │ │ │ ├── svg-nocompress.json │ │ │ ├── svg.json │ │ │ ├── CMakeLists.txt │ │ │ └── qsvgiohandler.h │ │ └── CMakeLists.txt │ └── CMakeLists.txt ├── svg │ ├── doc │ │ ├── snippets │ │ │ ├── doc_src_qtsvg.pro │ │ │ ├── doc_src_qtsvg.cpp │ │ │ └── src_svg_qgraphicssvgitem.cpp │ │ └── src │ │ │ ├── qtsvg-toc.qdoc │ │ │ ├── qt6-changes.qdoc │ │ │ └── qsvgglobal.qdoc │ ├── REUSE.toml │ ├── animation │ │ ├── qsvgcssanimation.cpp │ │ ├── qsvgcssanimation_p.h │ │ └── qsvgeasinginterface_p.h │ ├── qt_attribution.json │ ├── qsvganimate.cpp │ ├── qtsvgglobal.h │ ├── qtsvgglobal_p.h │ ├── LICENSE.XSVG.txt │ ├── css │ │ └── util │ │ │ └── qsvgcssvalues_p.h │ └── qsvgutils_p.h ├── CMakeLists.txt └── svgwidgets │ ├── qtsvgwidgetsglobal.h │ ├── CMakeLists.txt │ └── qsvgwidget.h ├── examples ├── svg │ ├── svgviewer │ │ ├── files │ │ │ ├── black.png │ │ │ ├── white.png │ │ │ └── chequered.png │ │ ├── doc │ │ │ └── images │ │ │ │ └── svgviewer-example.png │ │ ├── main.cpp │ │ ├── exportdialog.h │ │ ├── mainwindow.h │ │ ├── CMakeLists.txt │ │ └── svgview.h │ └── CMakeLists.txt └── CMakeLists.txt ├── dependencies.yaml ├── .cmake.conf ├── dist ├── REUSE.toml ├── changes-6.0.0 ├── changes-5.13.0 ├── changes-5.12.1 ├── changes-5.13.1 ├── changes-5.11.3 ├── changes-5.12.2 ├── changes-5.12.4 ├── changes-5.12.5 ├── changes-5.13.2 ├── changes-5.14.2 ├── changes-5.0.1 ├── changes-5.12.3 ├── changes-5.0.2 ├── changes-5.11.0 ├── changes-5.1.0 ├── changes-5.14.0 ├── changes-5.9.5 ├── changes-5.11.1 ├── changes-5.9.6 ├── changes-5.1.1 ├── changes-5.11.2 ├── changes-5.9.4 ├── changes-5.15.0 ├── changes-5.10.1 ├── changes-5.9.1 ├── changes-5.14.1 ├── changes-5.15.1 ├── changes-5.12.0 ├── changes-5.9.0 └── changes-5.7.0 ├── LICENSES ├── LicenseRef-Qt-Commercial.txt ├── HPND-sell-variant.txt └── BSD-3-Clause.txt ├── coin ├── module_config.yaml └── axivion │ └── ci_config_linux.json └── CMakeLists.txt /.tag: -------------------------------------------------------------------------------- 1 | c9e1a1f8ae3a90be4ff3e2ebe15235d9ca4e85cd 2 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/invalid_xml.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/manual/examples/embeddedsvgviewer/embeddedsvgviewer.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | QT += widgets svg 3 | 4 | HEADERS += embeddedsvgviewer.h 5 | SOURCES += embeddedsvgviewer.cpp main.cpp 6 | RESOURCES += embeddedsvgviewer.qrc 7 | 8 | target.path = $$[QT_INSTALL_EXAMPLES]/svg/embeddedsvgviewer 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/tall.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/wide.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/smil_animateTransform_rotate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/imageIncludeA.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/square_viewbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/square_size.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | if(TARGET Qt::Widgets) 5 | add_subdirectory(desktopservices) 6 | endif() 7 | if(QT_FEATURE_process AND TARGET Qt::Widgets) 8 | add_subdirectory(fluidlauncher) 9 | endif() 10 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/tall_viewbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/wide_viewbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/tall_size.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/wide_size.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | if(QT_FEATURE_xmlstreamreader) 5 | if(TARGET Qt::Gui) 6 | add_subdirectory(svg) 7 | add_subdirectory(plugins) 8 | endif() 9 | if(TARGET Qt::Widgets) 10 | add_subdirectory(svgwidgets) 11 | endif() 12 | endif() 13 | -------------------------------------------------------------------------------- /tests/auto/cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(qtsvg_cmake_tests) 6 | 7 | enable_testing() 8 | 9 | find_package(Qt6Core REQUIRED) 10 | 11 | include("${_Qt6CTestMacros}") 12 | 13 | _qt_internal_test_module_includes( 14 | Svg QSvgRenderer 15 | ) 16 | -------------------------------------------------------------------------------- /tests/auto/qicon_svg/icons/rect_size_100percent.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/square_size_viewbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/tall_size_viewbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/wide_size_viewbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/svgwidgets/qtsvgwidgetsglobal.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2020 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QTSVGWIDGETSGLOBAL_H 5 | #define QTSVGWIDGETSGLOBAL_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /tests/baseline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | # Special case: test includes the QBaselineTest module sources from qtbase directly 5 | if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../qtbase/tests/baseline/shared") 6 | if(TARGET Qt6::Network) 7 | add_subdirectory(qsvgrenderer) 8 | endif() 9 | endif() 10 | -------------------------------------------------------------------------------- /tests/manual/examples/svggenerator/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | 6 | #include "window.h" 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | QApplication app(argc, argv); 11 | Window window; 12 | window.show(); 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /tests/manual/examples/textobject/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | 6 | #include "window.h" 7 | 8 | int main(int argv, char **args) 9 | { 10 | QApplication app(argv, args); 11 | 12 | Window window; 13 | window.show(); 14 | return app.exec(); 15 | } 16 | -------------------------------------------------------------------------------- /tests/baseline/data/misc/css_multiple_functions.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/manual/examples/textobject/textobject.pro: -------------------------------------------------------------------------------- 1 | HEADERS = svgtextobject.h \ 2 | window.h 3 | SOURCES = main.cpp \ 4 | svgtextobject.cpp \ 5 | window.cpp 6 | 7 | QT += widgets svg 8 | 9 | RESOURCES = resources.qrc 10 | 11 | # install 12 | target.path = $$[QT_INSTALL_EXAMPLES]/svg/richtext/textobject 13 | INSTALLS += target 14 | 15 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/smil_animateColor_fillAndStroke.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/manual/examples/draganddrop/delayedencoding/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "sourcewidget.h" 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication app(argc, argv); 10 | SourceWidget window; 11 | window.show(); 12 | return app.exec(); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/manual/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | if(TARGET Qt::Widgets) 5 | add_subdirectory(draganddrop) 6 | add_subdirectory(embedded) 7 | add_subdirectory(svggenerator) 8 | add_subdirectory(svgwidget) 9 | add_subdirectory(embeddedsvgviewer) 10 | add_subdirectory(textobject) 11 | endif() 12 | -------------------------------------------------------------------------------- /tests/manual/examples/svggenerator/svggenerator.pro: -------------------------------------------------------------------------------- 1 | FORMS = forms/window.ui 2 | HEADERS = displaywidget.h \ 3 | window.h 4 | RESOURCES = svggenerator.qrc 5 | SOURCES = displaywidget.cpp \ 6 | main.cpp \ 7 | window.cpp 8 | 9 | QT += widgets svg 10 | 11 | INCLUDEPATH += $$PWD 12 | 13 | # install 14 | target.path = $$[QT_INSTALL_EXAMPLES]/svg/svggenerator 15 | INSTALLS += target 16 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animattion_fill.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animattion_stroke.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/desktopservices/desktopservices.pro: -------------------------------------------------------------------------------- 1 | QT+=widgets 2 | 3 | HEADERS += desktopwidget.h contenttab.h linktab.h 4 | SOURCES += desktopwidget.cpp contenttab.cpp linktab.cpp main.cpp 5 | 6 | RESOURCES += desktopservices.qrc 7 | 8 | EXAMPLE_FILES += data 9 | 10 | music.files = data/*.mp3 data/*.wav 11 | image.files = data/*.png 12 | 13 | target.path = $$[QT_INSTALL_EXAMPLES]/svg/embedded/desktopservices 14 | INSTALLS += target 15 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/animations_style_reverted.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_opacity.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/svg/animation/qsvgcssanimation.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #include "qsvgcssanimation_p.h" 5 | 6 | QT_BEGIN_NAMESPACE 7 | 8 | QSvgCssAnimation::QSvgCssAnimation() 9 | { 10 | } 11 | 12 | QSvgCssAnimation::AnimationType QSvgCssAnimation::animationType() const 13 | { 14 | return AnimationType::CSS; 15 | } 16 | 17 | QT_END_NAMESPACE 18 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/desktopservices/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "desktopwidget.h" 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication app(argc, argv); 10 | DesktopWidget* myWidget = new DesktopWidget(0); 11 | myWidget->showMaximized(); 12 | 13 | return app.exec(); 14 | } 15 | 16 | // End of file 17 | -------------------------------------------------------------------------------- /tests/manual/examples/draganddrop/delayedencoding/delayedencoding.pro: -------------------------------------------------------------------------------- 1 | QT += widgets svg svgwidgets 2 | 3 | HEADERS = mimedata.h \ 4 | sourcewidget.h 5 | RESOURCES = delayedencoding.qrc 6 | SOURCES = main.cpp \ 7 | mimedata.cpp \ 8 | sourcewidget.cpp 9 | 10 | # install 11 | target.path = $$[QT_INSTALL_EXAMPLES]/svg/draganddrop/delayedencoding 12 | INSTALLS += target 13 | 14 | simulator: warning(This example does not work on Simulator platform) 15 | -------------------------------------------------------------------------------- /LICENSES/LicenseRef-Qt-Commercial.txt: -------------------------------------------------------------------------------- 1 | Licensees holding valid commercial Qt licenses may use this software in 2 | accordance with the the terms contained in a written agreement between 3 | you and The Qt Company. Alternatively, the terms and conditions that were 4 | accepted by the licensee when buying and/or downloading the 5 | software do apply. 6 | 7 | For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions. 8 | For further information use the contact form at https://www.qt.io/contact-us. 9 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_fill_stroke_opacity.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/radialGradientPercentage.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/blur2.svg: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /coin/module_config.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | tags: [git] 3 | accept_configuration: 4 | condition: property 5 | property: features 6 | not_contains_value: Disable 7 | 8 | instructions: 9 | Build: 10 | - type: EnvironmentVariable 11 | variableName: VERIFY_SOURCE_SBOM 12 | variableValue: "ON" 13 | - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" 14 | 15 | Test: 16 | - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" 17 | - !include "{{qt/qtbase}}/coin_module_test_docs.yaml" 18 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/description_title.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | desc text 11 | title text 12 | svg text 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/smil_additiveType_replace.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/fluidlauncher/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | 7 | #include "fluidlauncher.h" 8 | 9 | 10 | int main(int argc, char** argv) 11 | { 12 | QStringList originalArgs; 13 | 14 | for (int i=0; i 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/svg/doc/snippets/src_svg_qgraphicssvgitem.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | //! [0] 5 | QSvgRenderer *renderer = new QSvgRenderer(QLatin1String("SvgCardDeck.svg")); 6 | QGraphicsSvgItem *black = new QGraphicsSvgItem(); 7 | QGraphicsSvgItem *red = new QGraphicsSvgItem(); 8 | 9 | black->setSharedRenderer(renderer); 10 | black->setElementId(QLatin1String("black_joker")); 11 | 12 | red->setSharedRenderer(renderer); 13 | red->setElementId(QLatin1String("red_joker")); 14 | //! [0] 15 | -------------------------------------------------------------------------------- /src/svg/doc/src/qtsvg-toc.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | 4 | /*! 5 | \page qtsvg-toc.html 6 | \title Qt SVG module topics 7 | 8 | The following list has links to all the individual topics (HTML files) 9 | in the Qt SVG module. 10 | 11 | \list 12 | \li \l {Rendering SVG Files} 13 | \li \l {Extended Features} 14 | \li \l {Changes to Qt SVG}{Upgrading from Qt 5} 15 | \li \l {Qt SVG Widgets C++ Classes} 16 | \endlist 17 | 18 | */ 19 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/fluidlauncher/fluidlauncher.pro: -------------------------------------------------------------------------------- 1 | QT += widgets 2 | 3 | VERSION = $$QT_VERSION 4 | 5 | HEADERS += \ 6 | demoapplication.h \ 7 | fluidlauncher.h \ 8 | pictureflow.h \ 9 | slideshow.h 10 | 11 | SOURCES += \ 12 | demoapplication.cpp \ 13 | fluidlauncher.cpp \ 14 | main.cpp \ 15 | pictureflow.cpp \ 16 | slideshow.cpp 17 | 18 | RESOURCES = fluidlauncher.qrc 19 | 20 | target.path = $$[QT_INSTALL_EXAMPLES]/svg/embedded/fluidlauncher 21 | INSTALLS += target 22 | -------------------------------------------------------------------------------- /src/plugins/imageformats/svg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## QSvgPlugin Plugin: 6 | ##################################################################### 7 | 8 | qt_internal_add_plugin(QSvgPlugin 9 | OUTPUT_NAME qsvg 10 | PLUGIN_TYPE imageformats 11 | SOURCES 12 | main.cpp 13 | qsvgiohandler.cpp qsvgiohandler.h 14 | LIBRARIES 15 | Qt::Core 16 | Qt::Gui 17 | Qt::SvgPrivate 18 | ) 19 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/pattern_userspace.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/auto/qicon_svg/icons/triangle.svg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/styling_cases_precedence.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/pattern_objectboundingbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/pattern_xy.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/invalid_then_valid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_transform_list_length.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/svg/qt_attribution.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "xsvg", 3 | "Name": "XSVG", 4 | "QDocModule": "qtsvg", 5 | "QtUsage": "Used in the Qt SVG library.", 6 | "Files": "qsvghandler.cpp", 7 | 8 | "Description": "Some code for arc handling is derived from code from the XSVG project.", 9 | "License": "Historical Permission Notice and Disclaimer - sell variant", 10 | "LicenseId": "HPND-sell-variant", 11 | "Comment": "No relevant PURL or CPE set, because the dependency is a single file", 12 | "LicenseFile": "LICENSE.XSVG.txt", 13 | "Copyright": "Copyright 2002 USC/Information Sciences Institute" 14 | } 15 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animation_timing_function_linear.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/smil_css_animation.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/manual/examples/draganddrop/delayedencoding/mimedata.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef MIMEDATA_H 5 | #define MIMEDATA_H 6 | 7 | #include 8 | 9 | //![0] 10 | class MimeData : public QMimeData 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | MimeData(); 16 | QStringList formats() const override; 17 | 18 | signals: 19 | void dataRequested(const QString &mimeType) const; 20 | 21 | protected: 22 | QVariant retrieveData(const QString &mimetype, QMetaType type) const override; 23 | }; 24 | //![0] 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/plugins/iconengines/svgiconengine/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## QSvgIconPlugin Plugin: 6 | ##################################################################### 7 | 8 | qt_internal_add_plugin(QSvgIconPlugin 9 | OUTPUT_NAME qsvgicon 10 | PLUGIN_TYPE iconengines 11 | SOURCES 12 | main.cpp 13 | qsvgiconengine.cpp qsvgiconengine.h 14 | LIBRARIES 15 | Qt::Core 16 | Qt::CorePrivate 17 | Qt::Gui 18 | Qt::GuiPrivate 19 | Qt::Svg 20 | ) 21 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/femergenode.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/patternWithImplicitSize.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/manual/examples/svggenerator/window.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef WINDOW_H 5 | #define WINDOW_H 6 | 7 | #include "ui_window.h" 8 | 9 | //! [Window class definition] 10 | class Window : public QWidget, private Ui::Window 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Window(QWidget *parent = 0); 16 | 17 | public slots: 18 | void saveSvg(); 19 | void updateBackground(int background); 20 | void updateColor(); 21 | void updateShape(int shape); 22 | 23 | private: 24 | QString path; 25 | }; 26 | //! [Window class definition] 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /tests/manual/examples/draganddrop/delayedencoding/mimedata.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "mimedata.h" 6 | 7 | MimeData::MimeData() 8 | : QMimeData() 9 | { 10 | } 11 | 12 | //![0] 13 | QStringList MimeData::formats() const 14 | { 15 | return QMimeData::formats() << "image/png"; 16 | } 17 | //![0] 18 | 19 | //![1] 20 | QVariant MimeData::retrieveData(const QString &mimeType, QMetaType type) 21 | const 22 | { 23 | emit dataRequested(mimeType); 24 | 25 | return QMimeData::retrieveData(mimeType, type); 26 | } 27 | //![1] 28 | 29 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/text_invisible.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | If you can read this, your code is wrong. 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/auto/qsvggenerator/referenceSvgs/fileName_output.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Qt SVG Document 4 | Generated with Qt 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/femergenode2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /tests/auto/qsvgcss/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## tst_qsvgcss Test: 6 | ##################################################################### 7 | 8 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) 9 | cmake_minimum_required(VERSION 3.16) 10 | project(tst_qsvgcss LANGUAGES CXX) 11 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) 12 | endif() 13 | 14 | qt_internal_add_test(tst_qsvgcss 15 | SOURCES 16 | tst_qsvgcss.cpp 17 | LIBRARIES 18 | Qt::Gui 19 | Qt::GuiPrivate 20 | Qt::SvgPrivate 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/qsvgdevice/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## tst_qsvgdevice Test: 6 | ##################################################################### 7 | 8 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) 9 | cmake_minimum_required(VERSION 3.16) 10 | project(tst_qsvgdevice LANGUAGES CXX) 11 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) 12 | endif() 13 | 14 | qt_internal_add_test(tst_qsvgdevice 15 | SOURCES 16 | tst_qsvgdevice.cpp 17 | LIBRARIES 18 | Qt::Gui 19 | Qt::GuiPrivate 20 | Qt::Widgets 21 | ) 22 | -------------------------------------------------------------------------------- /dist/changes-6.0.0: -------------------------------------------------------------------------------- 1 | Qt 6.0.0 is a new major version release of Qt. It is not binary compatible with 2 | earlier Qt releases. 3 | 4 | The goal has been to retain as much source compatibility with Qt 5.15 as 5 | possible, but some changes were inevitable to make Qt a better framework. 6 | 7 | To make it easier to port to Qt 6.0, we have created a porting guide to 8 | summarize those changes and provide guidance to handle them. In the guide, you 9 | can find links to articles about changes that may affect your application and 10 | help you transition from Qt 5.15 to Qt 6.0: 11 | 12 | https://doc.qt.io/qt-6/portingguide.html 13 | 14 | For more details refer to the online documentation of Qt 6.0: 15 | 16 | https://doc.qt.io/qt-6/index.html 17 | 18 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/filter_premultiplied_1.svg: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/pattern_transform.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/manual/examples/draganddrop/delayedencoding/sourcewidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef SOURCEWIDGET_H 5 | #define SOURCEWIDGET_H 6 | 7 | #include 8 | #include 9 | 10 | QT_BEGIN_NAMESPACE 11 | class QSvgWidget; 12 | QT_END_NAMESPACE 13 | class MimeData; 14 | 15 | class SourceWidget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | SourceWidget(QWidget *parent = 0); 21 | //![0] 22 | public slots: 23 | void createData(const QString &mimetype); 24 | void startDrag(); 25 | 26 | private: 27 | QByteArray imageData; 28 | QSvgWidget *imageLabel; 29 | MimeData *mimeData; 30 | //![0] 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /dist/changes-5.13.0: -------------------------------------------------------------------------------- 1 | Qt 5.13 introduces many new features and improvements as well as bugfixes 2 | over the 5.12.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | https://doc.qt.io/qt-5/index.html 6 | 7 | The Qt version 5.13 series is binary compatible with the 5.12.x series. 8 | Applications compiled for 5.12 will continue to run with 5.13. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | https://bugreports.qt.io/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | - This release contains only minor code improvements. 19 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/filterWithTransformsOnParent.svg: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 17 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/recursivlyRevertStyles.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dist/changes-5.12.1: -------------------------------------------------------------------------------- 1 | Qt 5.12.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.12.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.12 series is binary compatible with the 5.11.x series. 10 | Applications compiled for 5.11 will continue to run with 5.12. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.13.1: -------------------------------------------------------------------------------- 1 | Qt 5.13.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.13.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.13 series is binary compatible with the 5.12.x series. 10 | Applications compiled for 5.12 will continue to run with 5.13. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.11.3: -------------------------------------------------------------------------------- 1 | Qt 5.11.3 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.11.0 through 5.11.2. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.11 series is binary compatible with the 5.10.x series. 10 | Applications compiled for 5.10 will continue to run with 5.11. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.12.2: -------------------------------------------------------------------------------- 1 | Qt 5.12.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.12.0 through 5.12.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.12 series is binary compatible with the 5.11.x series. 10 | Applications compiled for 5.11 will continue to run with 5.12. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.12.4: -------------------------------------------------------------------------------- 1 | Qt 5.12.4 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.12.0 through 5.12.3. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.12 series is binary compatible with the 5.11.x series. 10 | Applications compiled for 5.11 will continue to run with 5.12. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.12.5: -------------------------------------------------------------------------------- 1 | Qt 5.12.5 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.12.0 through 5.12.4. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.12 series is binary compatible with the 5.11.x series. 10 | Applications compiled for 5.11 will continue to run with 5.12. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.13.2: -------------------------------------------------------------------------------- 1 | Qt 5.13.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.13.0 through 5.13.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.13 series is binary compatible with the 5.12.x series. 10 | Applications compiled for 5.12 will continue to run with 5.13. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.14.2: -------------------------------------------------------------------------------- 1 | Qt 5.14.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.14.0 through 5.14.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.14 series is binary compatible with the 5.13.x series. 10 | Applications compiled for 5.13 will continue to run with 5.14. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/desktopservices/desktopwidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef DESKTOPWIDGET_H_ 5 | #define DESKTOPWIDGET_H_ 6 | 7 | // EXTERNAL INCLUDES 8 | #include 9 | 10 | // INTERNAL INCLUDES 11 | 12 | // FORWARD DECLARATIONS 13 | QT_BEGIN_NAMESPACE 14 | class QTabWidget; 15 | QT_END_NAMESPACE 16 | 17 | // CLASS DECLARATION 18 | /** 19 | * DesktopWidget class. 20 | * 21 | * Implements the main top level widget for QDesktopServices demo app. 22 | */ 23 | class DesktopWidget : public QWidget 24 | { 25 | Q_OBJECT 26 | 27 | public: // Constructors & Destructors 28 | DesktopWidget(QWidget *parent); 29 | ~DesktopWidget(); 30 | 31 | }; 32 | 33 | #endif // DESKTOPWIDGET_H_ 34 | 35 | // End of file 36 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_transform_rotate.svg: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/filter_premultiplied_2.svg: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/README: -------------------------------------------------------------------------------- 1 | This directory contains autotests and benchmarks based on QTestlib. In order 2 | to run the autotests reliably, you need to configure a desktop to match the 3 | test environment that these tests are written for. 4 | 5 | Linux X11: 6 | 7 | * The user must be logged in to an active desktop; you can't run the 8 | autotests without a valid DISPLAY that allows X11 connections. 9 | 10 | * The tests are run against a KDE3 or KDE4 desktop. 11 | 12 | * Window manager uses "click to focus", and not "focus follows mouse". Many 13 | tests move the mouse cursor around and expect this to not affect focus 14 | and activation. 15 | 16 | * Disable "click to activate", i.e., when a window is opened, the window 17 | manager should automatically activate it (give it input focus) and not 18 | wait for the user to click the window. 19 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_transform_skew.svg: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_transform_scale.svg: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/manual/examples/embeddedsvgviewer/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | 7 | #include "embeddedsvgviewer.h" 8 | 9 | int main(int argc, char** argv) 10 | { 11 | QApplication app(argc, argv); 12 | QString filePath; 13 | 14 | if (argc == 1) 15 | filePath = QLatin1String(":/files/default.svg"); 16 | else if (argc == 2) 17 | filePath = argv[1]; 18 | else { 19 | qDebug() << QLatin1String("Please specify an svg file!"); 20 | return -1; 21 | } 22 | 23 | EmbeddedSvgViewer viewer(filePath); 24 | 25 | viewer.showFullScreen(); 26 | 27 | #ifdef QT_KEYPAD_NAVIGATION 28 | QApplication::setNavigationMode(Qt::NavigationModeCursorAuto); 29 | #endif 30 | return app.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_transform_translate.svg: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/symbolLikeGroupOpacity.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 32 | -------------------------------------------------------------------------------- /tests/libfuzzer/svg/qsvgrenderer/render/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(render LANGUAGES CXX) 6 | 7 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 8 | 9 | set(CMAKE_AUTOMOC ON) 10 | set(CMAKE_AUTORCC ON) 11 | set(CMAKE_AUTOUIC ON) 12 | 13 | find_package(Qt6 COMPONENTS Core) 14 | find_package(Qt6 COMPONENTS Svg) 15 | 16 | qt_add_executable(render 17 | main.cpp 18 | ) 19 | 20 | target_link_libraries(render PUBLIC 21 | Qt::Core 22 | Qt::Svg 23 | ) 24 | if(DEFINED ENV{LIB_FUZZING_ENGINE}) 25 | target_link_libraries(render PRIVATE 26 | $ENV{LIB_FUZZING_ENGINE} 27 | ) 28 | else() 29 | target_link_libraries(render PRIVATE 30 | -fsanitize=fuzzer 31 | ) 32 | endif() 33 | 34 | qt_import_plugins(render 35 | INCLUDE Qt::QMinimalIntegrationPlugin 36 | ) 37 | -------------------------------------------------------------------------------- /tests/auto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | add_subdirectory(cmake) 5 | 6 | # For now, don't built auto tests when QT_BUILD_MINIMAL_STATIC_TEST 7 | # is specified and the build is targeting iOS. QT_BUILD_MINIMAL_STATIC_TEST is used in our CI. 8 | # Regular non-cmake build tests shouldn't be built because the CI will try to run them and fail 9 | # due to missing simulator support. 10 | if(IOS AND QT_BUILD_MINIMAL_STATIC_TESTS) 11 | return() 12 | endif() 13 | 14 | if(TARGET Qt::Widgets) 15 | add_subdirectory(qsvgdevice) 16 | endif() 17 | if(TARGET Qt::Xml) 18 | add_subdirectory(qsvggenerator) 19 | endif() 20 | add_subdirectory(qsvgplugin) 21 | add_subdirectory(qicon_svg) 22 | if(NOT ANDROID) 23 | add_subdirectory(qsvgrenderer) 24 | endif() 25 | if (QT_FEATURE_cssparser) 26 | add_subdirectory(qsvgcss) 27 | endif() 28 | -------------------------------------------------------------------------------- /tests/auto/guiapplauncher/examples.txt: -------------------------------------------------------------------------------- 1 | "svg/svgviewer Example", "examples/svg/svgviewer", "svgviewer", 0, -1 2 | "svg/svggenerator Example", "examples/svg/svggenerator", "svggenerator", 10, -1 3 | "svg/embedded/desktopservices Example", "examples/svg/embedded/desktopservices", "desktopservices", 10, -1 4 | "svg/embedded/fluidlauncher Example", "examples/svg/embedded/fluidlauncher", "fluidlauncher", 10, -1 5 | "svg/draganddrop/delayedencoding Example", "examples/svg/draganddrop/delayedencoding", "delayedencoding", 0, -1 6 | "svg/opengl/framebufferobject Example", "examples/svg/opengl/framebufferobject", "framebufferobject", 10, -1 7 | "svg/richtext/textobject Example", "examples/svg/richtext/textobject", "textobject", 0, -1 8 | "svg/embeddedsvgviewer Example", "examples/svg/embeddedsvgviewer", "embeddedsvgviewer", 10, -1 9 | "svg/network/bearercloud Example", "examples/svg/network/bearercloud", "bearercloud", 0, -1 10 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animation_timing_function_steps.svg: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/svg/animation/qsvgcssanimation_p.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QSVGCSSANIMATION_P_H 5 | #define QSVGCSSANIMATION_P_H 6 | 7 | // 8 | // W A R N I N G 9 | // ------------- 10 | // 11 | // This file is not part of the Qt API. It exists purely as an 12 | // implementation detail. This header file may change from version to 13 | // version without notice, or even be removed. 14 | // 15 | // We mean it. 16 | // 17 | 18 | #include 19 | 20 | #include "qsvgabstractanimation_p.h" 21 | 22 | QT_BEGIN_NAMESPACE 23 | 24 | class Q_SVG_EXPORT QSvgCssAnimation : public QSvgAbstractAnimation 25 | { 26 | public: 27 | QSvgCssAnimation(); 28 | virtual AnimationType animationType() const override; 29 | }; 30 | 31 | QT_END_NAMESPACE 32 | 33 | #endif // QSVGCSSANIMATION_P_H 34 | -------------------------------------------------------------------------------- /dist/changes-5.0.1: -------------------------------------------------------------------------------- 1 | Qt 5.0.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.0.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://qt-project.org/doc/qt-5.0/ 8 | 9 | Some of the changes listed in this file include issue tracking numbers 10 | corresponding to tasks in the Qt Bug Tracker: 11 | 12 | http://bugreports.qt-project.org/ 13 | 14 | Each of these identifiers can be entered in the bug tracker to obtain more 15 | information about a particular change. 16 | 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | - This release contains only minor code improvements. 23 | -------------------------------------------------------------------------------- /src/svg/doc/src/qt6-changes.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2020 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | 4 | /*! 5 | \page qtsvg-changes-qt6.html 6 | \title Changes to Qt SVG 7 | \ingroup changes-qt-5-to-6 8 | \brief Migrate Qt SVG to Qt 6. 9 | 10 | Qt 6 is a result of the conscious effort to make the framework more 11 | efficient and easy to use. 12 | 13 | We try to maintain binary and source compatibility for all the public 14 | APIs in each release. But some changes were inevitable in an effort to 15 | make Qt a better framework. 16 | 17 | In this topic we summarize those changes in Qt SVG, and provide 18 | guidance to handle them. 19 | 20 | \section1 Library split 21 | 22 | The QtSvg module has been split into two libraries, with those classes 23 | depending on QtWidgets living in a separate library, QtSvgWidgets. 24 | */ 25 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_transform_list_order.svg: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/manual/examples/textobject/svgtextobject.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef SVGTEXTOBJECT_H 5 | #define SVGTEXTOBJECT_H 6 | 7 | #include 8 | 9 | QT_BEGIN_NAMESPACE 10 | class QTextDocument; 11 | class QTextFormat; 12 | class QPainter; 13 | class QRectF; 14 | class QSizeF; 15 | QT_END_NAMESPACE 16 | 17 | //![0] //![1] 18 | class SvgTextObject : public QObject, public QTextObjectInterface 19 | { 20 | Q_OBJECT 21 | Q_INTERFACES(QTextObjectInterface) 22 | //![1] 23 | 24 | public: 25 | QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, 26 | const QTextFormat &format) override; 27 | void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, 28 | int posInDocument, const QTextFormat &format) override; 29 | }; 30 | //![0] 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /tests/manual/examples/textobject/window.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef WINDOW_H 5 | #define WINDOW_H 6 | 7 | #include 8 | #include 9 | 10 | QT_BEGIN_NAMESPACE 11 | class QTextEdit; 12 | class QLineEdit; 13 | class QPushButton; 14 | class QLabel; 15 | QT_END_NAMESPACE 16 | 17 | //![0] 18 | class Window : public QWidget 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | enum { SvgTextFormat = QTextFormat::UserObject + 1 }; 24 | enum SvgProperties { SvgData = 1 }; 25 | 26 | Window(); 27 | 28 | private slots: 29 | void insertTextObject(); 30 | 31 | private: 32 | void setupTextObject(); 33 | void setupGui(); 34 | 35 | private: 36 | QTextEdit *textEdit; 37 | QLabel *fileNameLabel; 38 | QLineEdit *fileNameLineEdit; 39 | QPushButton *insertTextObjectButton; 40 | }; 41 | //![0] 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/filter_premultiplied_3.svg: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dist/changes-5.12.3: -------------------------------------------------------------------------------- 1 | Qt 5.12.3 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.12.0 through 5.12.2. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.12 series is binary compatible with the 5.11.x series. 10 | Applications compiled for 5.11 will continue to run with 5.12. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - [QTBUG-74083] Fixed leak on parsing failure. 21 | - [QTBUG-74129] Fixed possible heap overflow in path parsing. 22 | - [QTBUG-74189] Fixed crash with recursive gradient references. 23 | -------------------------------------------------------------------------------- /src/svg/animation/qsvgeasinginterface_p.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2025 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QSVGEASINGINTERFACE_P_H 5 | #define QSVGEASINGINTERFACE_P_H 6 | 7 | // 8 | // W A R N I N G 9 | // ------------- 10 | // 11 | // This file is not part of the Qt API. It exists purely as an 12 | // implementation detail. This header file may change from version to 13 | // version without notice, or even be removed. 14 | // 15 | // We mean it. 16 | // 17 | 18 | #include 19 | #include 20 | 21 | QT_BEGIN_NAMESPACE 22 | 23 | class Q_SVG_EXPORT QSvgEasingInterface 24 | { 25 | public: 26 | virtual ~QSvgEasingInterface() = default; 27 | virtual qreal progress(qreal t) = 0; 28 | }; 29 | 30 | using QSvgEasingInterfacePtr = std::unique_ptr; 31 | 32 | QT_END_NAMESPACE 33 | 34 | #endif // QSVGEASINGINTERFACE_P_H 35 | -------------------------------------------------------------------------------- /tests/benchmarks/svg/qsvgrenderer/data/text.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod 5 | tempor incidunt ut labore 6 | et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud 7 | exercitation ullamco laboris 8 | nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in 9 | voluptate velit esse 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/baseline/data/svg_12_testsuite/LICENSE.txt: -------------------------------------------------------------------------------- 1 | https://www.w3.org/copyright/test-suites-licenses/ 2 | 3 | The test cases are distributed under a 3-clause BSD license for software development, bug tracking, and other applications that do not require assertions of performance to the public or implied claims of conformance to a W3C Specification. See summary of 3-clause BSD License. 4 | 5 | Under the 3-clause BSD license, tests can be copied, altered, and integrated into software development tools, bug tracking tools, etc. This license allows developers, commercial vendors, and open source projects to copy tests and alter them as they wish to test and improve their software. However, if changes are made, the derivative work must not be distributed with W3C logos, unless W3C gives explicit permission. 6 | 7 | Note: It is explicitly understood that clause 3 of the BSD license prohibits the assertion of performance claims with respect to W3C Specifications by claiming successful passing of modified tests. 8 | 9 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_transform_list_order2.svg: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/text_with_opacities.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Qt Svg 5 | Qt Svg 6 | Qt Svg 7 | Qt Svg 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /dist/changes-5.0.2: -------------------------------------------------------------------------------- 1 | Qt 5.0.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.0.0 and 5.0.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://qt-project.org/doc/qt-5.0/ 8 | 9 | Some of the changes listed in this file include issue tracking numbers 10 | corresponding to tasks in the Qt Bug Tracker: 11 | 12 | http://bugreports.qt-project.org/ 13 | 14 | Each of these identifiers can be entered in the bug tracker to obtain more 15 | information about a particular change. 16 | 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | General Improvements 23 | -------------------- 24 | 25 | - This release contains only minor code improvements. 26 | -------------------------------------------------------------------------------- /tests/baseline/qsvgrenderer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) 5 | cmake_minimum_required(VERSION 3.16) 6 | project(tst_baseline_qsvgrenderer LANGUAGES CXX) 7 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) 8 | endif() 9 | 10 | # Collect test data 11 | list(APPEND test_data "../data") 12 | set(BASELINE_DIR "../../../../qtbase/tests/baseline/shared") 13 | 14 | qt_internal_add_test(tst_baseline_qsvgrenderer 15 | SOURCES 16 | ${BASELINE_DIR}/baselineprotocol.cpp 17 | ${BASELINE_DIR}/baselineprotocol.h 18 | ${BASELINE_DIR}/lookup3.cpp 19 | ${BASELINE_DIR}/qbaselinetest.cpp 20 | ${BASELINE_DIR}/qbaselinetest.h 21 | tst_baseline_qsvgrenderer.cpp 22 | INCLUDE_DIRECTORIES 23 | ${BASELINE_DIR} 24 | LIBRARIES 25 | Qt::SvgPrivate 26 | Qt::Network 27 | TESTDATA ${test_data} 28 | ) 29 | -------------------------------------------------------------------------------- /src/svg/qsvganimate.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #include "qsvganimate_p.h" 5 | 6 | QT_BEGIN_NAMESPACE 7 | 8 | QSvgAnimateNode::QSvgAnimateNode(QSvgNode *parent) 9 | : QSvgNode(parent) 10 | , m_end(0) 11 | , m_fill(Fill::Freeze) 12 | , m_additive(Additive::Replace) 13 | { 14 | m_easing = std::make_unique(); 15 | } 16 | 17 | void QSvgAnimateNode::setRunningTime(int startMs, int durMs, int endMs, int by) 18 | { 19 | Q_UNUSED(by) 20 | m_start = startMs; 21 | m_end = endMs; 22 | m_duration = durMs; 23 | } 24 | 25 | void QSvgAnimateNode::drawCommand(QPainter *p, QSvgExtraStates &states) 26 | { 27 | Q_UNUSED(p) 28 | Q_UNUSED(states) 29 | } 30 | 31 | bool QSvgAnimateNode::shouldDrawNode(QPainter *p, QSvgExtraStates &states) const 32 | { 33 | Q_UNUSED(p) 34 | Q_UNUSED(states) 35 | return false; 36 | } 37 | 38 | QT_END_NAMESPACE 39 | -------------------------------------------------------------------------------- /dist/changes-5.11.0: -------------------------------------------------------------------------------- 1 | Qt 5.11 introduces many new features and improvements as well as bugfixes 2 | over the 5.10.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | http://doc.qt.io/qt-5/index.html 6 | 7 | The Qt version 5.11 series is binary compatible with the 5.10.x series. 8 | Applications compiled for 5.10 will continue to run with 5.11. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | https://bugreports.qt.io/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | **************************************************************************** 19 | * Qt 5.11.0 Changes * 20 | **************************************************************************** 21 | 22 | - This release contains only minor code improvements. 23 | -------------------------------------------------------------------------------- /dist/changes-5.1.0: -------------------------------------------------------------------------------- 1 | Qt 5.1 introduces many new features and improvements as well as bugfixes 2 | over the 5.0.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | http://qt-project.org/doc/qt-5.1 6 | 7 | The Qt version 5.1 series is binary compatible with the 5.0.x series. 8 | Applications compiled for 5.0 will continue to run with 5.1. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | http://bugreports.qt-project.org/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | - This release contains only minor code improvements. 23 | -------------------------------------------------------------------------------- /dist/changes-5.14.0: -------------------------------------------------------------------------------- 1 | Qt 5.14 introduces many new features and improvements as well as bugfixes 2 | over the 5.13.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | https://doc.qt.io/qt-5/index.html 6 | 7 | The Qt version 5.14 series is binary compatible with the 5.13.x series. 8 | Applications compiled for 5.13 will continue to run with 5.14. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | https://bugreports.qt.io/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | - [QTBUG-70256] Fix rendering of SVGs with both size and viewBox 23 | -------------------------------------------------------------------------------- /src/svg/qtsvgglobal.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Intel Corporation. 2 | // Copyright (C) 2023 The Qt Company Ltd. 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 4 | 5 | #ifndef QTSVGGLOBAL_H 6 | #define QTSVGGLOBAL_H 7 | 8 | #include 9 | #include 10 | 11 | QT_BEGIN_NAMESPACE 12 | 13 | namespace QtSvg { 14 | 15 | enum Option : quint32 { 16 | NoOption = 0x00, 17 | Tiny12FeaturesOnly = 0x01, 18 | AssumeTrustedSource = 0x02, 19 | // reserved for non-animation options: 0x04 20 | // reserved for non-animation options: 0x08 21 | DisableSMILAnimations = 0x10, 22 | DisableCSSAnimations = 0x20, 23 | // reserved for potentially other animations: 0x40 24 | // reserved for potentially other animations: 0x80 25 | DisableAnimations = 0xf0, 26 | // next value for non-animations: 0x0100 27 | }; 28 | Q_DECLARE_FLAGS(Options, Option) 29 | Q_DECLARE_OPERATORS_FOR_FLAGS(Options) 30 | 31 | } 32 | 33 | QT_END_NAMESPACE 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /tests/libfuzzer/svg/qsvgrenderer/render/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | // silence warnings 11 | static QtMessageHandler mh = qInstallMessageHandler([](QtMsgType, const QMessageLogContext &, 12 | const QString &) {}); 13 | 14 | extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) { 15 | static int argc = 3; 16 | static char arg1[] = "fuzzer"; 17 | static char arg2[] = "-platform"; 18 | static char arg3[] = "minimal"; 19 | static char *argv[] = {arg1, arg2, arg3, nullptr}; 20 | static QGuiApplication qga(argc, argv); 21 | static QImage image(377, 233, QImage::Format_RGB32); 22 | QPainter painter(&image); 23 | QSvgRenderer renderer(QByteArray::fromRawData(Data, Size)); 24 | renderer.render(&painter); 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /dist/changes-5.9.5: -------------------------------------------------------------------------------- 1 | Qt 5.9.5 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.9.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.9 series is binary compatible with the 5.8.x series. 10 | Applications compiled for 5.8 will continue to run with 5.9. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * Qt 5.9.5 Changes * 22 | **************************************************************************** 23 | 24 | - This release contains only minor code improvements. 25 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/markerBoundingBoxCheck.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 | 18 | 29 | 30 | 40 | 41 | -------------------------------------------------------------------------------- /tests/benchmarks/svg/qsvgrenderer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## tst_bench_qsvgrenderer Binary: 6 | ##################################################################### 7 | 8 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) 9 | cmake_minimum_required(VERSION 3.16) 10 | project(tst_bench_qsvgrenderer LANGUAGES CXX) 11 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) 12 | endif() 13 | 14 | qt_internal_add_benchmark(tst_bench_qsvgrenderer 15 | SOURCES 16 | tst_qsvgrenderer.cpp 17 | LIBRARIES 18 | Qt::Gui 19 | Qt::Test 20 | Qt::Svg 21 | ) 22 | 23 | qt_internal_add_resource(tst_bench_qsvgrenderer "tst_bench_qsvgrenderer_dat" 24 | PREFIX 25 | "/" 26 | FILES 27 | "./data/tiger.svg" 28 | "./data/filter.svg" 29 | "./data/mask.svg" 30 | "./data/opacity.svg" 31 | "./data/text.svg" 32 | ) 33 | -------------------------------------------------------------------------------- /dist/changes-5.11.1: -------------------------------------------------------------------------------- 1 | Qt 5.11.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.11.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.11 series is binary compatible with the 5.10.x series. 10 | Applications compiled for 5.10 will continue to run with 5.11. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * Qt 5.11.1 Changes * 22 | **************************************************************************** 23 | 24 | - This release contains only minor code improvements. 25 | -------------------------------------------------------------------------------- /src/plugins/iconengines/svgiconengine/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #include 5 | #include 6 | 7 | #include "qsvgiconengine.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | QT_BEGIN_NAMESPACE 14 | 15 | class QSvgIconPlugin : public QIconEnginePlugin 16 | { 17 | Q_OBJECT 18 | #ifndef QT_NO_COMPRESS 19 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "qsvgiconengine.json") 20 | #else 21 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QIconEngineFactoryInterface" FILE "qsvgiconengine-nocompress.json") 22 | #endif 23 | 24 | public: 25 | QIconEngine *create(const QString &filename = QString()) override; 26 | }; 27 | 28 | QIconEngine *QSvgIconPlugin::create(const QString &) 29 | { 30 | QSvgIconEngine *engine = new QSvgIconEngine; 31 | return engine; 32 | } 33 | 34 | QT_END_NAMESPACE 35 | 36 | #include "main.moc" 37 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/fluidlauncher/demoapplication.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef DEMO_APPLICATION_H 5 | #define DEMO_APPLICATION_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class DemoApplication : public QObject 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | DemoApplication(QString executableName, QString caption, QString imageName, QStringList args); 17 | void launch(); 18 | QImage getImage() const; 19 | QString getCaption(); 20 | 21 | public slots: 22 | void processStarted(); 23 | void processFinished(int exitCode, QProcess::ExitStatus exitStatus); 24 | void processError(QProcess::ProcessError err); 25 | 26 | signals: 27 | void demoStarted(); 28 | void demoFinished(); 29 | 30 | private: 31 | QString imagePath; 32 | QString appCaption; 33 | QString executablePath; 34 | QStringList arguments; 35 | QProcess process; 36 | }; 37 | 38 | 39 | 40 | 41 | #endif 42 | 43 | 44 | -------------------------------------------------------------------------------- /dist/changes-5.9.6: -------------------------------------------------------------------------------- 1 | Qt 5.9.6 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.9.0 through 5.9.5. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.9 series is binary compatible with the 5.8.x series. 10 | Applications compiled for 5.8 will continue to run with 5.9. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * Qt 5.9.6 Changes * 22 | **************************************************************************** 23 | 24 | - This release contains only minor code improvements. 25 | -------------------------------------------------------------------------------- /dist/changes-5.1.1: -------------------------------------------------------------------------------- 1 | Qt 5.1.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.1.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://qt-project.org/doc/qt-5.1/ 8 | 9 | The Qt version 5.1 series is binary compatible with the 5.0.x series. 10 | Applications compiled for 5.0 will continue to run with 5.1. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | http://bugreports.qt-project.org/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | 21 | **************************************************************************** 22 | * General * 23 | **************************************************************************** 24 | 25 | - This release contains only minor code improvements. 26 | -------------------------------------------------------------------------------- /dist/changes-5.11.2: -------------------------------------------------------------------------------- 1 | Qt 5.11.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.11.0 through 5.11.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.11 series is binary compatible with the 5.10.x series. 10 | Applications compiled for 5.10 will continue to run with 5.11. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * Qt 5.11.2 Changes * 22 | **************************************************************************** 23 | 24 | - This release contains only minor code improvements. 25 | -------------------------------------------------------------------------------- /dist/changes-5.9.4: -------------------------------------------------------------------------------- 1 | Qt 5.9.4 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.9.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.9 series is binary compatible with the 5.8.x series. 10 | Applications compiled for 5.8 will continue to run with 5.9. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * Qt 5.9.4 Changes * 22 | **************************************************************************** 23 | 24 | - [QTBUG-64425] Fix crash on recursive self-referral in element 25 | 26 | -------------------------------------------------------------------------------- /src/svg/qtsvgglobal_p.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QTSVGGLOBAL_P_H 5 | #define QTSVGGLOBAL_P_H 6 | 7 | // 8 | // W A R N I N G 9 | // ------------- 10 | // 11 | // This file is not part of the Qt API. It exists purely as an 12 | // implementation detail. This header file may change from version to 13 | // version without notice, or even be removed. 14 | // 15 | // We mean it. 16 | // 17 | 18 | #include 19 | #include 20 | 21 | QT_BEGIN_NAMESPACE 22 | 23 | namespace QtSvg { 24 | 25 | enum class UnitTypes : quint32 { 26 | unknown, 27 | objectBoundingBox, 28 | userSpaceOnUse 29 | }; 30 | 31 | enum class AnimatorType : quint32 { 32 | Controlled, 33 | Automatic, 34 | }; 35 | 36 | enum class OffsetRotateType : quint32 { 37 | Auto, 38 | Angle, 39 | AutoAngle, 40 | Reverse, 41 | ReverseAngle 42 | }; 43 | 44 | } 45 | 46 | QT_END_NAMESPACE 47 | 48 | #endif // QTSVGGLOBAL_P_H 49 | -------------------------------------------------------------------------------- /src/plugins/imageformats/svg/qsvgiohandler.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QSVGIOHANDLER_H 5 | #define QSVGIOHANDLER_H 6 | 7 | #include 8 | 9 | #ifndef QT_NO_SVGRENDERER 10 | 11 | QT_BEGIN_NAMESPACE 12 | 13 | class QImage; 14 | class QByteArray; 15 | class QIODevice; 16 | class QVariant; 17 | class QSvgIOHandlerPrivate; 18 | 19 | class QSvgIOHandler : public QImageIOHandler 20 | { 21 | public: 22 | QSvgIOHandler(); 23 | ~QSvgIOHandler(); 24 | bool canRead() const override; 25 | bool read(QImage *image) override; 26 | static bool canRead(QIODevice *device); 27 | QVariant option(ImageOption option) const override; 28 | void setOption(ImageOption option, const QVariant & value) override; 29 | bool supportsOption(ImageOption option) const override; 30 | 31 | private: 32 | QSvgIOHandlerPrivate *d; 33 | }; 34 | 35 | QT_END_NAMESPACE 36 | 37 | #endif // QT_NO_SVGRENDERER 38 | #endif // QSVGIOHANDLER_H 39 | -------------------------------------------------------------------------------- /tests/auto/qsvgrenderer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## tst_qsvgrenderer Test: 6 | ##################################################################### 7 | 8 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) 9 | cmake_minimum_required(VERSION 3.16) 10 | project(tst_qsvgrenderer LANGUAGES CXX) 11 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) 12 | endif() 13 | 14 | qt_internal_add_test(tst_qsvgrenderer 15 | SOURCES 16 | tst_qsvgrenderer.cpp 17 | DEFINES 18 | SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" 19 | LIBRARIES 20 | Qt::Gui 21 | Qt::GuiPrivate 22 | Qt::Svg 23 | ) 24 | 25 | # Resources: 26 | set(resources_resource_files 27 | "heart.svgz" 28 | "large.svg" 29 | "large.svgz" 30 | ) 31 | 32 | qt_internal_add_resource(tst_qsvgrenderer "resources" 33 | PREFIX 34 | "/" 35 | FILES 36 | ${resources_resource_files} 37 | ) 38 | -------------------------------------------------------------------------------- /tests/auto/qsvggenerator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## tst_qsvggenerator Test: 6 | ##################################################################### 7 | 8 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) 9 | cmake_minimum_required(VERSION 3.16) 10 | project(tst_qsvggenerator LANGUAGES CXX) 11 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) 12 | endif() 13 | 14 | qt_internal_add_test(tst_qsvggenerator 15 | SOURCES 16 | tst_qsvggenerator.cpp 17 | LIBRARIES 18 | Qt::Gui 19 | Qt::GuiPrivate 20 | Qt::Svg 21 | Qt::Xml 22 | ) 23 | 24 | # Resources: 25 | set(qmake_immediate_resource_files 26 | "referenceSvgs/fileName_output.svg" 27 | "referenceSvgs/radial_gradient.svg" 28 | ) 29 | 30 | qt_internal_add_resource(tst_qsvggenerator "qmake_immediate" 31 | PREFIX 32 | "/" 33 | FILES 34 | ${qmake_immediate_resource_files} 35 | ) 36 | 37 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/maskuseandinheritance.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /dist/changes-5.15.0: -------------------------------------------------------------------------------- 1 | Qt 5.15 introduces many new features and improvements as well as bugfixes 2 | over the 5.14.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | https://doc.qt.io/qt-5/index.html 6 | 7 | The Qt version 5.15 series is binary compatible with the 5.14.x series. 8 | Applications compiled for 5.14 will continue to run with 5.15. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | https://bugreports.qt.io/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | **************************************************************************** 19 | * QSvgRenderer * 20 | **************************************************************************** 21 | 22 | - [QTBUG-81259] Introduced aspect ratio mode property, so that rendering 23 | may be set to preserve the view box aspect ratio. 24 | -------------------------------------------------------------------------------- /tests/benchmarks/svg/qsvgrenderer/data/opacity.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/manual/examples/textobject/svgtextobject.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | 7 | #include "svgtextobject.h" 8 | #include "window.h" 9 | 10 | //![0] 11 | QSizeF SvgTextObject::intrinsicSize(QTextDocument * /*doc*/, int /*posInDocument*/, 12 | const QTextFormat &format) 13 | { 14 | QImage bufferedImage = qvariant_cast(format.property(Window::SvgData)); 15 | QSize size = bufferedImage.size(); 16 | 17 | if (size.height() > 25) 18 | size *= 25.0 / (double) size.height(); 19 | 20 | return QSizeF(size); 21 | } 22 | //![0] 23 | 24 | //![1] 25 | void SvgTextObject::drawObject(QPainter *painter, const QRectF &rect, 26 | QTextDocument * /*doc*/, int /*posInDocument*/, 27 | const QTextFormat &format) 28 | { 29 | QImage bufferedImage = qvariant_cast(format.property(Window::SvgData)); 30 | 31 | painter->drawImage(rect, bufferedImage); 32 | } 33 | //![1] 34 | 35 | -------------------------------------------------------------------------------- /dist/changes-5.10.1: -------------------------------------------------------------------------------- 1 | Qt 5.10.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.10.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.10 series is binary compatible with the 5.9.x series. 10 | Applications compiled for 5.9 will continue to run with 5.10. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | This release contains all fixes included in the Qt 5.9.4 release. 21 | 22 | **************************************************************************** 23 | * Qt 5.10.1 Changes * 24 | **************************************************************************** 25 | 26 | - This release contains only minor code improvements. 27 | -------------------------------------------------------------------------------- /dist/changes-5.9.1: -------------------------------------------------------------------------------- 1 | Qt 5.9.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.9.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.9 series is binary compatible with the 5.8.x series. 10 | Applications compiled for 5.8 will continue to run with 5.9. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * Library * 22 | **************************************************************************** 23 | 24 | Important Changes 25 | ----------------- 26 | - QSvgRenderer: 27 | * Parses the stroke-dasharray attributes in a SVG file correctly. 28 | 29 | -------------------------------------------------------------------------------- /examples/svg/svgviewer/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2025 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "mainwindow.h" 10 | 11 | int main(int argc, char **argv) 12 | { 13 | QApplication app(argc, argv); 14 | QCoreApplication::setApplicationName("SVG Viewer"); 15 | QGuiApplication::setApplicationDisplayName(QCoreApplication::applicationName()); 16 | QCoreApplication::setOrganizationName("QtProject"); 17 | QCoreApplication::setApplicationVersion(QT_VERSION_STR); 18 | 19 | QCommandLineParser parser; 20 | parser.setApplicationDescription("Qt SVG Viewer"); 21 | parser.addHelpOption(); 22 | parser.addVersionOption(); 23 | parser.addPositionalArgument("file", "The file to open."); 24 | parser.process(app); 25 | 26 | MainWindow window; 27 | if (!window.loadFile(parser.positionalArguments().value(0, QLatin1String(":/files/abstract_tree.svg")))) 28 | return -1; 29 | window.show(); 30 | return app.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /tests/manual/examples/draganddrop/delayedencoding/images/example.svg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | Sphere 9 | A gradient filled sphere. 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/manual/examples/svggenerator/displaywidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef DISPLAYWIDGET_H 5 | #define DISPLAYWIDGET_H 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | //! [DisplayWidget class definition] 13 | class DisplayWidget : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | enum Shape { House = 0, Car = 1 }; 19 | enum Background { Sky = 0, Trees = 1, Road = 2 }; 20 | 21 | DisplayWidget(QWidget *parent = 0); 22 | QColor color() const; 23 | void paint(QPainter &painter); 24 | 25 | public slots: 26 | void setBackground(Background background); 27 | void setColor(const QColor &color); 28 | void setShape(Shape shape); 29 | 30 | protected: 31 | void paintEvent(QPaintEvent *event) override; 32 | 33 | private: 34 | Background background; 35 | QColor shapeColor; 36 | Shape shape; 37 | QHash shapeMap; 38 | QPainterPath moon; 39 | QPainterPath tree; 40 | }; 41 | //! [DisplayWidget class definition] 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/svgwidgets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## SvgWidgets Module: 6 | ##################################################################### 7 | 8 | qt_internal_add_module(SvgWidgets 9 | NO_PRIVATE_MODULE 10 | SOURCES 11 | qsvgwidget.cpp qsvgwidget.h 12 | qtsvgwidgetsglobal.h 13 | DEFINES 14 | QT_NO_CONTEXTLESS_CONNECT 15 | QT_NO_USING_NAMESPACE 16 | LIBRARIES 17 | Qt::CorePrivate 18 | Qt::GuiPrivate 19 | Qt::WidgetsPrivate 20 | PUBLIC_LIBRARIES 21 | Qt::Core 22 | Qt::Gui 23 | Qt::Svg 24 | Qt::Widgets 25 | ) 26 | 27 | qt_internal_extend_target(SvgWidgets CONDITION QT_FEATURE_graphicsview 28 | SOURCES 29 | qgraphicssvgitem.cpp qgraphicssvgitem.h 30 | ) 31 | 32 | ## Scopes: 33 | ##################################################################### 34 | 35 | qt_internal_extend_target(SvgWidgets CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") 36 | LINK_OPTIONS 37 | "/BASE:0x66000000" 38 | ) 39 | -------------------------------------------------------------------------------- /examples/svg/svgviewer/exportdialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2025 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef EXPORTDIALOG_H 5 | #define EXPORTDIALOG_H 6 | 7 | #include 8 | 9 | QT_BEGIN_NAMESPACE 10 | class QLineEdit; 11 | class QSpinBox; 12 | QT_END_NAMESPACE 13 | 14 | class ExportDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | public: 18 | explicit ExportDialog(QWidget *parent = 0); 19 | 20 | QSize exportSize() const; 21 | void setExportSize(const QSize &); 22 | 23 | QString exportFileName() const; 24 | void setExportFileName(const QString &); 25 | 26 | void accept() override; 27 | 28 | private slots: 29 | void browse(); 30 | void resetExportSize(); 31 | void exportWidthChanged(int width); 32 | void exportHeightChanged(int height); 33 | 34 | private: 35 | void setExportWidthBlocked(int width); 36 | void setExportHeightBlocked(int height); 37 | 38 | QLineEdit *m_fileNameLineEdit; 39 | QSpinBox *m_widthSpinBox; 40 | QSpinBox *m_heightSpinBox; 41 | QSize m_defaultSize; 42 | qreal m_aspectRatio; 43 | }; 44 | 45 | #endif // EXPORTDIALOG_H 46 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/desktopservices/linktab.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef LINKTAB_H_ 5 | #define LINKTAB_H_ 6 | 7 | // EXTERNAL INCLUDES 8 | 9 | // INTERNAL INCLUDES 10 | #include "contenttab.h" 11 | 12 | // FORWARD DECLARATIONS 13 | QT_BEGIN_NAMESPACE 14 | class QWidget; 15 | class QListWidgetItem; 16 | QT_END_NAMESPACE 17 | 18 | // CLASS DECLARATION 19 | 20 | /** 21 | * LinkTab class. 22 | * 23 | * This class implements tab for opening http and mailto links. 24 | */ 25 | class LinkTab : public ContentTab 26 | { 27 | Q_OBJECT 28 | 29 | public: // Constructors & Destructors 30 | LinkTab(QWidget *parent); 31 | ~LinkTab(); 32 | 33 | protected: // Derived Methods 34 | void populateListWidget() override; 35 | QUrl itemUrl(QListWidgetItem *item) override; 36 | void handleErrorInOpen(QListWidgetItem *item) override; 37 | 38 | private: // Used variables 39 | QListWidgetItem *m_WebItem; 40 | QListWidgetItem *m_MailToItem; 41 | 42 | private: // Owned variables 43 | 44 | }; 45 | 46 | #endif // CONTENTTAB_H_ 47 | 48 | // End of File 49 | -------------------------------------------------------------------------------- /src/svgwidgets/qsvgwidget.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2020 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QSVGWIDGET_H 5 | #define QSVGWIDGET_H 6 | 7 | #include 8 | #include 9 | 10 | 11 | QT_BEGIN_NAMESPACE 12 | 13 | 14 | class QSvgWidgetPrivate; 15 | class QPaintEvent; 16 | class QSvgRenderer; 17 | 18 | class Q_SVGWIDGETS_EXPORT QSvgWidget : public QWidget 19 | { 20 | Q_OBJECT 21 | public: 22 | QSvgWidget(QWidget *parent = nullptr); 23 | QSvgWidget(const QString &file, QWidget *parent = nullptr); 24 | ~QSvgWidget(); 25 | 26 | QSvgRenderer *renderer() const; 27 | 28 | QSize sizeHint() const override; 29 | 30 | QtSvg::Options options() const; 31 | void setOptions(QtSvg::Options options); 32 | public Q_SLOTS: 33 | void load(const QString &file); 34 | void load(const QByteArray &contents); 35 | protected: 36 | void paintEvent(QPaintEvent *event) override; 37 | 38 | private: 39 | Q_DISABLE_COPY(QSvgWidget) 40 | Q_DECLARE_PRIVATE(QSvgWidget) 41 | }; 42 | 43 | QT_END_NAMESPACE 44 | 45 | #endif // QSVGWIDGET_H 46 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/blur.svg: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | 6 | include(.cmake.conf) 7 | project(QtSvg 8 | VERSION "${QT_REPO_MODULE_VERSION}" 9 | DESCRIPTION "Qt SVG Libraries" 10 | HOMEPAGE_URL "https://qt.io/" 11 | LANGUAGES CXX C 12 | ) 13 | 14 | find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals) 15 | 16 | # This should be called as early as possible, just after find_package(BuildInternals) where it is 17 | # defined. 18 | qt_internal_project_setup() 19 | 20 | find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Core) 21 | find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Widgets Xml Network) 22 | 23 | # Needed for examples to configure properly when not using ExternalProject and when 24 | # Qt is configured with a bundled zlib. 25 | # Otherwise Qt6SvgDependencies will claim Qt6ZlibPrivate_FOUND is FALSE because we 26 | # set QT_NO_CREATE_TARGETS to TRUE when building examples in-tree. 27 | if(NOT QT_FEATURE_system_zlib) 28 | find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS ZlibPrivate) 29 | endif() 30 | 31 | qt_build_repo() 32 | -------------------------------------------------------------------------------- /tests/manual/rendertestsuite/README: -------------------------------------------------------------------------------- 1 | This little helper program can be used together with the SVG Tiny 1.2 test 2 | suite to determine the visual impact of changes to the renderer on the basis of 3 | the test suite. 4 | 5 | Suppose you have the test suite installed in ~/tests, then you can create a 6 | base line of renderings of all the SVG images by running 7 | 8 | mkdir baseline 9 | ./rendertestsuite create-baseline ~/tests 10 | 11 | and the output will be stored in the 'baseline/' sub-directory. 12 | 13 | After making changes to the renderer, you can create a new set of images by running 14 | 15 | mkdir difference 16 | ./rendertestsuite diff ~/tests 17 | 18 | and side-by-side images of the old and the new images in case they differ will 19 | be stored in the sub-directory 'difference/'. 20 | 21 | An easy way to inspect the output is by using KDE's gwenview: 22 | 23 | gwenview difference/ 24 | 25 | 26 | Note that due to rounding errors there will always be subtle differences, even 27 | when not doing any changes to the renderer. 28 | 29 | 30 | You can find the test suite at 31 | 32 | https://www.w3.org/Graphics/SVG/WG/wiki/Test_Suite_Overview#SVG_1.2_Tiny_Test_Suite:_12_September_2008 33 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/fluidlauncher/fluidlauncher.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef FLUID_LAUNCHER_H 5 | #define FLUID_LAUNCHER_H 6 | 7 | #include 8 | #include 9 | 10 | #include "pictureflow.h" 11 | #include "slideshow.h" 12 | #include "demoapplication.h" 13 | 14 | class FluidLauncher : public QStackedWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | FluidLauncher(QStringList* args); 20 | ~FluidLauncher(); 21 | 22 | public slots: 23 | void launchApplication(int index); 24 | void switchToLauncher(); 25 | void resetInputTimeout(); 26 | void inputTimedout(); 27 | void demoFinished(); 28 | 29 | protected: 30 | void changeEvent(QEvent *event) override; 31 | 32 | private: 33 | PictureFlow* pictureFlowWidget; 34 | SlideShow* slideShowWidget; 35 | QTimer* inputTimer; 36 | QList demoList; 37 | 38 | bool loadConfig(QString configPath); 39 | void populatePictureFlow(); 40 | void switchToSlideshow(); 41 | void parseDemos(QXmlStreamReader& reader); 42 | void parseSlideshow(QXmlStreamReader& reader); 43 | 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/marker2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 34 | 35 | 36 | 43 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_props_multiple_values.svg: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/mask1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/svg/LICENSE.XSVG.txt: -------------------------------------------------------------------------------- 1 | Copyright 2002 USC/Information Sciences Institute 2 | 3 | Permission to use, copy, modify, distribute, and sell this software 4 | and its documentation for any purpose is hereby granted without 5 | fee, provided that the above copyright notice appear in all copies 6 | and that both that copyright notice and this permission notice 7 | appear in supporting documentation, and that the name of 8 | Information Sciences Institute not be used in advertising or 9 | publicity pertaining to distribution of the software without 10 | specific, written prior permission. Information Sciences Institute 11 | makes no representations about the suitability of this software for 12 | any purpose. It is provided "as is" without express or implied 13 | warranty. 14 | 15 | INFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD 16 | TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF 17 | MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES 18 | INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 19 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA 20 | OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 21 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 22 | PERFORMANCE OF THIS SOFTWARE. 23 | -------------------------------------------------------------------------------- /LICENSES/HPND-sell-variant.txt: -------------------------------------------------------------------------------- 1 | Copyright 2002 USC/Information Sciences Institute 2 | 3 | Permission to use, copy, modify, distribute, and sell this software 4 | and its documentation for any purpose is hereby granted without 5 | fee, provided that the above copyright notice appear in all copies 6 | and that both that copyright notice and this permission notice 7 | appear in supporting documentation, and that the name of 8 | Information Sciences Institute not be used in advertising or 9 | publicity pertaining to distribution of the software without 10 | specific, written prior permission. Information Sciences Institute 11 | makes no representations about the suitability of this software for 12 | any purpose. It is provided "as is" without express or implied 13 | warranty. 14 | 15 | INFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD 16 | TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF 17 | MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES 18 | INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 19 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA 20 | OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 21 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 22 | PERFORMANCE OF THIS SOFTWARE. 23 | -------------------------------------------------------------------------------- /examples/svg/svgviewer/mainwindow.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2025 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef MAINWINDOW_H 5 | #define MAINWINDOW_H 6 | 7 | #include 8 | #include 9 | #include 10 | #include "svgview.h" 11 | 12 | QT_BEGIN_NAMESPACE 13 | 14 | namespace Ui { class MainWindow; } 15 | 16 | class QLabel; 17 | 18 | QT_END_NAMESPACE 19 | 20 | class MainWindow : public QMainWindow 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | MainWindow(); 26 | 27 | bool loadFile(const QString &path); 28 | 29 | public slots: 30 | void openFile(); 31 | void exportImage(); 32 | 33 | void setBackground(QAction *action); 34 | void setFeature(QAction *action); 35 | 36 | protected: 37 | bool eventFilter(QObject *object, QEvent *event) override; 38 | 39 | private slots: 40 | void fileModified(const QString &path); 41 | 42 | void updateZoomLabel(); 43 | void zoomIn(); 44 | void zoomOut(); 45 | void resetZoom(); 46 | 47 | private: 48 | Ui::MainWindow *ui; 49 | SvgView *m_svgView; 50 | QLabel *m_zoomLabel; 51 | 52 | QFileSystemWatcher m_watcher; 53 | QString m_currentPath; 54 | qreal m_scale = 1; 55 | }; 56 | 57 | #endif // MAINWINDOW_H 58 | -------------------------------------------------------------------------------- /dist/changes-5.14.1: -------------------------------------------------------------------------------- 1 | Qt 5.14.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.14.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.14 series is binary compatible with the 5.13.x series. 10 | Applications compiled for 5.13 will continue to run with 5.14. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * QSVGRenderer * 22 | **************************************************************************** 23 | 24 | - In Qt 5.14.0, rendering would keep aspect ratio implied by the 25 | viewbox, independently of the specified target area. This caused 26 | many regressions with existing code, so is reverted now in 27 | 5.14.1. The feature will instead be available as an opt-in in Qt 28 | 5.15. 29 | -------------------------------------------------------------------------------- /coin/axivion/ci_config_linux.json: -------------------------------------------------------------------------------- 1 | { 2 | "Project": { 3 | "BuildSystemIntegration": { 4 | "child_order": [ 5 | "GCCSetup", 6 | "CMake", 7 | "LinkLibraries" 8 | ] 9 | }, 10 | "CMake": { 11 | "_active": true, 12 | "_copy_from": "CMakeIntegration", 13 | "build_environment": {}, 14 | "build_options": "-j4", 15 | "generate_options": "--fresh", 16 | "generator": "Ninja" 17 | }, 18 | "GCCSetup": { 19 | "_active": true, 20 | "_copy_from": "Command", 21 | "build_command": "gccsetup --cc gcc --cxx g++ --config ../../../axivion/" 22 | }, 23 | "LinkLibraries": { 24 | "_active": true, 25 | "_copy_from": "AxivionLinker", 26 | "input_files": [ 27 | "build/lib/lib*.so*.ir" 28 | ], 29 | "ir": "build/$(env:TESTED_MODULE_COIN).ir", 30 | "plugin_files": [ 31 | "build/plugins/*/lib*.so*.ir" 32 | ] 33 | } 34 | }, 35 | "_Format": "1.0", 36 | "_Version": "7.6.2", 37 | "_VersionNum": [ 38 | 7, 39 | 6, 40 | 2, 41 | 12725 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /dist/changes-5.15.1: -------------------------------------------------------------------------------- 1 | Qt 5.15.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.15.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.15 series is binary compatible with the 5.14.x series. 10 | Applications compiled for 5.14 will continue to run with 5.15. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * QSvgRenderer * 22 | **************************************************************************** 23 | 24 | - [oss-fuzz 23643][oss-fuzz-24028] Fixed endless recursions with 25 | self-referencing nodes. 26 | 27 | - [oss-fuzz-24146] Fixed endless recursion when inflating gzipped svg. 28 | 29 | - [ozz-fuzz 23606][oss-fuzz-24131] Avoid integer overflows. 30 | 31 | - Fixed various divisions by zero. 32 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animation_timing_function_bezier.svg: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /tests/manual/examples/svgwidget/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(svgwidget LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 10 | set(INSTALL_EXAMPLESDIR "examples") 11 | endif() 12 | 13 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/svg/svgwidget") 14 | 15 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg SvgWidgets Widgets) 16 | 17 | qt_add_executable(svgwidget 18 | main.cpp 19 | ) 20 | 21 | set_target_properties(svgwidget PROPERTIES 22 | WIN32_EXECUTABLE FALSE 23 | MACOSX_BUNDLE TRUE 24 | ) 25 | 26 | target_link_libraries(svgwidget PUBLIC 27 | Qt::Core 28 | Qt::Gui 29 | Qt::Svg 30 | Qt::SvgWidgets 31 | Qt::Widgets 32 | ) 33 | 34 | # Resources: 35 | set(svgwidget_resource_files 36 | "files/bubbles.svg" 37 | "files/spheres.svg" 38 | ) 39 | 40 | qt6_add_resources(svgwidget "svgwidget" 41 | PREFIX 42 | "/" 43 | FILES 44 | ${svgwidget_resource_files} 45 | ) 46 | 47 | install(TARGETS svgwidget 48 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 49 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 50 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 51 | ) 52 | -------------------------------------------------------------------------------- /tests/auto/qsvgplugin/imageInclude.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_props_shorthand_longhand.svg: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /tests/manual/examples/textobject/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(textobject LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 10 | set(INSTALL_EXAMPLESDIR "examples") 11 | endif() 12 | 13 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/svg/richtext/textobject") 14 | 15 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg Widgets) 16 | 17 | qt_add_executable(textobject 18 | main.cpp 19 | svgtextobject.cpp svgtextobject.h 20 | window.cpp window.h 21 | ) 22 | 23 | set_target_properties(textobject PROPERTIES 24 | WIN32_EXECUTABLE TRUE 25 | MACOSX_BUNDLE TRUE 26 | ) 27 | 28 | target_link_libraries(textobject PUBLIC 29 | Qt::Core 30 | Qt::Gui 31 | Qt::Svg 32 | Qt::Widgets 33 | ) 34 | 35 | # Resources: 36 | set(resources_resource_files 37 | "files/heart.svg" 38 | ) 39 | 40 | qt6_add_resources(textobject "resources" 41 | PREFIX 42 | "/" 43 | FILES 44 | ${resources_resource_files} 45 | ) 46 | 47 | install(TARGETS textobject 48 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 49 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 50 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 51 | ) 52 | -------------------------------------------------------------------------------- /dist/changes-5.12.0: -------------------------------------------------------------------------------- 1 | Qt 5.12 introduces many new features and improvements as well as bugfixes 2 | over the 5.11.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | https://doc.qt.io/qt-5/index.html 6 | 7 | The Qt version 5.12 series is binary compatible with the 5.11.x series. 8 | Applications compiled for 5.11 will continue to run with 5.12. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | https://bugreports.qt.io/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | **************************************************************************** 19 | * General * 20 | **************************************************************************** 21 | 22 | - SVG Reading/Rendering: 23 | * [QTBUG-59978][QTBUG-67995] Fix objectBoundingBox transformed gradients 24 | * [QTBUG-69694] Fix parsing of forward referrals in elements 25 | 26 | - QIcon/QSvgIconEngine: 27 | * [QTBUG-67452] Made SVG icons behave like pixmap icons: An 28 | explicitly-set disabled icon is no longer additionally grayed out. 29 | -------------------------------------------------------------------------------- /examples/svg/svgviewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(svgviewer LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | set(CMAKE_AUTOUIC ON) 9 | 10 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 11 | set(INSTALL_EXAMPLESDIR "examples") 12 | endif() 13 | 14 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/svg/svgviewer") 15 | 16 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg Widgets) 17 | 18 | qt_add_executable(svgviewer 19 | exportdialog.cpp exportdialog.h 20 | main.cpp 21 | mainwindow.cpp mainwindow.h 22 | mainwindow.ui 23 | svgview.h svgview.cpp 24 | ) 25 | 26 | qt_add_resources(svgviewer "files" 27 | FILES 28 | files/abstract_tree.svg 29 | files/black.png 30 | files/white.png 31 | files/chequered.png 32 | ) 33 | 34 | set_target_properties(svgviewer PROPERTIES 35 | WIN32_EXECUTABLE FALSE 36 | MACOSX_BUNDLE TRUE 37 | ) 38 | 39 | target_link_libraries(svgviewer PUBLIC 40 | Qt::Core 41 | Qt::Gui 42 | Qt::Svg 43 | Qt::Widgets 44 | ) 45 | 46 | install(TARGETS svgviewer 47 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 48 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 49 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 50 | ) 51 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/fluidlauncher/slideshow.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef SLIDESHOW_H 5 | #define SLIDESHOW_H 6 | 7 | #include 8 | 9 | class SlideShowPrivate; 10 | 11 | class SlideShow : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | Q_PROPERTY(int slideInterval READ slideInterval WRITE setSlideInterval) 16 | 17 | public: 18 | SlideShow(QWidget* parent = 0); 19 | ~SlideShow(); 20 | void addImage(QString filename); 21 | void addImageDir(QString dirName); 22 | void clearImages(); 23 | void startShow(); 24 | void stopShow(); 25 | 26 | 27 | int slideInterval(); 28 | void setSlideInterval(int val); 29 | 30 | signals: 31 | void inputReceived(); 32 | 33 | protected: 34 | void paintEvent(QPaintEvent *event) override; 35 | void keyPressEvent(QKeyEvent *event) override; 36 | void mouseMoveEvent(QMouseEvent *event) override; 37 | void mousePressEvent(QMouseEvent *event) override; 38 | void mouseReleaseEvent(QMouseEvent *event) override; 39 | void timerEvent(QTimerEvent *event) override; 40 | void showEvent(QShowEvent *event ) override; 41 | 42 | 43 | private: 44 | SlideShowPrivate* d; 45 | }; 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/svg/css/util/qsvgcssvalues_p.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2025 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QSVGCSSVALUES_P_H 5 | #define QSVGCSSVALUES_P_H 6 | 7 | // 8 | // W A R N I N G 9 | // ------------- 10 | // 11 | // This file is not part of the Qt API. It exists purely as an 12 | // implementation detail. This header file may change from version to 13 | // version without notice, or even be removed. 14 | // 15 | // We mean it. 16 | // 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | QT_BEGIN_NAMESPACE 23 | 24 | namespace QSvgCssValues { 25 | enum class EasingFunction : quint8 { 26 | Ease, 27 | EaseIn, 28 | EaseOut, 29 | EaseInOut, 30 | CubicBezier, 31 | Linear, 32 | Steps, 33 | }; 34 | 35 | enum class StepPosition : quint8 { 36 | JumpStart, 37 | JumpEnd, 38 | JumpNone, 39 | JumpBoth, 40 | Start = JumpStart, 41 | End = JumpEnd, 42 | }; 43 | 44 | struct BezierControlPoints 45 | { 46 | QPointF c1; 47 | QPointF c2; 48 | }; 49 | 50 | struct StepValues 51 | { 52 | quint32 steps; 53 | StepPosition stepPosition; 54 | }; 55 | 56 | using EasingValues = std::variant; 57 | 58 | } 59 | 60 | QT_END_NAMESPACE 61 | #endif //QSVGCSSVALUES_P_H 62 | -------------------------------------------------------------------------------- /dist/changes-5.9.0: -------------------------------------------------------------------------------- 1 | Qt 5.9 introduces many new features and improvements as well as bugfixes 2 | over the 5.8.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | http://doc.qt.io/qt-5/index.html 6 | 7 | The Qt version 5.9 series is binary compatible with the 5.8.x series. 8 | Applications compiled for 5.8 will continue to run with 5.9. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | https://bugreports.qt.io/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | Important Changes 19 | ----------------- 20 | - General: 21 | * Introduce logging category "qt.svg" 22 | * Add file name and line number to SVG parser error messages 23 | 24 | - SVG Image I/O: 25 | * [QTBUG-44863] Use defaultSize according to svg standard. If 26 | width/height attributes are present, they will be used as default 27 | image read size instead of the viewBox width/height. 28 | 29 | - QSvgWidget: 30 | * Paint the background if one has been set via a stylesheet 31 | 32 | - QSvgGenerator: 33 | * [QTBUG-58148] Add support for pattern brushes 34 | 35 | - QSvgIconEngine: 36 | * [QTBUG-59729] Paint correct size if device pixel ratio is fractional 37 | -------------------------------------------------------------------------------- /tests/manual/examples/embeddedsvgviewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(embeddedsvgviewer LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 10 | set(INSTALL_EXAMPLESDIR "examples") 11 | endif() 12 | 13 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/svg/embeddedsvgviewer") 14 | 15 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg Widgets) 16 | 17 | qt_add_executable(embeddedsvgviewer 18 | embeddedsvgviewer.cpp embeddedsvgviewer.h 19 | main.cpp 20 | ) 21 | 22 | set_target_properties(embeddedsvgviewer PROPERTIES 23 | WIN32_EXECUTABLE TRUE 24 | MACOSX_BUNDLE TRUE 25 | ) 26 | 27 | target_link_libraries(embeddedsvgviewer PUBLIC 28 | Qt::Core 29 | Qt::Gui 30 | Qt::Svg 31 | Qt::Widgets 32 | ) 33 | 34 | # Resources: 35 | set(embeddedsvgviewer_resource_files 36 | "files/default.svg" 37 | "files/v-slider-handle.svg" 38 | ) 39 | 40 | qt6_add_resources(embeddedsvgviewer "embeddedsvgviewer" 41 | PREFIX 42 | "/" 43 | FILES 44 | ${embeddedsvgviewer_resource_files} 45 | ) 46 | 47 | install(TARGETS embeddedsvgviewer 48 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 49 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 50 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 51 | ) 52 | -------------------------------------------------------------------------------- /examples/svg/svgviewer/svgview.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2025 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef SVGVIEW_H 5 | #define SVGVIEW_H 6 | 7 | #include 8 | #include 9 | 10 | class SvgView : public QWidget 11 | { 12 | Q_OBJECT 13 | public: 14 | enum Background { 15 | Black, 16 | White, 17 | Chequered 18 | }; 19 | 20 | enum Feature { 21 | Tiny_12, 22 | Extended, 23 | }; 24 | 25 | explicit SvgView(QWidget *parent = nullptr); 26 | void paintEvent(QPaintEvent *event) override; 27 | QImage renderAsImage(QSize imageSize); 28 | 29 | void setBackgroundType(Background type); 30 | void setFeature(Feature feature); 31 | void setScale(qreal scale); 32 | 33 | void restartAnimations(); 34 | 35 | void load(QStringView fileName); 36 | void reload(); 37 | QStringView currentFile() const; 38 | 39 | QSize fileSize() const; 40 | QSize sizeHint() const override; 41 | 42 | public slots: 43 | void setAnimations(bool enable); 44 | void setAssumeTrustedSource(bool enable); 45 | void setOutline(bool enable); 46 | 47 | private: 48 | QPixmap m_chequered; 49 | Background m_background; 50 | QSvgRenderer m_renderer; 51 | qreal m_scale = 1.0; 52 | QString m_fileName; 53 | bool m_outline = true; 54 | }; 55 | 56 | #endif // SVGVIEW_H 57 | -------------------------------------------------------------------------------- /tests/manual/examples/embeddedsvgviewer/embeddedsvgviewer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef EMBEDDED_SVG_VIEWER_H 5 | #define EMBEDDED_SVG_VIEWER_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class QSvgRenderer; 12 | class QMouseEvent; 13 | class QSlider; 14 | class QPushButton; 15 | 16 | class EmbeddedSvgViewer : public QWidget 17 | { 18 | Q_OBJECT 19 | public: 20 | EmbeddedSvgViewer(const QString& filePath); 21 | void paintEvent(QPaintEvent *event) override; 22 | void mouseMoveEvent(QMouseEvent *event) override; 23 | void mousePressEvent(QMouseEvent *event) override; 24 | void resizeEvent(QResizeEvent *event) override; 25 | 26 | public Q_SLOTS: 27 | void setZoom(int); // 100 <= newZoom < 0 28 | 29 | private: 30 | QSvgRenderer* m_renderer; 31 | QSlider* m_zoomSlider; 32 | QPushButton* m_quitButton; 33 | QSize m_imageSize; 34 | qreal m_zoomLevel; 35 | qreal m_imageScale; // How many Image coords 1 widget pixel is worth 36 | 37 | QRectF m_viewBox; 38 | QRectF m_viewBoxBounds; 39 | QSizeF m_viewBoxSize; 40 | QPointF m_viewBoxCenter; 41 | QPointF m_viewBoxCenterOnMousePress; 42 | QPoint m_mousePress; 43 | 44 | void updateImageScale(); 45 | QRectF getViewBox(QPointF viewBoxCenter); 46 | }; 47 | 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /tests/manual/examples/svgwidget/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main(int argc, char **argv) 12 | { 13 | QApplication app(argc, argv); 14 | QCoreApplication::setApplicationName("SVG Widget"); 15 | QGuiApplication::setApplicationDisplayName(QCoreApplication::applicationName()); 16 | QCoreApplication::setOrganizationName("QtProject"); 17 | QCoreApplication::setApplicationVersion(QT_VERSION_STR); 18 | 19 | QCommandLineParser parser; 20 | parser.setApplicationDescription("Qt SVG Widget"); 21 | parser.addHelpOption(); 22 | parser.addVersionOption(); 23 | parser.addPositionalArgument("file", "The file to open."); 24 | parser.process(app); 25 | 26 | const QString fileName = parser.positionalArguments().value(0, QLatin1String(":/files/bubbles.svg")); 27 | 28 | QTabWidget top; 29 | 30 | auto widget = new QSvgWidget(&top); 31 | top.addTab(widget, "Bubbles"); 32 | widget->load(fileName); 33 | 34 | auto otherWidget = new QSvgWidget(&top); 35 | top.addTab(otherWidget, "Spheres"); 36 | otherWidget->load(QLatin1String(":/files/spheres.svg")); 37 | 38 | top.show(); 39 | return app.exec(); 40 | } 41 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/miterLimitBoundingBoxTest.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/svg/qsvgutils_p.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2025 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QSVGUTILS_P_H 5 | #define QSVGUTILS_P_H 6 | 7 | // 8 | // W A R N I N G 9 | // ------------- 10 | // 11 | // This file is not part of the Qt API. It exists purely as an 12 | // implementation detail. This header file may change from version to 13 | // version without notice, or even be removed. 14 | // 15 | // We mean it. 16 | // 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | QT_BEGIN_NAMESPACE 23 | 24 | namespace QSvgUtils { 25 | 26 | enum LengthType { 27 | LT_PERCENT, 28 | LT_PX, 29 | LT_PC, 30 | LT_PT, 31 | LT_MM, 32 | LT_CM, 33 | LT_IN, 34 | LT_OTHER 35 | }; 36 | 37 | bool isDigit(ushort ch); 38 | qreal toDouble(const QChar *&str); 39 | qreal toDouble(QStringView str, bool *ok = NULL); 40 | qreal parseLength(QStringView str, LengthType *type, bool *ok = NULL); 41 | qreal convertToPixels(qreal len, bool , LengthType type); 42 | std::optional parseAngle(QStringView str); 43 | void parseNumbersArray(const QChar *&str, QVarLengthArray &points, 44 | const char *pattern = nullptr); 45 | std::optional parsePathDataFast(QStringView dataStr, bool limitLength = true); 46 | 47 | } 48 | 49 | QT_END_NAMESPACE 50 | 51 | #endif // QSVGUTILS_P_H 52 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/zero_length_stroke_linecap.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/manual/examples/draganddrop/delayedencoding/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(delayedencoding LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 10 | set(INSTALL_EXAMPLESDIR "examples") 11 | endif() 12 | 13 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/svg/draganddrop/delayedencoding") 14 | 15 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg SvgWidgets Widgets) 16 | 17 | qt_add_executable(delayedencoding 18 | main.cpp 19 | mimedata.cpp mimedata.h 20 | sourcewidget.cpp sourcewidget.h 21 | ) 22 | 23 | set_target_properties(delayedencoding PROPERTIES 24 | WIN32_EXECUTABLE TRUE 25 | MACOSX_BUNDLE TRUE 26 | ) 27 | 28 | target_link_libraries(delayedencoding PUBLIC 29 | Qt::Core 30 | Qt::Gui 31 | Qt::Svg 32 | Qt::SvgWidgets 33 | Qt::Widgets 34 | ) 35 | 36 | # Resources: 37 | set(delayedencoding_resource_files 38 | "images/drag.png" 39 | "images/example.svg" 40 | ) 41 | 42 | qt6_add_resources(delayedencoding "delayedencoding" 43 | PREFIX 44 | "/" 45 | FILES 46 | ${delayedencoding_resource_files} 47 | ) 48 | 49 | install(TARGETS delayedencoding 50 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 51 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 52 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 53 | ) 54 | -------------------------------------------------------------------------------- /tests/auto/qsvggenerator/referenceSvgs/radial_gradient.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | Qt SVG Document 5 | Generated with Qt 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /LICENSES/BSD-3-Clause.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) . 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 7 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/desktopservices/linktab.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | // EXTERNAL INCLUDES 5 | #include 6 | #include 7 | #include 8 | 9 | // INTERNAL INCLUDES 10 | 11 | // CLASS HEADER 12 | #include "linktab.h" 13 | 14 | LinkTab::LinkTab(QWidget *parent) : 15 | ContentTab(parent) 16 | { 17 | } 18 | 19 | LinkTab::~LinkTab() 20 | { 21 | } 22 | 23 | void LinkTab::populateListWidget() 24 | { 25 | m_WebItem = new QListWidgetItem(QIcon(":/resources/browser.png"), tr("Launch Browser"), this); 26 | m_MailToItem = new QListWidgetItem(QIcon(":/resources/message.png"), tr("New e-mail"), this); 27 | } 28 | 29 | QUrl LinkTab::itemUrl(QListWidgetItem *item) 30 | { 31 | if (m_WebItem == item) { 32 | return QUrl(tr("http://qt.io")); 33 | } else if (m_MailToItem == item) { 34 | return QUrl(tr("mailto:noreply@qt.io?subject=Qt feedback&body=Hello")); 35 | } else { 36 | // We should never endup here 37 | Q_ASSERT(false); 38 | return QUrl(); 39 | } 40 | } 41 | void LinkTab::handleErrorInOpen(QListWidgetItem *item) 42 | { 43 | if (m_MailToItem == item) { 44 | QMessageBox::warning(this, tr("Operation Failed"), tr("Please check that you have\ne-mail account defined."), QMessageBox::Close); 45 | } else { 46 | ContentTab::handleErrorInOpen(item); 47 | } 48 | } 49 | 50 | // End of file 51 | -------------------------------------------------------------------------------- /tests/auto/qicon_svg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## tst_qicon_svg Test: 6 | ##################################################################### 7 | 8 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) 9 | cmake_minimum_required(VERSION 3.16) 10 | project(tst_qicon_svg LANGUAGES CXX) 11 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) 12 | endif() 13 | 14 | # Collect test data 15 | file(GLOB_RECURSE test_data_glob 16 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 17 | icons/*) 18 | list(APPEND test_data ${test_data_glob}) 19 | 20 | qt_internal_add_test(tst_qicon_svg 21 | LOWDPI 22 | SOURCES 23 | tst_qicon_svg.cpp 24 | LIBRARIES 25 | Qt::Gui 26 | Qt::GuiPrivate 27 | Qt::Svg 28 | TESTDATA ${test_data} 29 | ) 30 | 31 | # Resources: 32 | set(tst_qicon_svg_resource_files 33 | "icons/heart.svg" 34 | "icons/heart.svgz" 35 | "icons/image.png" 36 | "icons/rect.svg" 37 | "icons/rect_size_100percent.svg" 38 | "icons/trash.svg" 39 | "icons/triangle.svg" 40 | "icons/testtheme/svg/actions/heart.svg" 41 | "icons/testtheme/16x16/actions/heart.png" 42 | "icons/testtheme/index.theme" 43 | ) 44 | 45 | qt_internal_add_resource(tst_qicon_svg "tst_qicon_svg" 46 | PREFIX 47 | "/" 48 | FILES 49 | ${tst_qicon_svg_resource_files} 50 | ) 51 | 52 | -------------------------------------------------------------------------------- /tests/manual/examples/embedded/desktopservices/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(desktopservices LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 10 | set(INSTALL_EXAMPLESDIR "examples") 11 | endif() 12 | 13 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/svg/embedded/desktopservices") 14 | 15 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) 16 | 17 | qt_add_executable(desktopservices 18 | contenttab.cpp contenttab.h 19 | desktopwidget.cpp desktopwidget.h 20 | linktab.cpp linktab.h 21 | main.cpp 22 | ) 23 | 24 | set_target_properties(desktopservices PROPERTIES 25 | WIN32_EXECUTABLE TRUE 26 | MACOSX_BUNDLE TRUE 27 | ) 28 | 29 | target_link_libraries(desktopservices PUBLIC 30 | Qt::Core 31 | Qt::Gui 32 | Qt::Widgets 33 | ) 34 | 35 | # Resources: 36 | set(desktopservices_resource_files 37 | "resources/browser.png" 38 | "resources/message.png" 39 | "resources/music.png" 40 | "resources/photo.png" 41 | ) 42 | 43 | qt6_add_resources(desktopservices "desktopservices" 44 | PREFIX 45 | "/" 46 | FILES 47 | ${desktopservices_resource_files} 48 | ) 49 | 50 | install(TARGETS desktopservices 51 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 52 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 53 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 54 | ) 55 | -------------------------------------------------------------------------------- /tests/baseline/data/extended_features/symbol.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /tests/baseline/data/bugs/groupOpacity.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | fill-opacity 22 | opacity 23 | applied to 24 | each element 25 | applied to 26 | group 27 | -------------------------------------------------------------------------------- /dist/changes-5.7.0: -------------------------------------------------------------------------------- 1 | Qt 5.7 introduces many new features and improvements as well as bugfixes 2 | over the 5.6.x series. Also, there is a change in the licensing terms. 3 | For more details, refer to the online documentation included in this 4 | distribution. The documentation is also available online: 5 | 6 | http://doc.qt.io/qt-5/index.html 7 | 8 | The Qt version 5.7 series is binary compatible with the 5.6.x series. 9 | Applications compiled for 5.6 will continue to run with 5.7. 10 | 11 | Some of the changes listed in this file include issue tracking numbers 12 | corresponding to tasks in the Qt Bug Tracker: 13 | 14 | https://bugreports.qt.io/ 15 | 16 | Each of these identifiers can be entered in the bug tracker to obtain more 17 | information about a particular change. 18 | 19 | **************************************************************************** 20 | * Important License Changes * 21 | **************************************************************************** 22 | 23 | This module is no longer available under LGPLv2.1. The libraries are 24 | now available under the following licenses: 25 | * Commercial License 26 | * GNU General Public License v2.0 (LICENSE.GPL2) and later 27 | * GNU Lesser General Public License v3.0 (LICENSE.LGPL3) 28 | 29 | The tools are now available under the following licenses: 30 | * Commercial License 31 | * GNU General Public License 3.0 (LICENSE.GPL3) with exceptions 32 | described in The Qt Company GPL Exception 1.0 (LICENSE.GPL3-EXCEPT) 33 | -------------------------------------------------------------------------------- /src/svg/doc/src/qsvgglobal.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | 4 | /*! 5 | \namespace QtSvg 6 | \brief The QtSvg namespace contains types used by the svg classes. 7 | \inmodule QtSvg 8 | */ 9 | 10 | /*! 11 | \enum QtSvg::Option 12 | \since 6.7 13 | 14 | This enum holds flags that can be used to enable or disable 15 | various features of the parsing and rendering of SVG 16 | files. Multiple flags can be combined into the QFlags type 17 | QtSvg::Options. 18 | 19 | \value NoOption The null value. This is the default for QtSvg::Options. 20 | 21 | \value Tiny12FeaturesOnly Strictly and exclusively parse only tags that are 22 | part of the \l{http://www.w3.org/TR/SVGMobile12} 23 | {SVG 1.2 Tiny} Static Feature set. 24 | 25 | \value [since 6.8] AssumeTrustedSource 26 | Disable certain checks and restrictions on resource 27 | usage etc. 28 | \value [since 6.9] DisableSMILAnimations 29 | Disable SMIL animations. SMIL animations are animations 30 | defined using elements like . 31 | \value [since 6.9] DisableCSSAnimations 32 | Disable CSS animations defined inside a 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /tests/baseline/data/animations/css_animate_transform_skew_units.svg: -------------------------------------------------------------------------------- 1 | 2 | 40 | 41 | 42 | 43 | 44 | 45 | --------------------------------------------------------------------------------