Unsolved coloroverlay in QML
-
Hi sir,
Good Evening,
I'm working on App using QML,in that i want to use coloroverlay to change icon color(.svg image),so the icon color should be changed when ever i click the button ( In side onclicked:)kindly help meThank you
-
There are a few ways to do it.
- If you use QQuickControls 2, you can use Button's
icon.color
property: https://doc.qt.io/qt-5/qml-qtquick-controls2-abstractbutton.html#icon.color-prop - you can use
Rectangle
with a color and some transparency (opacity or alpha value) and place it over your icon - you can use ColorOverlay
- If you use QQuickControls 2, you can use Button's
-
Thank you sir..
-
@sierdzio said in coloroverlay in QML:
icon.color
Good evening sir,
I'm unable to change color of Icon when ever i click the button means i am unable access coloroverlay inside a function and can you kindly help with small example.
Thank you -
Something like this should work:
Button { icon.color: pressed? "#aaff0000" : "transparent" }
-
Thank you