Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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 with QSvgRenderer::isValid, but now how can i pass that to say an existing QWidget 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 to QSvgRenderer::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 a QSvgWidget and used the QSvgWidget::load function.


Log in to reply