PDA

View Full Version : Qt style sheeet: padding and margins + layout



Syntho
4th June 2010, 10:15
I have complex widget - in one there 2 other. All internal widgets managed by layout (QGridLayout). I want to adjust its look and feel with CSS like table in attached sample project.

But updating paddings in runtime cause nothing visible effects.
Also, margins changes only size of control, but not affects any internal widgets.
Is seems that CSS adjust only "look" but not "feel" =(

How could I change CSS'es paddings and margins so it affects all children widgets?

soulless
4th June 2010, 11:26
I changed bits of the code... Clean the project then run it. and tell if the problem is still there.

Syntho
4th June 2010, 12:04
Yep, it still here. When click on label look to internal label's text - it is not moving (but shoul - on click changed parent's paddings is CSS). Also when changing margins for children labels its text appears outside labels border.
May be problem in QT version? I'm using 4.6.2? and you? Could you attach release executable file, if in your assmbly all right?

soulless
4th June 2010, 16:35
It seems that it's about your QCssFrame class implementation. It's not a Qt problem. (see the attachment)

Syntho
4th June 2010, 16:51
Ok, try this sample. All widgets is qt native, but probles still here.
Click on button first time to increase padding than resize window. Why text is cut off? Buttons should expand to hold entire text + paddings if layout allow it. Here layout used for entire widget, so it is big enough.
Same thing with margins (click twice) - VISUAL buttons size is decreased, but you still can click in original bounds of button! And problem with text presented.

Layout is not resizing when margins or paddings changing, but should.

Is it still not problem of Qt?