How to specify border only for one side of a rectangle
-
We have a rectangle ,want to give a border of 3 pix only on the right side of the rectangle with the color red.How to achieve this without using custom rectangle as border.
-
you don't
either use a canvas and paint the border like you want it or place a 2nd rectangle where the border should be, adjust it size and set the background color to the border color.
-
This post is deleted!
-
@Sandhiya
make your own Item via QQuickItem - base class (c++) and define that behaviour in the paint function. But that's in my opinion why to much effort for such a simple task.I know of no other way besides those 3 I posted.
-
cover with another rectangle
-
@Sandhiya
you can use clip propertyItem { height: 100 width: 100 clip: true anchors.centerIn: parent Rectangle { anchors.fill: parent anchors.rightMargin: -border.width anchors.topMargin: -border.width anchors.bottomMargin: -border.width border.width: 3 border.color:"red" } }