From bb42e04dbf93187c55b279fd66148644b71ab88d Mon Sep 17 00:00:00 2001 From: Luis Lucas Date: Sun, 18 Jan 2015 01:42:31 +0000 Subject: [PATCH] Pan all images synchronously. First version. --- app/SubWindowHandle.h | 1 + app/VideoSubWindow.cpp | 5 +++-- app/plaYUVerApp.cpp | 21 ++++++++++++++++++++- app/plaYUVerApp.h | 2 ++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/SubWindowHandle.h b/app/SubWindowHandle.h index d966103..3d4e6a9 100644 --- a/app/SubWindowHandle.h +++ b/app/SubWindowHandle.h @@ -99,6 +99,7 @@ protected: Q_SIGNALS: void zoomChangedOnSubWindow(); + void scrollBarMoved( const QPoint ); void updateStatusBar( const QString& ); public Q_SLOTS: diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 7dedbcc..39e0106 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -83,8 +83,9 @@ VideoSubWindow::VideoSubWindow( QWidget * parent, Bool isModule ) : // Create a new interface to show images m_cViewArea = new ViewArea( this ); - connect( m_cViewArea, SIGNAL( zoomFactorChanged( double , QPoint) ), this, SLOT( processZoomChange(double, QPoint) ) ); - connect( m_cViewArea, SIGNAL( moveScroll( QPoint ) ), this, SLOT( adjustScrollBarByOffset(QPoint) ) ); + connect( m_cViewArea, SIGNAL( zoomFactorChanged( double , QPoint) ), this, SLOT( processZoomChange( double, QPoint ) ) ); + connect( m_cViewArea, SIGNAL( moveScroll( QPoint ) ), this, SLOT( adjustScrollBarByOffset( QPoint ) ) ); + connect( m_cViewArea, SIGNAL( moveScroll( QPoint ) ), this, SIGNAL( scrollBarMoved( QPoint ) ) ); connect( m_cViewArea, SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectedArea( QRect ) ) ); connect( m_cViewArea, SIGNAL( positionChanged( const QPoint & ) ), this, SLOT( updatePixelValueStatusBar( const QPoint & ) ) ); diff --git a/app/plaYUVerApp.cpp b/app/plaYUVerApp.cpp index 94e1485..8a3db8a 100644 --- a/app/plaYUVerApp.cpp +++ b/app/plaYUVerApp.cpp @@ -196,6 +196,7 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) connect( subWindow, SIGNAL( updateStatusBar( const QString& ) ), this, SLOT( updateStatusBar( const QString& ) ) ); connect( subWindow, SIGNAL( zoomChangedOnSubWindow() ), this, SLOT( updateZoomFactorSBox() ) ); + connect( subWindow, SIGNAL( scrollBarMoved( const QPoint ) ), this, SLOT( moveAllScrollBars( const QPoint ) ) ); videoSubWindow->zoomToFit(); videoSubWindow->getViewArea()->setTool( m_appTool ); @@ -422,7 +423,10 @@ Void plaYUVerApp::zoomToFactorAll( double factor ) for( Int i = 0; i < mdiArea->subWindowList().size(); i++ ) { subWindow = qobject_cast( mdiArea->subWindowList().at( i ) ); - subWindow->zoomToFactor(factor); + if( m_pcCurrentSubWindow == subWindow ) + continue; + else + subWindow->zoomToFactor(factor); } } @@ -459,6 +463,21 @@ Void plaYUVerApp::updateZoomFactorSBox() } } +Void plaYUVerApp::moveAllScrollBars( const QPoint offset ) +{ + SubWindowHandle *subWindow; + for( Int i = 0; i < mdiArea->subWindowList().size(); i++ ) + { + subWindow = qobject_cast( mdiArea->subWindowList().at( i ) ); + + if( m_pcCurrentSubWindow == subWindow ) + continue; + else + subWindow->adjustScrollBarByOffset(offset); + } + +} + // ----------------------- Drag and drop functions ---------------------- Void plaYUVerApp::dragEnterEvent( QDragEnterEvent *event ) diff --git a/app/plaYUVerApp.h b/app/plaYUVerApp.h index b563f00..255ddfc 100644 --- a/app/plaYUVerApp.h +++ b/app/plaYUVerApp.h @@ -105,6 +105,8 @@ private Q_SLOTS: void updateZoomFactorSBox(); void updateStatusBar( const QString& ); + void moveAllScrollBars( const QPoint offset ); + private: class PlaYUVerMdiArea: public QMdiArea