PDA

View Full Version : fill colors in rounded rectangle



joko
6th August 2015, 18:50
hi,

I'm having a hard time filling the rounded rectangle with borders in 2 colors.
I tried creating 2 child rectangle and use clip property but it is not working.

Please advise. Thanks

anda_skoa
7th August 2015, 09:28
You'll have to provide at least some visual hint on what you want it to look like.
While most Qt experts are telepaths, there is always a limit on range.

Cheers,
_

joko
7th August 2015, 12:17
sorry, I forgot to include a sample.

Actually, I tried creating a child rectangle and fill it with solid color, however it won't clip on the parent rectangle's rounded corner.

11309

anda_skoa
7th August 2015, 14:05
Ah. This use case it probably better solved using a border image.
http://doc.qt.io/qt-5/qml-qtquick-borderimage.html

Cheers,
_

joko
7th August 2015, 17:42
Ah. This use case it probably better solved using a border image.
http://doc.qt.io/qt-5/qml-qtquick-borderimage.html

Cheers,
_

you mean, I should have an image to implement it.
meaning, clipping is not possible on rounded rectangle, right?

anda_skoa
7th August 2015, 18:20
I meant that this form of visualization is what BorderImage was designed for.

Cheers,
_