View Full Version : Implement transparent round corners of resizable Qdialog using stylesheets

28th December 2010, 10:28

I tried following code to implement round corners of Qdialog ,but the corners are not transparent , Their color is black.

All corner of dialog.png is transparent.

border-image: url(qss/dialog.png);
border-width: 5px;

and if i use border-radius:3px, It doesn't work. dialog will have a black border.

This methed works for QPushbutton, but doesn't work for QDialog, I think it's because the QDialog is in toplevel

Thx in advance,and sry for my bad english

28th December 2010, 10:43
It works for the button since the button is on a widget, so the transparent parts show the parent widget under it.
A QDialog is a top level widget, which has the desktop under it, and you application knows nothing about it, so the transparent parts become black.
You will have to use a mask.
See here: