Set Different values for Rectangle border
-
Hey,
Is there any way to give different values in rectangle radius.
like... radius : 4,10
Rectangle{ width:(parent.width-8) height:(parent.height-8) radius: 12 z: 9 smooth:true opacity: 0.96 color:"#fff" anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter Rectangle{ width: parent.width/2 anchors.bottom: parent.bottom height:50 color:"#a9511d" radius:0 } Rectangle{ width: parent.width/2 anchors.bottom: parent.bottom anchors.right: parent.right height:50 color:"#7f2a00" } }
-
Hi,
do you mean you want different radii on the corners of a rectangle at the same time? -
yes, I want to set radius top:5, bottom :5
but left and right should be zero
-
yes, I want to set radius top:5, bottom :5
but left and right should be zero
@shwt.saxena That's not possible with the Rectangle component provided by QtQuick. But you can easily implement your own rectangle component that supports this feature.
-
yes, I want to set radius top:5, bottom :5
but left and right should be zero
@shwt.saxena Have a look at the documentation. It demonstrates how to create your own Qt Quick type by inheriting QQuickPaintedItem : http://doc.qt.io/qt-5/qtqml-tutorials-extending-qml-example.html#chapter-1-creating-a-new-type
-
thanks I will try