PDA

View Full Version : Widget corruption



grzywacz
27th May 2006, 18:22
Hi,

I've been having problems recently with Qt Designer randomly corrupting my widgets. This happens automagically when I save a form and is hard to debug, since it usually takes some time from saving a form to the moment when I notice the broken result (especially since I use QStackedWidget and don't inspect all the "tabs" every time). Here are the screenshots showing what's happening:

http://stealth.math.uni.lodz.pl/~grzywacz/before.png

save, reload:

http://stealth.math.uni.lodz.pl/~grzywacz/after.png

Has anyone seen anything like that before? Thanks in advance for any help!

wysota
27th May 2006, 19:07
Hello Karol,

Are you using layouts? Probably not and you should as this would probably fix your problem. And be sure not to use Qt4.0 as it contains many bugs in Designer code.

grzywacz
27th May 2006, 19:18
Thanks for a quick reply!

No, I don't use layouts as I need to have those widgets scattered in a more or less random way and I can't really accomplish that with layouts (at least not unless I fill them with tons of invisible widgets).

I use Qt 4.1.2 and plan to keep doing so... If that's an unavoidable Designer bug then I'll have to live with it. Thanks to programmers of svn I can revert the breakage with little trouble...

wysota
27th May 2006, 22:04
Honestly I don't experience such problems with my installation. Is this a random effect or did you notice some regularities on when and how this happens? Did you try looking at the ui file with a text editor? Maybe svn (or something else) corrupted it?

grzywacz
28th May 2006, 10:28
This doesn't happen every time, that's why it's so annoying. And yes, I did look at the .ui file, here's what changed between the correct and broken version:

Underlaying QFrame's size has changed:
- <width>800</width>
- <height>600</height>
+ <width>512</width>
+ <height>307</height>

And the same thing has happened to all three buttons on top of it:
- <width>150</width>
- <height>128</height>
+ <width>512</width>
+ <height>307</height>

- <width>150</width>
- <height>128</height>
+ <width>512</width>
+ <height>307</height>

- <width>150</width>
- <height>128</height>
+ <width>512</width>
+ <height>307</height>

Looks as if the change has been somehow propagated to other widgets (not that I recall resizing the QFrame itself, that wouldn't look ok). I've also seen a similliar problem with QTabWidget.

edit: yes, I've corrected the .ui file by hand and from then on everything seems to work fine.

wysota
28th May 2006, 11:48
I'd still suggest using layouts.