[Qt-interest] Creating dialogs with "round corners"

R. Reucher rene.reucher at batcom-it.net
Fri Feb 13 10:01:51 CET 2009


On Fri February 13 2009 09:51:55 Markus Franke wrote:
> Dear QT Developers/Users,
>
> in my embedded QT application I would like to use dialogs (i.e. owning
> layouts, buttons, ...). Furthermore, these dialogs should have "round
> corners" (sorry for the term). So far I am using QLabels for the
> dialogs and stylesheets to obtain the "round corners".
>
> First of all: Is this the right way to do in Qt?
I'd say the "right way" would be to write a new style (see QStyle).

> I know that I should maybe use QDialog for my dialog windows but so
> far I didn't find a way to style a QDialog with "round corners".
I think you can only do this cleanly by changing the GUI style...

> Furthermore, now I have problems when I want to apply a layout to my
> dialog windows (which are derived from QLabel). The problem is that
> the size of the QLabel doesn't adapt to the size of the layout. This
> happens if my QLabel has a parent widget. If it doesn't have a parent
> widget (i.e. parent widget == 0), that means the QLabel is a window by
> itself, I am not able to obtain the round corners again.
I recommend you get used to the Qt designer and how to use the UIs in your 
code. It makes live so much easier, esp. with regard to layouts...

See http://doc.trolltech.com/4.4/designer-manual.html

HTH, René
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/

The revolution will not be televised.




More information about the Qt-interest-old mailing list