Solved Rendering animated svg
-
I have a simple animated svg (xml ?) file that i would like to display on screen.
I created a
QSvgRenderer
and checked withQSvgRenderer::isValid
, but now how can i pass that to say an existingQWidget
placed with designer ?The doc says:
Once you have loaded the SVG file successfully, you can render it with the QSvgRenderer::render function. Note that this scheme allows you to render SVG files on all paint devices supported by Qt, including QWidget
But i can't pass a
QWidget
toQSvgRenderer::render
, i get an error:no matching function for call to 'QSvgRenderer::render(QWidget*&)'
-
Ok i found a way to do it, i promoted my
QWidget
into aQSvgWidget
and used theQSvgWidget::load
function.