rounded corners on one side of the rectangle



  • Hi,

    Can you please provide tips on how to create a rectangle with rounded corner on one side only in QML.

    Thanks!



  • HI,

    you can use two rectangles

    Rectangle {
      id: roundRect
      radius: 5
      color: Qt.black
    }
    
    Rectangle {
      id: squareRect
    
      color: Qt.black
      height: rondRect.radius
      anchors.bottom = roundRect.bottom
      anchors.left = roundRect.left
      anchors.right = roundRect.right
    
    }
    

    This is an example and you can create a custom component where you can specify

    • color
    • radius
    • side of the square corners

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.