[Qt-interest] Using QGraphicsLayouts inside QGraphicsWidgets
Schimkowitsch Robert
Robert.Schimkowitsch at andritz.com
Mon Jun 27 11:24:26 CEST 2011
Hi,
trying to get a few things straight:
> > I have methods to add and remove items from the ButtonBar, and I
> > basically expose the LinearLayout's SizeHint as the ButtonBar's
SizeHint
> > (so any outside layout will know how much room all my buttons need).
> That should not be necessary. The QGW and QGL items should do that for
you
> with no code on your part. Just setting the layout is enough to do
this.
[...]
> Any time one of your custom buttons changes it's size it should call
> QGraphicsWidget::updateGeometry(). This will take care of propagating
the
> change in size hints up the widget/layout hierarchy.
In the constructor initialisation list, I initialize my LinearLayout
member thus:
m_Layout(this)
Of course, the layout itself will recognize when one of it's layout
items changes.
The question for me was how that information gets to my ButtonBar, so an
outer layout seeing my ButtonBar as one of it's LayoutItems will
invalidate itself.
Are you implying that telling the layout my ButtonBar is its parent will
be enough for the invalidation to propagate?
> At present this can take several iterations of the event loop due to a
bug in
> QGV (http://bugreports.qt.nokia.com/browse/QTBUG-17244). The fix for
this is
> coming in Qt 4.8.0 (and 4.7.4 if we get that release). The fix is
opt-in
> though and you'll need to call:
>
> QGraphicsLayout::setInstantInvalidatePropagation(true);
>
> to make it happen in a single pass.
Good to know!
Thanks!
Robert Schimkowitsch
#####################################################################################
This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
Thank You.
#####################################################################################
More information about the Qt-interest-old
mailing list