How to use SVG
- 
@Saviz CONFIG += c++17 you also need 17 for Qt 6. 
 Show this line of your Makefile:
 LIBS = $(SUBLIBS)
 it should have -lQt5Svg
- 
@Saviz Another possibility is svg is not installed. Run MaintenaceTool to add it. I just installed Qt 6.1.2 in which svg is included. If you can find it in the Qt lib dir, check the path settings for Qt. 
- 
@JoeCFD said in How to use SVG: MaintenaceTool If I want to only install the SVG components, then what component do I have to select in the MaintenaceTool to install? 
- 
- 
I will give it a try. But my speed is not the best. It may take a while to download the new version. But I will report back how it went. Thank you all for your help Hi 
 Else a sure bet is installing Qt5.15.
 While v6 does offer new things
 https://wiki.qt.io/New_Features_in_Qt_6.0
 Its mostly if you are using QML and it still has lots of features missing planned
 for some later releases.
- 
Hi 
 Else a sure bet is installing Qt5.15.
 While v6 does offer new things
 https://wiki.qt.io/New_Features_in_Qt_6.0
 Its mostly if you are using QML and it still has lots of features missing planned
 for some later releases.
- 
Okay, I will try it. By the way I have one last question. Why isn't there a widget for SVG in QT Designer by default? - Why isn't there a widget for SVG in QT Designer by default?
 Too much work I would guess. To allow a Widget to be used in design time, a plugin must be made and maintained across many Designers. 
 And QSvgWidget doesn't have any properties to set at Design time. (besides the svg file) so I gues sit was
 not worth the effort.You can use the Producer Promote feature to allow a Qwidget as a place holder in Designer and then app is run its 
 the SVG one.
- 
- Why isn't there a widget for SVG in QT Designer by default?
 Too much work I would guess. To allow a Widget to be used in design time, a plugin must be made and maintained across many Designers. 
 And QSvgWidget doesn't have any properties to set at Design time. (besides the svg file) so I gues sit was
 not worth the effort.You can use the Producer Promote feature to allow a Qwidget as a place holder in Designer and then app is run its 
 the SVG one.
- 
Very interesting. Is there a documentation that I can use for the Producer Promote feature so I can learn it? Hi 
 Its very handy.In your use case you place a QWidget on the form, right-click and choose to promote. 
 Then tell it QSvgWidget for class name and it will guess on QSvgWidget.h
 Then press Add (+), then then promote.https://doc.qt.io/qt-5/designer-using-custom-widgets.html Do note: 
 Accessing it via Ui-> is possible and you can call the real functions from code, just like any other widget.
- 
Hi 
 Its very handy.In your use case you place a QWidget on the form, right-click and choose to promote. 
 Then tell it QSvgWidget for class name and it will guess on QSvgWidget.h
 Then press Add (+), then then promote.https://doc.qt.io/qt-5/designer-using-custom-widgets.html Do note: 
 Accessing it via Ui-> is possible and you can call the real functions from code, just like any other widget.So, if I want to create a custom widget for SVG, how can I do that? Is there an example that I can follow for promoting a widget to SVG? (I ask this because I really want to use SVG as default and I need a solution.) 
 (I am also a beginner so I have no idea where to start :) )
- 
So, if I want to create a custom widget for SVG, how can I do that? Is there an example that I can follow for promoting a widget to SVG? (I ask this because I really want to use SVG as default and I need a solution.) 
 (I am also a beginner so I have no idea where to start :) )
- 
So i am using Qt 6.2.2 & ran into the same problem the solution was : in the .pro file its QT+= svg svgwidgets 
 now you can#include <QSvgWidgets>found it in the included svgviewer example in QT qtsvg-svgviewer-example hope i helped 
- 
As explained here, QSvgWidgethas been moved to a new module calledQtSvgWidgets. According to the documentation:Header: #include <QSvgWidget> CMake: find_package(Qt6 REQUIRED COMPONENTS SvgWidgets) target_link_libraries(mytarget PRIVATE Qt6::SvgWidgets) qmake: QT += svgwidgets Inherits: QWidget So in Qt6 the solution is following: QT += svgwidgets
