I would like to create a shape like this in Qt:
Here is the piece of the code (Basically draws a rectangle and draws an arc over it):
QPainterPath groupPath;
QPen pen;
pen.setCosmetic(true);
groupPath.moveTo(60.0, 40.0);
groupPath.arcTo(40.0, 35.0, 40.0, 10.0, 180.0, 180.0);
groupPath.moveTo(40.0, 40.0);
groupPath.lineTo(40.0, 80.0);
groupPath.arcTo(40.0, 75.0, 40.0, 10.0, 0.0, 180.0);
groupPath.arcTo(40.0, 75.0, 40.0, 10.0, 0.0, 180.0);
groupPath.lineTo(80.0, 80.0);
groupPath.lineTo(80.0, 40.0);
groupPath.closeSubpath();
//setFixedSize(135, 80);
QPainter painter(this);
painter.setPen(pen);
painter.drawPath(groupPath);
The code creates top and bottom bendings, but I was unable to create left and right ones. Is there another way to do this? I saw Clipping, but not sure if it will work.