Your question is not entirely clear. It seems to me that this is the widget that you want to add to the layout. If you need a rounded widget, just use a QFrame and set the style for it:
myFrame->setStyleSheet(".QFrame{background-color: red; border: 1px solid black; border-radius: 10px;}");
There is no need to create a widget containing a QFrame . Just use QFrame directly.
source share