PDA

View Full Version : Differencies between Qt designer preview and ui file



shadowfax
24th June 2009, 20:13
I built window using Qt designer 4.3.2 and converted resulted ui file using pyuic4. But converted ui doesn't look like this showed by Qt designer preview. Below are two screenshots. One is from Qt designer and the second is resulting PyQt window. Why is this happening ?

Lykurg
24th June 2009, 20:23
please attach the images at the forum that your post stays consistent.

Seems like a bug in pyuic4, that the padding property in inline layouts is not transformed correctly. how does the generated h file look like?

shadowfax
24th June 2009, 20:44
Here is resulted py file.

Lykurg
24th June 2009, 21:25
it's like i thought, there are no setting for spacing or margin for the layouts. I guess you have altered them to 0 inside your splitters. If so, send that result with the original ui to the mailing list of pyqt, since that is no error of Qt rather in the python bindings.

shadowfax
24th June 2009, 21:59
So how can I lay the bottom listWidget properly ? Is there any workaround for this ?

Lykurg
24th June 2009, 22:19
you can set the spacing and margin by hand after you called the setupUi function. to get the layouts you can use QObject::findChild().

wysota
24th June 2009, 22:27
It seems your PyQt installation is older than your Qt installation and pyuic is lagging behind uic in terms of functionality. Try upgrading PyQt.

shadowfax
25th June 2009, 13:36
I think I'm doing something wrong :) I updated PyQt to 4.5.1 and tried this ui both in Linux and Windows. The problem still exists. Here's my ui file.

Lykurg
25th June 2009, 13:48
Ok, since you don't set explicit the margins and spacings for the layout, the designer and your app have obviously different default values for that.
So set the margins explicit in the designer (the name of the property is then bold; If already 0, change to 1 and back.)

shadowfax
25th June 2009, 14:10
Thanks! Everything works perfect right now.