Change zoom behaviour on ViewArea:

Now it requires a combination of Ctrl + mouse wheel
This commit is contained in:
jfmcarreira committed 2014-06-28 15:46:05 +01:00
1 parent 20e2ee38c0
commit 1c122a4a82
3 files changed
+24 -15

No files matched your search

+21 -14
View File
@@ -109,6 +109,14 @@ void ViewArea::clearMask()
// return QSize( w, h );
// }
Void ViewArea::setZoomFactor( Double f )
{
m_zoomFactor = f;
updateSize();
update();
}
Void ViewArea::zoomChangeEvent(Double factor, QPoint center )
{
Double zoomFactor;
@@ -134,14 +142,6 @@ Void ViewArea::zoomChangeEvent(Double factor, QPoint center )
}
void ViewArea::setZoomFactor( double f )
{
m_zoomFactor = f;
updateSize();
update();
}
void ViewArea::setMode( ViewMode mode )
{
if( m_mode == mode )
@@ -523,13 +523,16 @@ void ViewArea::wheelEvent( QWheelEvent *event )
{
Double factor;
factor = 0.001 * event->delta();
if(factor>0)
factor=1.25;
else
factor=0.8;
if( event->modifiers() & Qt::ControlModifier )
{
factor = 0.001 * event->delta();
if(factor>0)
factor=1.25;
else
factor=0.8;
zoomChangeEvent( factor , event->pos() );
}
zoomChangeEvent( factor , event->pos() );
}
void ViewArea::mousePressEvent( QMouseEvent *event )
@@ -538,6 +541,10 @@ void ViewArea::mousePressEvent( QMouseEvent *event )
QPoint vpos = windowToView( event->pos() );
if( event->button() == Qt::MidButton )
{
}
if( event->button() == Qt::LeftButton )
{
if( tool() == NavigationTool )
+2 -1
View File
@@ -108,6 +108,7 @@ public:
PlaYUVerStream* getInputStream();
Void zoomChangeEvent(Double factor, QPoint center);
void setTool( enum eTool tool );
// QSize sizeHint() const;
@@ -128,7 +129,7 @@ public Q_SLOTS:
void setGridVisible( bool enable );
void setSnapToGrid( bool enable );
void setSelectedArea( QRect &rect );
void setZoomFactor( double f );
void setZoomFactor( double );
protected:
void paintEvent( QPaintEvent *event );
+1
View File
@@ -754,6 +754,7 @@ Void plaYUVerApp::zoomToFitAll()
subWindow = qobject_cast<SubWindowHandle *>( mdiArea->subWindowList().at( i ) );
subWindow->zoomToFit();
}
updateZoomFactorSBox();
}
Void plaYUVerApp::scaleFrame( int ratio )