Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Rendering .svg image using QSS

    General and Desktop
    svg qtoolbutton stylesheet
    2
    2
    2680
    Loading More Posts
    • 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
      Sergobot last edited by

      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 Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by mrjj

        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 Reply Quote 1
        • First post
          Last post