I want to display an svg file using PySide. But I would prefer not having to create a file.svg and then load it using QSvgWidget
Rather I just have the file contents of the file.svg contents already stored in a variable as a string.
How would I go about directly loading the SVG from the variable rather than form the file.
Best
You need to convert the string to a QByteArray.
From the QSvgWidget.load documentation:
Here's a full demo: