Make sure all plot windows are resized to predefined size

This commit is contained in:
Magne Sjaastad 2019-08-26 11:00:09 +02:00
parent 4b92427a4d
commit 7d5df167fd
2 changed files with 12 additions and 17 deletions

View File

@ -18,8 +18,8 @@
#include "RiaRegressionTestRunner.h"
#include "RiaGuiApplication.h"
#include "RiaGitDiff.h"
#include "RiaGuiApplication.h"
#include "RiaImageCompareReporter.h"
#include "RiaImageFileCompare.h"
#include "RiaLogging.h"
@ -199,7 +199,7 @@ void RiaRegressionTestRunner::runRegressionTest()
regressionTestConfigureProject();
resizeMaximizedPlotWindows();
resizePlotWindows();
QString fullPathGeneratedFolder = testCaseFolder.absoluteFilePath(generatedFolderName);
RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(fullPathGeneratedFolder);
@ -499,7 +499,7 @@ void RiaRegressionTestRunner::regressionTestConfigureProject()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaRegressionTestRunner::resizeMaximizedPlotWindows()
void RiaRegressionTestRunner::resizePlotWindows()
{
RimProject* proj = RiaApplication::instance()->project();
if (!proj) return;
@ -515,20 +515,16 @@ void RiaRegressionTestRunner::resizeMaximizedPlotWindows()
{
if (viewWindow->isMdiWindow())
{
RimMdiWindowGeometry wndGeo = viewWindow->mdiWindowGeometry();
if (wndGeo.isMaximized)
QWidget* viewWidget = viewWindow->viewWidget();
if (viewWidget)
{
QWidget* viewWidget = viewWindow->viewWidget();
if (viewWidget)
QMdiSubWindow* mdiWindow = plotMainWindow->findMdiSubWindow(viewWidget);
if (mdiWindow)
{
QMdiSubWindow* mdiWindow = plotMainWindow->findMdiSubWindow(viewWidget);
if (mdiWindow)
{
mdiWindow->showNormal();
mdiWindow->showNormal();
viewWidget->resize(RiaRegressionTestRunner::regressionDefaultImageSize());
}
viewWidget->resize(RiaRegressionTestRunner::regressionDefaultImageSize());
}
}
}
@ -603,8 +599,7 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution(const QDir
for (const auto& s : m_testFilter)
{
QString trimmed = s.trimmed();
if ((m_appendAllTestsAfterLastItemInFilter && anyMatchFound) ||
baseName.contains(trimmed, Qt::CaseInsensitive))
if ((m_appendAllTestsAfterLastItemInFilter && anyMatchFound) || baseName.contains(trimmed, Qt::CaseInsensitive))
{
foldersMatchingTestFilter.push_back(fi);
anyMatchFound = true;

View File

@ -60,7 +60,7 @@ private:
const QDir& testDir);
static void removeDirectoryWithContent(QDir& dirToDelete);
static void resizeMaximizedPlotWindows();
static void resizePlotWindows();
static QSize regressionDefaultImageSize();
static QString diff2htmlHeaderText(const QString& testRootPath);
QFileInfoList subDirectoriesForTestExecution(const QDir& directory);