Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Rendering animated svg
Qt 6.11 is out! See what's new in the release blog

Rendering animated svg

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 998 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reonZ
    wrote on last edited by
    #1

    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*&)'

    R 1 Reply Last reply
    0
    • R reonZ

      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*&)'

      R Offline
      R Offline
      reonZ
      wrote on last edited by
      #2

      Ok i found a way to do it, i promoted my QWidget into a QSvgWidget and used the QSvgWidget::load function.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved