Hi guys,

I have 2 problem connected with zooming the scene.
First of all, I am using the code beneath to zoom the given rect, but it alwas zoom the center(at the begining, for the first 2 times).
Qt Code:
  1. void MyCLass::vZoomSceneRectangle(QRectF _rectangle)
  2. {
  3. m_view->fitInView(_rectangle,Qt::KeepAspectRatio); // or Qt::KeepAspectRatioBy expanding
  4. m_view->ensureVisible(_rectangle);
  5. }
To copy to clipboard, switch view to plain text mode 

The second problem is connected with fixed position. I have created QLabel as view->viewport() children(to set fixed position). When I scale the view(scale(2.0,20)), for the first 4 times their position is ok, but when I zoom In for the 5 time they change their position. So i am deleting them and recreating everytime they I zoom the scene rect and their position is ok(even though there are some painting lags).
But when I use fitInView(QRectF) method my QLabel position changes and I am back where my problems appeared.

Any idea how to zoom the chosen rectangle(correctly); I am currenly reading selected rectangle from the scene and use fitInView(QRectF..).
How to force my widgets to ignore zooming(I belive it should be a default action , when I created them as children of the view->viewport()).

For any ideas thank YOU.

Maverick