SVG: Fill color and mouseover



  • 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!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.