- Timestamp:
- May 31, 2011, 4:00:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmapview.cpp
r2985 r3290 17 17 setCursor(Qt::OpenHandCursor); 18 18 setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); 19 resetScale(); 19 20 } 20 21 … … 90 91 91 92 // ------------- 92 void BncMapView::mouseReleaseEvent(QMouseEvent* /* event */)93 void BncMapView::mouseReleaseEvent(QMouseEvent* event) 93 94 { 94 95 setCursor(Qt::OpenHandCursor); … … 126 127 127 128 // zooming in 128 scale( scaleFactor,scaleFactor );129 zoom( scaleFactor ); 129 130 130 131 }else{ 131 132 132 133 // zooming out 133 scale( 1.0/scaleFactor,1.0/scaleFactor );134 zoom( 1.0/scaleFactor ); 134 135 } 135 136 … … 156 157 QGraphicsView::resizeEvent(event); 157 158 } 159 160 161 // ------------- 162 void BncMapView::resetScale() 163 { 164 _scale = _scCur = 2.0; 165 setMatrix(QMatrix(_scale,0,0,_scale,0,0)); 166 } 167 168 169 // ------------- 170 void BncMapView::zoom(qreal scale) 171 { 172 QGraphicsView::scale( scale, scale ); 173 _scCur = _scCur * scale; 174 }
Note:
See TracChangeset
for help on using the changeset viewer.