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. QGraphicsView using SVG as background
Qt 6.11 is out! See what's new in the release blog

QGraphicsView using SVG as background

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.2k 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.
  • S Offline
    S Offline
    stvokr
    wrote on last edited by
    #1

    Hello all,

    is it possible to use an SVG as background for a graphics view that scales without artefacts?
    Currently, I am using a pngfile as background pixmap for the graphics view. When scaling the view the background gets pixelated.

    I have an SVG with a 100x100 pixel viewport. I want to use this svg as a texture that repeats endlessly in x and y.
    Or does anyone have another idea to solve this?

    regards
    Oliver

    Ni.SumiN M 2 Replies Last reply
    0
    • S stvokr

      Hello all,

      is it possible to use an SVG as background for a graphics view that scales without artefacts?
      Currently, I am using a pngfile as background pixmap for the graphics view. When scaling the view the background gets pixelated.

      I have an SVG with a 100x100 pixel viewport. I want to use this svg as a texture that repeats endlessly in x and y.
      Or does anyone have another idea to solve this?

      regards
      Oliver

      Ni.SumiN Offline
      Ni.SumiN Offline
      Ni.Sumi
      wrote on last edited by Ni.Sumi
      #2

      @stvokr

      This svgviewer helps you.

      1 Reply Last reply
      1
      • S Offline
        S Offline
        stvokr
        wrote on last edited by
        #3

        @Ni-Sumi

        I also found this example and unfortunately it does not help because they use a pixmap as background brush and not a svg graphic.

        1 Reply Last reply
        0
        • S stvokr

          Hello all,

          is it possible to use an SVG as background for a graphics view that scales without artefacts?
          Currently, I am using a pngfile as background pixmap for the graphics view. When scaling the view the background gets pixelated.

          I have an SVG with a 100x100 pixel viewport. I want to use this svg as a texture that repeats endlessly in x and y.
          Or does anyone have another idea to solve this?

          regards
          Oliver

          M Offline
          M Offline
          mtrch
          wrote on last edited by
          #4

          Override QGraphicsView::drawBackground and draw SVG image using QSvgRenderer.

          1 Reply Last reply
          2

          • Login

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