[Qt-interest] Change QGraphicsItem size according to QGraphicsLayout

Ori Lahav vbcrlf at gmail.com
Fri Jun 25 09:41:15 CEST 2010


The size policy is QSizePolicy::Preferred by default. I don't know what am I
suppose to do.

On Fri, Jun 25, 2010 at 10:06 AM, Sean Harmer <
sean.harmer at maps-technology.com> wrote:

> Hi,
>
> On Friday 25 June 2010 08:00:08 Ori Lahav wrote:
> > I have a QGraphicsItem placed inside a scene, and a QGraphicsLayout with
> > some widgets in it. The layout with the widgets inside that
> QGraphicsLayout
> > (some of them are QGraphicsProxyWidget) takes more space than the size of
> > the parent QGraphicsItem. How can I tell QGraphicsItem to change it size
> to
> > the minimum size of its layout?
>
> QGraphicsLayout inherits QGraphicsLayoutItem which looks to have many
> functions for adjusting sizes:
>
> void    setMaximumHeight ( qreal height )
> void    setMaximumSize ( const QSizeF & size )
> void    setMaximumSize ( qreal w, qreal h )
> void    setMaximumWidth ( qreal width )
> void    setMinimumHeight ( qreal height )
> void    setMinimumSize ( const QSizeF & size )
> void    setMinimumSize ( qreal w, qreal h )
> void    setMinimumWidth ( qreal width )
> void    setPreferredHeight ( qreal height )
> void    setPreferredSize ( const QSizeF & size )
> void    setPreferredSize ( qreal w, qreal h )
> void    setPreferredWidth ( qreal width )
> void    setSizePolicy ( const QSizePolicy & policy )
> void    setSizePolicy ( QSizePolicy::Policy hPolicy, QSizePolicy::Policy
> vPolicy, QSizePolicy::ControlType controlType = QSizePolicy::DefaultType )
>
> Have you tried any of those?
>
> Sean
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100625/892413da/attachment.html 


More information about the Qt-interest-old mailing list