From 51ed3e7aaf5e64de6a18cad2b184b0d7b2adec2d Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 2 Jul 2014 16:34:07 +0100 Subject: [PATCH] Minor bugfixes in quality measurement sidebar --- source/app/QualityMeasurementSidebar.cpp | 15 +++++++++++++-- source/app/plaYUVerApp.cpp | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/source/app/QualityMeasurementSidebar.cpp b/source/app/QualityMeasurementSidebar.cpp index 0797662..d32ea6a 100644 --- a/source/app/QualityMeasurementSidebar.cpp +++ b/source/app/QualityMeasurementSidebar.cpp @@ -118,7 +118,16 @@ Void QualityMeasurementSidebar::updateSubWindowList() } m_comboBoxRef->clear(); m_comboBoxRef->insertItems( 0, m_pcWindowListNames ); + m_comboBoxRef->setCurrentIndex( -1 ); + if( m_pcCurrentSubWindow ) + { + if( SubWindowHandle* refSubWindow = m_pcCurrentSubWindow->getRefSubWindow() ) + { + Int index = m_pcWindowListNames.contains( refSubWindow->getWindowName() ); + m_comboBoxRef->setCurrentIndex( index ); + } + } } Void QualityMeasurementSidebar::updateCurrentWindow( SubWindowHandle *subWindow ) @@ -134,6 +143,9 @@ Void QualityMeasurementSidebar::updateSidebarData() { if( SubWindowHandle* refSubWindow = m_pcCurrentSubWindow->getRefSubWindow() ) { + Int index = m_pcWindowListNames.contains( refSubWindow->getWindowName() ); + m_comboBoxRef->setCurrentIndex( index ); + PlaYUVerFrame* currFrame = m_pcCurrentSubWindow->getCurrFrame(); PlaYUVerFrame* refFrame = refSubWindow->getCurrFrame(); Double quality; @@ -155,10 +167,9 @@ Void QualityMeasurementSidebar::updateSidebarData() Void QualityMeasurementSidebar::slotReferenceChanged( Int index ) { - SubWindowHandle *subWindow; if( index > -1 && m_pcCurrentSubWindow ) { - subWindow = qobject_cast( m_pcMainWindowMdiArea->subWindowList().at( index ) ); + SubWindowHandle *subWindow = qobject_cast( m_pcMainWindowMdiArea->subWindowList().at( index ) ); if( subWindow ) { if( m_pcCurrentSubWindow->getCurrFrame()->haveSameFmt( subWindow->getCurrFrame() ) ) diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index ca94ae9..2f11728 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -624,6 +624,7 @@ Void plaYUVerApp::seekEvent( Int direction ) { m_pcCurrentSubWindow->seekRelativeEvent( direction > 0 ? true : false ); } + m_pcQualityMeasurement->updateSidebarData(); updateFrameProperties(); updateCurrFrameNum(); } @@ -644,6 +645,7 @@ Void plaYUVerApp::seekSliderEvent( Int new_frame_num ) { m_pcCurrentSubWindow->seekAbsoluteEvent( ( UInt )new_frame_num ); } + m_pcQualityMeasurement->updateSidebarData(); updateFrameProperties(); updateCurrFrameNum(); }