qt - Is it possible to apply a color Gradient to Text in QML? -
is possible apply color gradient text in qml? if so, how? if not, acceptable means achieve same effect?
you can use lineargradient qml type.
import qtquick 2.4 import qtquick.window 2.2 import qtgraphicaleffects 1.0 window { visible: true height: 500 width: 500 text { id: text font.pointsize: 55 anchors.centerin: parent text: "hello world!" visible: false } lineargradient { anchors.fill: text source: text gradient: gradient { gradientstop { position: 0; color: "yellow" } gradientstop { position: 1; color: "red" } } } }
Comments
Post a Comment