I need to display an image in Qt with curved corners. This is the obvious thing I have tried:

Qt Code:
  1. QPixmap pix(":/1.png");
  2. fLabel->setPixmap(pix);
  3. fLabel->setStylesheet("border-radius: 5px;");
To copy to clipboard, switch view to plain text mode 

And it does not work. I came across a discussion https://forum.qt.io/topic/6880/image...adius-in-qml/6. It suggests a complicated solution which seems to work according to OP. However, we are not using QML in our code, so we are resigned to using stylesheets only. Is there any non-QML way to do what the code in the linked post does in QML? Or is there any other way we can show an image with rounded corners in Qt?