Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

void ItemView::zoomIn ( const QPoint &  center  )  [inherited]

Zoom in. The point center will remain fixed.

Definition at line 139 of file itemview.cpp.

References ItemView::zoomIn(), and ItemView::zoomLevel().

Referenced by ItemView::zoomIn().

      // NOTE The code in this function is nearly the same as that in zoomOut.
      // Any updates to this code should also be done to zoomOut
      // Previous position of center in widget coordinates
      QPoint previous = center * zoomLevel() - QPoint( cvbEditor()->contentsX(), cvbEditor()->contentsY() );
      // Don't repaint the view until we've also shifted it
      cvbEditor()->viewport()->setUpdatesEnabled( false );
      // Adjust the contents' position to ensure that "previous" remains fixed
      QPoint offset = center * zoomLevel() - previous;
      cvbEditor()->setContentsPos( offset.x(), offset.y() );
      cvbEditor()->viewport()->setUpdatesEnabled( true );

Generated by  Doxygen 1.6.0   Back to index