[Qt-interest] NoScrollBar is coming

John McClurkin jwm at nei.nih.gov
Thu Aug 20 17:31:50 CEST 2009


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. 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.



More information about the Qt-interest-old mailing list