Change how status bar are updated. signal now come from subwindowhandle

This commit is contained in:
jfmcarreira committed 2014-12-14 23:32:26 +00:00
1 parent 35f374fb9c
commit 0261896387
8 files changed
+60 -19

No files matched your search

+7 -2
View File
@@ -175,8 +175,13 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModul
{
interfaceChild = new VideoSubWindow( m_pcParent, true );
interfaceChild->setWindowName( windowName );
connect( interfaceChild->getViewArea(), SIGNAL( positionChanged(const QPoint &, PlaYUVerFrame *) ), m_pcParent,
SLOT( updatePixelValueStatusBar(const QPoint &, PlaYUVerFrame *) ) );
// connect( interfaceChild->getViewArea(), SIGNAL( positionChanged(const QPoint &, PlaYUVerFrame *) ), m_pcParent,
// SLOT( updatePixelValueStatusBar(const QPoint &, PlaYUVerFrame *) ) );
connect( interfaceChild, SIGNAL( updateStatusBar( const QString& ) ), m_pcParent, SLOT( updateStatusBar( const QString& ) ) );
connect( interfaceChild, SIGNAL( zoomChanged() ), m_pcParent, SLOT( updateZoomFactorSBox() ) );
pcCurrModuleIf->m_pcDisplaySubWindow = interfaceChild;
pcCurrModuleIf->m_pcDisplaySubWindow->setModule( pcCurrModuleIf );
}
+1
View File
@@ -84,6 +84,7 @@ public:
Q_SIGNALS:
void zoomChanged();
void updateStatusBar( const QString& );
};
+34 -13
View File
@@ -37,11 +37,10 @@ QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& array
for( Int i = 0; i < array.size(); i++ )
{
d = array.at( i );
out << d.m_cFilename
<< d.m_uiWidth
<< d.m_uiHeight
<< d.m_iPelFormat
<< d.m_uiFrameRate;
out << d.m_cFilename << d.m_uiWidth
<< d.m_uiHeight
<< d.m_iPelFormat
<< d.m_uiFrameRate;
}
return out;
@@ -97,6 +96,7 @@ VideoSubWindow::VideoSubWindow( QWidget * parent, Bool isModule ) :
connect( m_cViewArea, SIGNAL( moveScroll( QPoint ) ), this, SLOT( adjustScrollBarByOffset(QPoint) ) );
connect( m_cViewArea, SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectedArea( QRect ) ) );
connect( m_cViewArea, SIGNAL( positionChanged( const QPoint & ) ), this, SLOT( updatePixelValueStatusBar( const QPoint & ) ) );
connect( m_cScrollArea->horizontalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateLastScrollValue() ) );
connect( m_cScrollArea->verticalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateLastScrollValue() ) );
@@ -113,7 +113,7 @@ VideoSubWindow::~VideoSubWindow()
delete m_cViewArea;
delete m_cScrollArea;
if( m_pCurrStream )
delete m_pCurrStream;
delete m_pCurrStream;
}
Void VideoSubWindow::reloadFile()
@@ -129,9 +129,9 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog )
Int InputFormat = -1;
if( !m_pCurrStream )
{
m_pCurrStream = new PlaYUVerStream;
}
{
m_pCurrStream = new PlaYUVerStream;
}
m_pCurrStream->getFormat( Width, Height, InputFormat, FrameRate );
@@ -173,8 +173,7 @@ Bool VideoSubWindow::loadFile( PlaYUVerStreamInfo* streamInfo )
m_pCurrStream = new PlaYUVerStream;
}
if( !m_pCurrStream->open( streamInfo->m_cFilename, streamInfo->m_uiWidth, streamInfo->m_uiHeight, streamInfo->m_iPelFormat,
streamInfo->m_uiFrameRate ) )
if( !m_pCurrStream->open( streamInfo->m_cFilename, streamInfo->m_uiWidth, streamInfo->m_uiHeight, streamInfo->m_iPelFormat, streamInfo->m_uiFrameRate ) )
{
return false;
}
@@ -287,8 +286,7 @@ Bool VideoSubWindow::save( QString filename )
PlaYUVerFrame* saveFrame = m_pcCurrFrame;
if( m_cSelectedArea.isValid() )
{
saveFrame = new PlaYUVerFrame( m_pcCurrFrame, m_cSelectedArea.x(), m_cSelectedArea.y(),
m_cSelectedArea.width(), m_cSelectedArea.height() );
saveFrame = new PlaYUVerFrame( m_pcCurrFrame, m_cSelectedArea.x(), m_cSelectedArea.y(), m_cSelectedArea.width(), m_cSelectedArea.height() );
}
if( !saveFrame )
{
@@ -472,6 +470,29 @@ void VideoSubWindow::updateLastScrollValue()
m_cLastScroll.setY( scrollBar->value() );
}
Void VideoSubWindow::updatePixelValueStatusBar( const QPoint& pos )
{
if( m_pcCurrFrame )
{
PlaYUVerFrame::Pixel sPixelValue;
Int iWidth, iHeight;
Int posX = pos.x();
Int posY = pos.y();
QString strStatus;
iWidth = m_pcCurrFrame->getWidth();
iHeight = m_pcCurrFrame->getHeight();
if( ( posX < iWidth ) && ( posX >= 0 ) && ( posY < iHeight ) && ( posY >= 0 ) )
{
strStatus = QString( "(%1,%2) " ).arg( posX ).arg( posY );
sPixelValue = m_pcCurrFrame->getPixelValue( pos.x(), pos.y(), PlaYUVerFrame::COLOR_YUV );
strStatus.append( QString( "Y: %1 U: %2 V: %3" ).arg( sPixelValue.Y() ).arg( sPixelValue.Cb() ).arg( sPixelValue.Cr() ) );
emit updateStatusBar( strStatus );
}
}
}
QSize VideoSubWindow::sizeHint() const
{
QSize maxSize; // The size of the parent (viewport widget
+1
View File
@@ -204,6 +204,7 @@ public Q_SLOTS:
void processZoomChanged( double , QPoint );
void adjustScrollBarByOffset( QPoint Offset );
void updateLastScrollValue();
void updatePixelValueStatusBar( const QPoint& );
};
} // NAMESPACE
+1 -1
View File
@@ -638,7 +638,7 @@ void ViewArea::mouseMoveEvent( QMouseEvent *event )
QPoint actualPos = windowToView( event->pos() );
QRect updateRect;
emit positionChanged( actualPos, m_pcCurrFrame );
emit positionChanged( actualPos );
// If mouse left button pressed
if( event->buttons() == Qt::LeftButton && m_lastPos != QPoint( -1, -1 ) )
+1 -1
View File
@@ -123,7 +123,7 @@ public:
Q_SIGNALS:
void selectionChanged( const QRect &rect );
void positionChanged( const QPoint &pos, PlaYUVerFrame *frame );
void positionChanged( const QPoint &pos );
void moveScroll( QPoint offset );
void zoomFactorChanged( double factor , QPoint center);
+14 -2
View File
@@ -190,10 +190,10 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
statusBar()->showMessage( tr( "Loading file..." ) );
mdiArea->addSubWindow( videoSubWindow );
videoSubWindow->show();
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( subWindow, SIGNAL( updateStatusBar( const QString& ) ), this, SLOT( updateStatusBar( const QString& ) ) );
connect( subWindow, SIGNAL( zoomChanged() ), this, SLOT( updateZoomFactorSBox() ) );
videoSubWindow->zoomToFit();
@@ -811,6 +811,18 @@ Void plaYUVerApp::chageSubWindowSelection()
// ----------------------- Status bar Functions -----------------------
Void plaYUVerApp::updateStatusBar( const QString& statusBarString )
{
if( !statusBarString.isEmpty() )
{
statusBar()->showMessage( statusBarString, 5000 );
}
else
{
statusBar()->showMessage( " " );
}
}
Void plaYUVerApp::updatePixelValueStatusBar( const QPoint & pos, PlaYUVerFrame* frame )
{
PlaYUVerFrame::Pixel sPixelValue;
+1
View File
@@ -113,6 +113,7 @@ private Q_SLOTS:
void setActiveSubWindow( QWidget *window );
void updatePixelValueStatusBar( const QPoint & pos, PlaYUVerFrame* frame );
void updateStatusBar( const QString& );
void updatePropertiesSelectedArea( QRect area );