tags:

views:

32

answers:

1

Greetings all,

As seen in the pictures. alt text

alt text

I have QWidget inside a QScrollArea. QWidget act as a render widget for cell image and some vector based contour data. User can performe zoom in/out and what simply happens is, it changes the QPainters scale and change the size of QWidget size accordinly.

Now I want to perform the zooming in/out on the point under the mouse. (like zooming action in GIMP). How to calculate the new positions of the scrollbars according to the zoom level ? Is it better to implement this using transformations without using a scrollarea?

thanks in advance, umanga

+1  A: 

Will void QScrollArea::ensureVisible(int x, int y, int xmargin = 50, int ymargin = 50) do what you need?

Arnold Spence