Fix invalid slots in the module sub window

This commit is contained in:
2015-02-02 22:47:49 +00:00
parent e9443dcfd3
commit 87e0666816
5 changed files with 37 additions and 26 deletions
+3 -6
View File
@@ -304,16 +304,12 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
pcModuleSubWindow->setWindowName( windowName );
connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo, SLOT( updateSelectionArea( QRect ) ) );
connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo,
SLOT( zoomToFactorAll( double, QPoint ) ) );
connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) );
connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) );
//connect( pcModuleSubWindow, SIGNAL( updateStatusBar( const QString& ) ), this, SLOT( updateStatusBar( const QString& ) ) );
//connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), this, SLOT( updateZoomFactorSBox() ) );
pcCurrModuleIf->m_pcDisplaySubWindow = pcModuleSubWindow;
//m_pcMdiArea->addSubWindow( pcModuleSubWindow );
}
}
@@ -351,6 +347,7 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
pcCurrModuleIf->m_pcSubWindow[i]->associateModule( pcCurrModuleIf );
}
}
applyModuleIf( pcCurrModuleIf, false );
QCoreApplication::processEvents();
+19 -13
View File
@@ -22,6 +22,7 @@
* \brief Handle multiple sub-windows
*/
#include "plaYUVerApp.h"
#include "PlaYUVerSubWindowHandle.h"
#include "PlaYUVerMdiSubWindow.h"
#include "SubWindowHandle.h"
@@ -131,21 +132,26 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowHandle *window )
Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowHandle *window, Qt::WindowFlags flags )
{
if( m_uiWindowMode == NormalSubWindows )
if( window )
{
connect( window, SIGNAL( aboutToActivate( SubWindowHandle* ) ), this, SLOT( updateActiveSubWindow( SubWindowHandle* ) ) );
connect( window, SIGNAL( aboutToClose( SubWindowHandle* ) ), this, SLOT( removeSubWindow( SubWindowHandle* ) ) );
connect( window, SIGNAL( updateStatusBar( const QString& ) ), qobject_cast<plaYUVerApp*>( parent() ), SLOT( updateStatusBar( const QString& ) ) );
connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), qobject_cast<plaYUVerApp*>( parent() ), SLOT( updateZoomFactorSBox() ) );
if( m_uiWindowMode == NormalSubWindows )
{
connect( window, SIGNAL( aboutToActivate( SubWindowHandle* ) ), this, SLOT( updateActiveSubWindow( SubWindowHandle* ) ) );
connect( window, SIGNAL( aboutToClose( SubWindowHandle* ) ), this, SLOT( removeSubWindow( SubWindowHandle* ) ) );
}
if( m_uiWindowMode == MdiWSubWindows )
{
PlaYUVerMdiSubWindow* mdiSubWindow = new PlaYUVerMdiSubWindow;
mdiSubWindow->setWidget( window );
m_pcMdiArea->addSubWindow( mdiSubWindow );
m_apcMdiSubWindowList.append( mdiSubWindow );
window->setSubWindow( mdiSubWindow );
connect( mdiSubWindow, SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this, SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
}
m_apcSubWindowList.append( window );
}
if( m_uiWindowMode == MdiWSubWindows )
{
PlaYUVerMdiSubWindow* mdiSubWindow = new PlaYUVerMdiSubWindow;
mdiSubWindow->setWidget( window );
m_pcMdiArea->addSubWindow( mdiSubWindow );
m_apcMdiSubWindowList.append( mdiSubWindow );
window->setSubWindow( mdiSubWindow );
connect( mdiSubWindow, SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this, SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
}
m_apcSubWindowList.append( window );
}
Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx )
+7
View File
@@ -349,6 +349,13 @@ Void VideoSubWindow::disableModule( PlaYUVerAppModuleIf* pcModule )
ModulesHandle::destroyModuleIf( pcModule );
bRefresh |= true;
}
if( pcModule == m_pcCurrentDisplayModule )
{
pcModule = m_pcCurrentDisplayModule;
m_pcCurrentDisplayModule = 0;
ModulesHandle::destroyModuleIf( pcModule );
bRefresh |= true;
}
}
else
{
+4 -4
View File
@@ -28,6 +28,10 @@
#endif
#include "plaYUVerApp.h"
#include "PlaYUVerSubWindowHandle.h"
#include "VideoHandle.h"
#include "QualityHandle.h"
#include "ModulesHandle.h"
#include "DialogSubWindowSelector.h"
#define SYNCHRONISED_ZOON 1
@@ -183,10 +187,6 @@ Void plaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
connect( subWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) );
connect( subWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) );
connect( subWindow, SIGNAL( updateStatusBar( const QString& ) ), this, SLOT( updateStatusBar( const QString& ) ) );
connect( subWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), this, SLOT( updateZoomFactorSBox() ) );
videoSubWindow->zoomToFit();
videoSubWindow->getViewArea()->setTool( ( ViewArea::eTool )m_uiViewTool );
updateZoomFactorSBox();
+4 -3
View File
@@ -36,9 +36,7 @@
#include "PlaYUVerAppAdaptor.h"
#endif
#include <QMainWindow>
#include "VideoHandle.h"
#include "QualityHandle.h"
#include "ModulesHandle.h"
#include "SubWindowHandle.h"
#include "AboutDialog.h"
#include "VideoSubWindow.h"
@@ -48,6 +46,9 @@ namespace plaYUVer
class PlaYUVerStream;
class PlaYUVerSubWindowHandle;
class VideoHandle;
class QualityHandle;
class ModulesHandle;
class PlaYUVerAppAdaptor;
class plaYUVerApp: public QMainWindow