Hi there,

I wrote a simple "HeadsUp" widget class (derived from QWidget), that 
only contains layouts and QLabel. I'm using it in a kind of special way:
This widget overlay a QGraphicsView in the top left corner to display 
context specific information, it has the 
Qt::WA_TransparentForMouseEvents flag and draw itself with 0.5 opacity.

Now, depending of the user action, context and the current tool, I want 
to display various amount of information, for this purpose I'm creating 
all the QLabel and layouts in the constructor, and then simply display 
the one i want using label->setVisible(true|false).
This all work nicely except for one annoying thing: I cannot get the 
main widget to resize itself depending on it's content. I have tried to 
play around with update(), layout->update(), and updateGeometry(), but 
without success.
For now, the only way I found to get the widget to resize correctly 
after enabling/disabling some of its QLabel was to do:
setVisible(false);
setVisible(true);

I know this is not the correct way to go, and is quite inefficient but I 
could not find another way.
Would anyone have some suggestion on how to handle this correctly?
Any help would be greatly appreciated.

Thanks,
Chris
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to