[Qt-interest] NoScrollBar is coming
Sujan Dasmahapatra
sujan.dasmahapatra at gmail.com
Thu Aug 20 13:51:14 CEST 2009
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 !!!!
On Thu, Aug 20, 2009 at 1:53 PM, Ferenc Stelcz <ferenc at stelcz.hu> wrote:
> Sujan Dasmahapatra wrote:
> > Dear Friends
> > I have some QGraphicsItems in the QGraphicsScene. I am doing some
> > translation so that my item is getting out of the view.Some part is not
> > visible. I am getting no horizontal scrollbar to see it..How could I set
> > this mechanism so that whenever my items is out I should get a scrollbar.
> >
> >
> >
> That should be one of those easy-to-find-in-the-docs problems.
>
> Bear in mind: "Note that QGraphicsScene has no visual appearance of its
> own;
> it only manages the items. You need to create a QGraphicsView widget to
> visualize the scene."
>
> So step up a level and set scrollbars for the QGraphicsView object holding
> your scene.
>
> QGraphicsView inherits 2 of its properties from QAbstractScrollArea:
> horizontalScrollBarPolicy : Qt::ScrollBarPolicy
> verticalScrollBarPolicy : Qt::ScrollBarPolicy
>
> Qt::ScrollBarPolicy is an enum which has following items:
>
> Qt::ScrollBarAsNeeded 0 QAbstractScrollArea shows a scroll bar when
> the
> content is too large to fit and not otherwise. This is the default.
>
> Qt::ScrollBarAlwaysOff 1 QAbstractScrollArea never shows a scroll
> bar.
>
> Qt::ScrollBarAlwaysOn 2 QAbstractScrollArea always shows a scroll
> bar.
>
> Setting scrollbar policies for the view occurs through calling:
> void setVerticalScrollBarPolicy ( Qt::ScrollBarPolicy )
> void setHorizontalScrollBarPolicy ( Qt::ScrollBarPolicy )
>
> But as I'm reading here it states: "The default policy is
> Qt::ScrollBarAsNeeded" for both directions...
>
>
> --
> Ferenc Stelcz
> Junior Software Engineer
>
> Banyan Technologies LLC.
> _______________________________________________
> 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/76490ba6/attachment.html
More information about the Qt-interest-old
mailing list