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. SVG: Fill color and mouseover

SVG: Fill color and mouseover

Scheduled Pinned Locked Moved General and Desktop
svgfillmouseoverhover
3 Posts 3 Posters 2.7k 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.
  • Q Offline
    Q Offline
    qtacc32
    wrote on last edited by
    #1

    Hello,

    I would like to have SVG icons in my application so they look nice when scaled on higher DPI. Also I want to support custom themes without the need to create the icons in different colors.

    So I was trying around with QSvgWidget.
    I would change the fill color by loading the widget from a QByteArray and doing a replace("fill:#000000", "fill:#FF0000"); on it first for example.
    For a hover effect, I would create two widgets in different colors and then replace them if events occur.

    But I wonder if there isn't an easier way to do all this?
    I was not able to get a onmouseover="setAttribute('fill'..." working with a QSvgWidget, so I think it's not supported.

    I'm happy about any idea!

    Thank you very much!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Albert P
      wrote on last edited by
      #2

      @qtacc32 said in SVG: Fill color and mouseover:

      QSvgWidget

      Nothing about this?

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        As far as i know there is no better way than to parse and handle
        the svg yourself. maybe parse once, create hover pixmap version and use that.

        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