PDA

View Full Version : QLabel::setText causes part of widget to disappear



Pieter from Belgium
26th June 2007, 14:53
Hi,

While processing a mouse press, among others the contents of the label is set (setText).

In certain application states this causes the parent groupbox to disappear. In other states, setting the text causes the parent groupbox to reappear.

Leaving out the call/connection to setText, everything works as expected.

Any ideas?

Pieter

jpn
26th June 2007, 15:01
Could we see the relevant code?

Pieter from Belgium
26th June 2007, 16:39
I was affraid of this (logical) reply, as it is quite difficult to isolate. :confused:

The problem has been (partially) solved, by replacing in code changes to the form (which is designed in Qt Designer), to using custom widgets via the promotion mechanism.

The groupbox does no longer hide an show alternately, but it height changes alternately from very small to appropriate. In the same groupbox, a Q3ListView subclass is used, maybe using Qt4 and Qt3 support gives rise to the strange behavior?

croftj
26th June 2007, 21:40
An off the cuff guess of where to look would be in the layout management for the frames/widgets involved. All it takes is one missing layout or a mis-applied sisePolicy on a widget to get behavior like you are describing.

Pieter from Belgium
6th July 2007, 09:22
Rebuilding the design from scratch resolved the problem. Probably indeed a missing/inappropriate layout.