Hello

I am at this time busy making a world view interface(just like Google earth) see the below image.

http://img56.imageshack.us/my.php?image=79406270bm9.jpg

As i marked the small view at the right bottom corner of the view, I have also the same small view which has some drawing objects in it. And a big view which has also the same drawing objects as the small one.

When I select some area in the small view OnMouseRelease, I tend to zoom the same selected area in the bigger view. Can someone please give any idea how can I achieve this?

I have tried it myself too, and this is the code:

Qt Code:
  1. //class WorldView (the small view)
  2. void WorldView::mouseReleaseEvent(QMouseEvent *e)
  3. {
  4.  
  5. dScale2 = 2.0;
  6. m_WorldViewSelect = false;
  7.  
  8. int x = 0;
  9. int y = 0;
  10.  
  11. if ( m_bSelect )
  12. {
  13. //The selected area draws in the form of rectangle
  14. SetSelect(0,0,0,0);
  15. m_Select = m_Select.normalize();
  16.  
  17. m_bSelect = false;
  18. x = -( m_Dev.Left() - ((m_Select.left() + m_Select.right()) / 2) );
  19. y = -( m_Dev.Top() - ((m_Select.top() + m_Select.bottom()) / 2) );
  20.  
  21. QRect R = rect();
  22.  
  23. XFactor = (double)R.width() / (double)m_Select.width();
  24. YFactor = (double)R.height() / (double)m_Select.height();
  25.  
  26. if (XFactor > YFactor)
  27. dScale2 = YFactor;
  28. else
  29. dScale2 = XFactor;
  30.  
  31. if (m_pOtherView->View())
  32. {
  33. // if the other view the selected rectangle should be drawn in to the other view en aftwewards that selected area should be zoomed in
  34.  
  35. m_Zoomed = true;
  36. m_pOtherView->View()->SetSelect(m_Select.x(), m_Select.y(),
  37. m_Select.width(), m_Select.height());
  38.  
  39. m_pOtherView->View()->mouseReleaseEvent(e);
  40.  
  41. // After doing this, the zoomfactor for the other view is not correct and the selected area(Rectangle) is not been drown in the good position.
  42.  
  43. }
  44.  
  45. }
  46. }
To copy to clipboard, switch view to plain text mode 

Thank you!