zz0nt.jpg
if i want to create the third effect , how can i do ? Thank you...
zz0nt.jpg
if i want to create the third effect , how can i do ? Thank you...
i don't think it is possible (if there's a way i'd like to know it)
maybe you can use an image or svg with the radial in it
For radial Gradients:
http://qt-project.org/doc/qt-5.0/qtg...lgradient.html
The last one looks like linear along the diagonal.
For a square (eg., size = 10x10), you can do the following:
<1> Construct an Item of size 10x10 and set clip = true
<2> Imagine a square that contains this Item such that corners of the Item lie on the mid-point of the edges of this outer square. You'll have cos(45 deg) = B/H => 1/sqrt(2) = 5 / H => H = 5 * sqrt(2)
<3> edge length of the outer square is thus 2 * 5 * sqrt(2) = 10 * sqrt(2)
<4> make a Rectangle with anchors.centreIn: parentItem with height and width as 10 * sqrt(2)
<5> apply linear gradient
<6> rotate the Rectangle by 45, -45, 135 or -135 degrees, you'll have that effect.
eg.,
Qt Code:
Item { height: 30 width: 30 clip: true Rectangle { anchors.centerIn: parent height: parent.height * Math.sqrt(2) width: height gradient: Gradient {....} rotation: 45 } }To copy to clipboard, switch view to plain text mode
Bookmarks