Changes in the way signals and slots are connected between playuver layers
This commit is contained in:
@@ -81,6 +81,10 @@ public:
|
||||
{
|
||||
return m_uiCategory;
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void zoomChanged();
|
||||
|
||||
};
|
||||
|
||||
} // NAMESPACE
|
||||
|
||||
@@ -93,7 +93,8 @@ VideoSubWindow::VideoSubWindow( QWidget * parent, Bool isModule ) :
|
||||
|
||||
// Create a new interface to show images
|
||||
m_cViewArea = new ViewArea( m_cScrollArea );
|
||||
connect( m_cViewArea, SIGNAL( zoomFactorChanged( double , QPoint) ), this, SLOT( adjustScrollBarByZoom(double, QPoint) ) );
|
||||
connect( m_cViewArea, SIGNAL( zoomFactorChanged( double , QPoint) ), this, SLOT( processZoomChanged(double, QPoint) ) );
|
||||
|
||||
connect( m_cViewArea, SIGNAL( moveScroll( QPoint ) ), this, SLOT( adjustScrollBarByOffset(QPoint) ) );
|
||||
connect( m_cViewArea, SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectedArea( QRect ) ) );
|
||||
connect( m_cScrollArea->horizontalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateLastScrollValue() ) );
|
||||
@@ -406,6 +407,12 @@ Void VideoSubWindow::scaleView( const QSize & size )
|
||||
updateLastScrollValue();
|
||||
}
|
||||
|
||||
Void VideoSubWindow::processZoomChanged( Double factor, QPoint center )
|
||||
{
|
||||
adjustScrollBarByZoom( factor, center );
|
||||
emit zoomChanged();
|
||||
}
|
||||
|
||||
void VideoSubWindow::adjustScrollBarByOffset( QPoint Offset )
|
||||
{
|
||||
QScrollBar *scrollBar = m_cScrollArea->horizontalScrollBar();
|
||||
@@ -420,7 +427,7 @@ void VideoSubWindow::adjustScrollBarByOffset( QPoint Offset )
|
||||
|
||||
// This function was developed with help of the schematics presented in
|
||||
// http://stackoverflow.com/questions/13155382/jscrollpane-zoom-relative-to-mouse-position
|
||||
void VideoSubWindow::adjustScrollBarByZoom( double factor, QPoint center )
|
||||
Void VideoSubWindow::adjustScrollBarByZoom( Double factor, QPoint center )
|
||||
{
|
||||
QScrollBar *scrollBar = m_cScrollArea->horizontalScrollBar();
|
||||
if( center.isNull() )
|
||||
|
||||
@@ -159,18 +159,19 @@ public:
|
||||
Void applyModuleAllFrames();
|
||||
|
||||
/**
|
||||
* Reimplemented function from SubWindowHandle
|
||||
* Virtual functions from SubWindowHandle
|
||||
*/
|
||||
Void normalSize();
|
||||
Void zoomToFit();
|
||||
Void scaleView( Double scale );
|
||||
|
||||
Void scaleViewByRatio( Double ratio );
|
||||
Double getScaleFactor()
|
||||
{
|
||||
return m_cViewArea->getZoomFactor();
|
||||
}
|
||||
|
||||
Void adjustScrollBarByZoom( Double factor, QPoint center );
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
QString getWindowShortName()
|
||||
@@ -200,7 +201,7 @@ protected:
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateSelectedArea( QRect area );
|
||||
void adjustScrollBarByZoom( double factor, QPoint center );
|
||||
void processZoomChanged( double , QPoint );
|
||||
void adjustScrollBarByOffset( QPoint Offset );
|
||||
void updateLastScrollValue();
|
||||
};
|
||||
|
||||
+3
-2
@@ -169,6 +169,7 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
return;
|
||||
}
|
||||
videoSubWindow = new VideoSubWindow( this ); //createSubWindow();
|
||||
SubWindowHandle *subWindow = videoSubWindow;
|
||||
if( !pStreamInfo )
|
||||
{
|
||||
Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName );
|
||||
@@ -192,7 +193,8 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
connect( videoSubWindow->getViewArea(), SIGNAL( positionChanged(const QPoint &, PlaYUVerFrame *) ), this,
|
||||
SLOT( updatePixelValueStatusBar(const QPoint &, PlaYUVerFrame *) ) );
|
||||
connect( videoSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this, SLOT( updatePropertiesSelectedArea( QRect ) ) );
|
||||
connect( videoSubWindow->getViewArea(), SIGNAL( zoomFactorChanged( double , QPoint ) ), this, SLOT( updateZoomFactorSBox() ) );
|
||||
|
||||
connect( subWindow, SIGNAL( zoomChanged() ), this, SLOT( updateZoomFactorSBox() ) );
|
||||
|
||||
videoSubWindow->zoomToFit();
|
||||
videoSubWindow->getViewArea()->setTool( m_appTool );
|
||||
@@ -744,7 +746,6 @@ Void plaYUVerApp::scaleFrame( int ratio )
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
m_pcCurrentSubWindow->scaleView( ( Double )( ratio ) / 100.0 );
|
||||
updateZoomFactorSBox();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user