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 .svg image using QSS
QtWS25 Last Chance

Rendering .svg image using QSS

Scheduled Pinned Locked Moved Solved General and Desktop
svgqtoolbuttonstylesheet
2 Posts 2 Posters 3.4k 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
    Sergobot
    wrote on 18 Dec 2015, 19:51 last edited by
    #1

    Hello everyone. I'm trying to render .svg image to QToolButton but can't do that. If I use background-image: and image: it simply isn't rendered. If I try using border-image:, the image is rendered but with incorrect dimensions and with some artifacts, like a big black rectangle.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 18 Dec 2015, 23:00 last edited by mrjj
      #2

      Hi
      QToolButton wants border to display on some platforms.
      QToolButton {
      border: 2px;
      image: url(:/border.svg);
      }
      works for me.
      example:
      https://www.dropbox.com/s/z0oqrco7tfs4qm8/svgtest.zip?dl=0

      1 Reply Last reply
      1

      1/2

      18 Dec 2015, 19:51

      • Login

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