Change window title in SubWindowManager and add setTool and virtual function of SubWindowHandle

This commit is contained in:
2015-03-12 17:47:48 +00:00
parent 006c254bf6
commit 5017bf86f6
7 changed files with 48 additions and 24 deletions
+19 -9
View File
@@ -129,6 +129,12 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowHandle *window )
}
}
}
if( m_pcActiveWindow )
{
parentWidget()->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() );
}
}
Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowHandle *window, Qt::WindowFlags flags )
@@ -136,7 +142,8 @@ Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowHandle *window, Qt::WindowF
if( window )
{
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() ) );
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* ) ) );
@@ -211,10 +218,10 @@ SubWindowHandle* PlaYUVerSubWindowHandle::activeSubWindow() const
return m_pcActiveWindow;
}
QList<SubWindowHandle*> PlaYUVerSubWindowHandle::findSubWindow( const QString &windowName ) const
QList<SubWindowHandle*> PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const
{
QList<SubWindowHandle*> apcSubWindowList;
if( windowName.isEmpty() )
if( uiCategory == 0 )
{
apcSubWindowList = m_apcSubWindowList;
}
@@ -222,21 +229,24 @@ QList<SubWindowHandle*> PlaYUVerSubWindowHandle::findSubWindow( const QString &w
{
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
{
if( m_apcSubWindowList.at( i )->getWindowName() == windowName )
if( m_apcSubWindowList.at( i )->getCategory() & uiCategory )
apcSubWindowList.append( m_apcSubWindowList.at( i ) );
}
}
return apcSubWindowList;
}
QList<SubWindowHandle*> PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const
QList<SubWindowHandle*> PlaYUVerSubWindowHandle::findSubWindow( const QString &windowName, const UInt uiCategory ) const
{
QList<SubWindowHandle*> subWindowList = findSubWindow( uiCategory );
QList<SubWindowHandle*> apcSubWindowList;
QList<SubWindowHandle*> subWindowList = findSubWindow();
for( Int i = 0; i < subWindowList.size(); i++ )
if( !windowName.isEmpty() )
{
if( subWindowList.at( i )->getCategory() & uiCategory )
apcSubWindowList.append( subWindowList.at( i ) );
for( Int i = 0; i < subWindowList.size(); i++ )
{
if( subWindowList.at( i )->getWindowName() == windowName )
apcSubWindowList.append( subWindowList.at( i ) );
}
}
return apcSubWindowList;
}
+2 -2
View File
@@ -51,8 +51,8 @@ public:
SubWindowHandle *activeSubWindow() const;
QList<SubWindowHandle*> findSubWindow( const QString &aName = QString() ) const;
QList<SubWindowHandle*> findSubWindow( const UInt uiCategory ) const;
QList<SubWindowHandle*> findSubWindow( const UInt uiCategory = 0 ) const;
QList<SubWindowHandle*> findSubWindow( const QString &aName, const UInt uiCategory = 0 ) const;
SubWindowHandle* findSubWindow( const SubWindowHandle* subWindow ) const;
Void createActions();
+4 -1
View File
@@ -51,6 +51,10 @@ public:
PlotSubWindow( QWidget * parent = 0 );
~PlotSubWindow();
Void setTool( UInt uiTool )
{
}
/**
* Virtual functions from SubWindowHandle
*/
@@ -69,7 +73,6 @@ public:
*/
// QSize sizeHint() const;
// QSize sizeHint( const QSize & ) const;
};
} // NAMESPACE
+1 -2
View File
@@ -73,9 +73,8 @@ QMenu* QualityHandle::createMenu()
m_pcMenuQuality = new QMenu( "Quality", this );
QMenu* metricsSubMenu = m_pcMenuQuality->addMenu( "Quality Metrics" );
metricsSubMenu->addActions( m_actionGroupQualityMetric->actions() );
//m_pcMenuQuality->addActions( m_actionGroupQualityMetric->actions() );
//m_pcMenuQuality->addSeparator();
m_pcMenuQuality->addAction( m_arrayActions[SELECT_REF_ACT] );
m_pcMenuQuality->addSeparator();
//m_pcMenuQuality->addAction( m_arrayActions[CREATE_PLOT] );
return m_pcMenuQuality;
}
+5
View File
@@ -76,6 +76,11 @@ public:
SubWindowHandle( QWidget *, UInt );
~SubWindowHandle();
/**
* Show the image at its original size
*/
virtual Void setTool( UInt uiTool ) = 0;
/**
* Show the image at its original size
*/
+5
View File
@@ -190,6 +190,11 @@ public:
return m_apcCurrentModule;
}
Void setTool( UInt uiTool )
{
m_cViewArea->setTool( ( ViewArea::eTool )uiTool );
}
/**
* Virtual functions from SubWindowHandle
*/
+12 -10
View File
@@ -366,12 +366,10 @@ Void plaYUVerApp::setTool( Int idxTool )
{
m_uiViewTool = idxTool;
actionGroupTools->actions().at( m_uiViewTool )->setChecked( true );
VideoSubWindow* videoSubWindow;
QList<SubWindowHandle*> subWindowList = m_pcWindowHandle->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW );
QList<SubWindowHandle*> subWindowList = m_pcWindowHandle->findSubWindow();
for( Int i = 0; i < subWindowList.size(); i++ )
{
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
videoSubWindow->getViewArea()->setTool( ( ViewArea::eTool )m_uiViewTool );
subWindowList.at( i )->setTool( m_uiViewTool );
}
}
@@ -494,8 +492,6 @@ Void plaYUVerApp::update()
m_pcCurrentVideoSubWindow = qobject_cast<VideoSubWindow*>( m_pcCurrentSubWindow );
}
setWindowTitle( QApplication::applicationName() + " - " + m_pcCurrentSubWindow->getWindowName() );
if( m_pcCurrentVideoSubWindow )
{
if( !m_pcWindowHandle->findSubWindow( m_pcCurrentVideoSubWindow->getRefSubWindow() ) )
@@ -527,16 +523,22 @@ Void plaYUVerApp::updateMenus()
{
Bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 );
Bool hasVideoStreamSubWindow = false;
if( m_pcCurrentSubWindow )
if( m_pcCurrentSubWindow->getCategory() & SubWindowHandle::VIDEO_STREAM_SUBWINDOW )
hasVideoStreamSubWindow = true;
m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false );
m_arrayActions[SAVE_ACT]->setEnabled( hasSubWindow );
m_arrayActions[FORMAT_ACT]->setEnabled( hasSubWindow );
m_arrayActions[CLOSE_ACT]->setEnabled( hasSubWindow );
m_arrayActions[RELOAD_ACT]->setEnabled( hasSubWindow );
m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasSubWindow );
m_arrayActions[LOAD_ALL_ACT]->setEnabled( hasSubWindow );
m_arrayActions[CLOSEALL_ACT]->setEnabled( hasSubWindow );
m_arrayActions[FORMAT_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[RELOAD_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[LOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[ZOOM_IN_ACT]->setEnabled( hasSubWindow );
m_arrayActions[ZOOM_OUT_ACT]->setEnabled( hasSubWindow );
m_arrayActions[ZOOM_NORMAL_ACT]->setEnabled( hasSubWindow );