Minor fixes in progress bar

This commit is contained in:
jfmcarreira committed 2015-04-08 01:37:48 +01:00
1 parent 0301a11a26
commit b6b3f3e719
3 files changed
+37 -10

No files matched your search

+8 -4
View File
@@ -45,10 +45,13 @@ ProgressBar::ProgressBar( QWidget *parent, UInt maxValue ) :
setLayout( mainLayout );
setWindowTitle( QStringLiteral( "Progress" ) );
QSize screenSize = QApplication::desktop()->availableGeometry().size();
QPoint screenCenter = QApplication::desktop()->availableGeometry().center();
resize( screenSize.width() / 4, screenSize.height() / 10 );
move( screenCenter.x() - screenSize.width() / 8, screenCenter.y() - screenSize.height() / 10 );
// QSize appSize = QApplication::desktop()->availableGeometry().size();
// QPoint appCenter = QApplication::desktop()->availableGeometry().center();
QSize appSize = parent->size();
QPoint appPos = parent->pos();
QPoint appCenter = QPoint( appPos.x() + appSize.width() / 2, appPos.y() + appSize.height() / 2 );
resize( appSize.width() / 4, appSize.height() / 10 );
move( appCenter.x() - appSize.width() / 8, appCenter.y() - appSize.height() / 20 );
show();
}
@@ -56,5 +59,6 @@ Void ProgressBar::incrementProgress( UInt increment )
{
m_uiProgress += increment;
m_pcProgressBar->setValue( m_uiProgress );
update();
}
} // NAMESPACE
+1
View File
@@ -27,6 +27,7 @@
#include "PlaYUVerAppDefs.h"
#include <QWidget>
#include <QDialog>
class QProgressBar;
+28 -6
View File
@@ -106,14 +106,35 @@ QDockWidget* QualityHandle::createDock()
Void QualityHandle::updateMenus()
{
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow *>( m_pcMainWindowManager->activeSubWindow() );
Bool hasSubWindow = pcSubWindow ? true : false;
VideoSubWindow* pcCurrentVideoSubWindow = qobject_cast<VideoSubWindow *>( m_pcMainWindowManager->activeSubWindow() );
Bool hasSubWindow = pcCurrentVideoSubWindow ? true : false;
Bool hasReference = false;
Bool isReference = false;
if( hasSubWindow )
{
hasReference = pcCurrentVideoSubWindow->getRefSubWindow() != NULL ? true : false;
if( hasSubWindow && !hasReference )
{
VideoSubWindow* pcVideoSubWindow;
QList<SubWindowHandle*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_STREAM_SUBWINDOW );
for( Int i = 0; i < subWindowList.size(); i++ )
{
pcVideoSubWindow = qobject_cast<VideoSubWindow *>( subWindowList.at( i ) );
if( pcVideoSubWindow->getRefSubWindow() == pcCurrentVideoSubWindow )
{
isReference = true;
break;
}
}
}
}
m_pcSubMenuQualityMetrics->setEnabled( hasSubWindow );
m_arrayActions[SELECT_CURR_REF_ACT]->setEnabled( hasSubWindow );
m_arrayActions[PLOT_QUALITY]->setEnabled( hasSubWindow );
m_arrayActions[PLOT_SEVERAL_QUALITY]->setEnabled( hasSubWindow );
m_arrayActions[PLOT_QUALITY]->setEnabled( hasReference );
m_arrayActions[PLOT_SEVERAL_QUALITY]->setEnabled( hasReference | isReference );
m_pcQualityHandleSideBar->updateSideBar( hasSubWindow );
}
@@ -243,6 +264,7 @@ Void QualityHandle::slotSelectCurrentAsReference()
}
m_pcQualityHandleSideBar->updateSidebarData();
m_pcQualityHandleDock->show();
emit changed();
}
}
@@ -264,7 +286,7 @@ Void QualityHandle::slotPlotQualitySingle()
measureQuality( apcWindowList );
QApplication::restoreOverrideCursor();
//#endif
emit changed();
}
}
}
@@ -303,7 +325,7 @@ Void QualityHandle::slotPlotQualitySeveral()
measureQuality( apcWindowList );
QApplication::restoreOverrideCursor();
//#endif
emit changed();
}
}
}