Qt: How to force a hidden widget to calculate its layout?
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-03-11T17:12:50Z
Indexed on
2010/03/12
8:17 UTC
Read the original article
Hit count: 148
What I am trying to do is render a qwidget onto a different window (manually using a QPainter)
I have a QWidget (w) with a layout and a bunch of child controls. w is hidden. Until w is shown, there is no layout calculations happening, which is expected.
When I call w->render(painter, w->mapToGlobal(QPoint(0,0))
, I get a bunch of controls all overlapping each other.
w->layout()->activate();w->layout()->update()
doesn't seem to do anything.
Is there a way to force the layout to happen without showing w?
© Stack Overflow or respective owner