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. QGraphicsSVGItem ignores (some) clipping paths. Why?
Forum Updated to NodeBB v4.3 + New Features

QGraphicsSVGItem ignores (some) clipping paths. Why?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 123 Views 1 Watching
  • 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.
  • N Offline
    N Offline
    Nicoco
    wrote on 26 May 2020, 13:30 last edited by Nicoco
    #1

    This SVG image is correctly rendered in Firefox and Inkscape, but for some reason, when using QGraphicsSVGItem without anything fancy, it renders this way:

    b7438226-8ead-4e81-b541-9888b03058e9-image.png

    For reference, this is what it looks like on firefox:

    83ecb93a-bfdf-45fc-b41c-5255655ae7e3-image.png

    As you can see, the back of the card is not supposed to go beyond the white border.

    Am I doing something wrong? Is there a (preferably easy) fix?

    A minimal working example, as you can see I am not doing anything fancy at all

    import sys
    from PyQt5 import QtWidgets, QtCore, Qt, QtGui
    
    app = QtWidgets.QApplication(sys.argv)
    
    scene = QtWidgets.QGraphicsScene()
    scene.addItem(Qt.QGraphicsSvgItem("back-red.svg"))
    
    graphics_view = QtWidgets.QGraphicsView()
    graphics_view.setScene(scene)
    graphics_view.show()
    
    sys.exit(app.exec())
    
    1 Reply Last reply
    0

    1/1

    26 May 2020, 13:30

    • Login

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