[Qt-interest] QGraphicsView Scroll problem.

Roland Labrecque roland at ics.com
Tue Feb 17 20:14:17 CET 2009


I am implementing a view that scales the scene vertically (but not 
horizontally) when the view resizes and has its horizontal scroll bar 
policy set to always on.

The problem I'm seeing is that when the view is resized to the point 
where the horizontal scroll bar is needed the view won't use the space 
alloted for the vertical scroll bar which is hidden.
I've included a small example showing the problem. In the example the 
red line at the right of the scene should always be at the right side of 
the viewport but when the horizontal scroll bar kicks in the line(and 
scene) step in the width of a a vertical scroll bar.

If you set  v->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded) it 
works as expected but I need the scroll bar always on.

Any ideas or workarounds?

FYI. I have tried 4.4.3 and 4.5.0-rc1 on XP with the same results.

Roland




-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gvscroll.cpp
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090217/fbd75c61/attachment.pl 


More information about the Qt-interest-old mailing list