[Qt-interest] NoScrollBar is coming
Sujan Dasmahapatra
sujan.dasmahapatra at gmail.com
Thu Aug 20 18:16:04 CEST 2009
Thanks Mr Sean and others too for the precious help.
On Thu, Aug 20, 2009 at 6:39 PM, Sean Harmer <
sean.harmer at maps-technology.com> wrote:
> On Thursday 20 Aug 2009 16:31:50 John McClurkin wrote:
> > Sujan Dasmahapatra wrote:
> > > Dear Mr Ferenc
> > > I need to discuss something in this regard.When I create a
> > > QGraphicsScene and a QGraphicsView, Do I need to do
> > > QRectF rect;
> > > scene->setSceneRect(rect);
> > > view->setSceneRect(rect);
> > >
> > > What would be the optimized size of the rect ???? According to my
> > > implementation I haven't set SceneRect and by default
> > > ""The default policy is
> > > Qt::ScrollBarAsNeeded" for both directions..."
> > > So in my case when my object is going out of the view scrollbar should
> > > come , why it's not coming ????
> > >
> > > I have read GraphicsView Framework still my doubt is under-development.
> > > Could youhelp me in uderstanding these things .
> > >
> > > Thanks !!!!
> >
> > Sujan,
> > You are manipulating objects in your QGraphicsScene and making them
> go
> > out of the scene. However the QGraphicsScene has no visual properties,
> > that is, it has no scrollbar. Only the QGraphicsView has scrollbars. The
> > default behavior is to show scrollbars if the QGraphicsScene is larger
> > than the QGraphicsView. Causing objects to move out of the scene does
> > not automatically cause the scene to grow.
> It does if you have not explicitly set a sceneRect. See:
>
> http://doc.trolltech.com/4.6-snapshot/qgraphicsscene.html#sceneRect-prop
>
> > Since the scene is always the
> > same size as the view, the view does not show scrollbars. To get
> > scrollbars to show, you need to change the size of the scene so that it
> > fully includes the objects after you have manipulated them.
> QGraphicsScene::itemsBoundingRect() can help here:
>
> http://doc.trolltech.com/4.6-snapshot/qgraphicsscene.html#itemsBoundingRect
>
> Sean
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
Thanks & Regards
S. Dasmahapatra
B.E. (Aeronautics-Aerodynamics)
Bangalore, India
Ph:91-9900839788
Office:91-80-66470248
mail id : sujan.dasmahapatra at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090820/0a29804e/attachment.html
More information about the Qt-interest-old
mailing list