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

View File

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