PDA

View Full Version : QFrame with border-radius inside QGraphicsScene



DeRatizator
23rd April 2010, 14:54
For some reason QFrame with round border gets drawn with square background in QGraphicsScene.
It appears normally if added to other widgets using layout. Should I do something special in case of QGraphicsScene/QGraphicsView to clip background properly ?

barty79
20th May 2010, 23:43
Got the same problem with QPushButton, QWidget in general. Anyone could help?

soheilarmin
23rd August 2010, 08:39
you can fix this problem by setting attribute of a the widget ( QPushButton , QToolButton or any other widget which can have border-radius ) like this :

QPushButton btn;
btn.setAttribute(Qt::WA_NoSystemBackground,true);
btn.setStyleSheet(".........

Please do not forget that the widget won't have a default background anymore and you need to set the background color in your stylesheet.