Popup window placement improvements (#13464)

* Improve parent settings for message boxes and progress info
This commit is contained in:
JJ authored and GitHub committed 2026-01-21 19:11:41 +01:00
1 parent ef3ced9b8a
commit 3e06a61ed5
54 files changed
+203 -95

No files matched your search

@@ -246,7 +246,7 @@ bool RiaGuiApplication::askUserToSaveModifiedProject()
{
if ( RiaPreferencesSystem::current()->showProjectChangedDialog() && caf::PdmUiModelChangeDetector::instance()->isModelChanged() )
{
QMessageBox msgBox;
QMessageBox msgBox( activeMainWindow() );
msgBox.setIcon( QMessageBox::Question );
QString questionText;
@@ -284,7 +284,7 @@ bool RiaGuiApplication::saveProjectAs( const QString& fileName )
QString errMsg;
if ( !RiaApplication::saveProjectAs( fileName, &errMsg ) )
{
QMessageBox::warning( nullptr, "Error when saving project file", errMsg );
QMessageBox::warning( activeMainWindow(), "Error when saving project file", errMsg );
return false;
}
@@ -298,7 +298,7 @@ bool RiaGuiApplication::notifyUserAboutRunningJobs()
{
if ( m_project->jobCollection()->numberOfRunningJobs() > 0 )
{
QMessageBox::critical( nullptr,
QMessageBox::critical( activeMainWindow(),
"Active running jobs",
"One or more jobs are still running, you need to stop all jobs before continuing." );
return false;
@@ -1120,9 +1120,31 @@ RiuMainWindowBase* RiaGuiApplication::activeMainWindow()
QWidget* mainWindowWidget = RiaGuiApplication::activeWindow();
RiuMainWindowBase* mainWindow = dynamic_cast<RiuMainWindowBase*>( mainWindowWidget );
// If another window/app than ResInsight is active, mainWindow will be nullptr
// In that case, return a visible RI main window
if ( mainWindow == nullptr )
{
if ( instance()->isMain3dWindowVisible() )
{
mainWindow = instance()->m_mainWindow.get();
}
else if ( instance()->isMainPlotWindowVisible() )
{
mainWindow = instance()->m_mainPlotWindow.get();
}
}
return mainWindow;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QWidget* RiaGuiApplication::widgetToUseAsParent()
{
return dynamic_cast<QWidget*>( activeMainWindow() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1173,7 +1195,7 @@ void RiaGuiApplication::clearAllSelections()
void RiaGuiApplication::showFormattedTextInMessageBoxOrConsole( const QString& text )
{
// Create a message dialog with cut/paste friendly text
QDialog dlg;
QDialog dlg( widgetToUseAsParent() );
dlg.setModal( true );
QGridLayout* layout = new QGridLayout;
@@ -108,6 +108,7 @@ public:
static RimViewWindow* activeViewWindow();
static RiuMainWindowBase* activeMainWindow();
static QWidget* widgetToUseAsParent();
bool isMain3dWindowVisible() const;
bool isMainPlotWindowVisible() const;
@@ -17,6 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaMemoryCleanup.h"
#include "RiaGuiApplication.h"
#include "RiaStdStringTools.h"
#include "RigCaseCellResultsData.h"
@@ -141,7 +142,7 @@ void RiaMemoryCleanup::showMemoryReport()
QString allText = summary + "\n\n" + details;
auto dialog = new TextDialog( allText );
auto dialog = new TextDialog( allText, RiaGuiApplication::widgetToUseAsParent() );
dialog->setWindowTitle( "Memory Report" );
dialog->setMinimumSize( 800, 600 );
dialog->show();
@@ -333,7 +333,13 @@ void RiaLogging::errorInMessageBox( QWidget* parent, const QString& title, const
{
if ( RiaGuiApplication::isRunning() && !RiaRegressionTestRunner::instance()->isRunningRegressionTests() )
{
QMessageBox::warning( parent, title, text );
if ( parent == nullptr )
{
parent = RiaGuiApplication::widgetToUseAsParent();
}
QMessageBox dlg( QMessageBox::Critical, title, text, QMessageBox::Ok, parent );
dlg.setWindowFlags( dlg.windowFlags() | Qt::WindowStaysOnTopHint );
dlg.exec();
}
RiaLogging::error( text );
@@ -63,7 +63,7 @@ void RicEditPreferencesFeature::onActionTriggered( bool isChecked )
std::unique_ptr<RiaPreferences> oldPreferences = clonePreferences( app->preferences() );
RiuPropertyViewTabWidget propertyDialog( nullptr, app->preferences(), "Preferences", tabNames );
RiuPropertyViewTabWidget propertyDialog( RiaGuiApplication::widgetToUseAsParent(), app->preferences(), "Preferences", tabNames );
auto pushButton = propertyDialog.dialogButtonBox()->addButton( "Help", QDialogButtonBox::HelpRole );
connect( pushButton, &QPushButton::clicked, this, &RicEditPreferencesFeature::showHelp );
@@ -337,7 +337,7 @@ void RicShowPlotDataFeature::showTextWindow( const QString& title, const QString
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
CVF_ASSERT( plotwindow );
auto* textWiget = new RiuTextDialog();
auto* textWiget = new RiuTextDialog( RiaGuiApplication::widgetToUseAsParent() );
textWiget->setMinimumSize( 400, 600 );
textWiget->setWindowTitle( title );
@@ -274,7 +274,7 @@ void RicSumoDataFeature::onActionTriggered( bool isChecked )
{
if ( !m_dialog )
{
m_dialog = new SimpleDialog( RiaGuiApplication::instance()->mainWindow() );
m_dialog = new SimpleDialog( RiaGuiApplication::widgetToUseAsParent() );
}
m_dialog->show();
}
@@ -18,6 +18,8 @@
#include "RicEditPerforationCollectionFeature.h"
#include "RiaGuiApplication.h"
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
#include "RiuEditPerforationCollectionWidget.h"
@@ -53,7 +55,7 @@ void RicEditPerforationCollectionFeature::onActionTriggered( bool isChecked )
RimWellPath* wellPath = perforationCollection->firstAncestorOrThisOfTypeAsserted<RimWellPath>();
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
RiuEditPerforationCollectionWidget dlg( nullptr, perforationCollection );
RiuEditPerforationCollectionWidget dlg( RiaGuiApplication::widgetToUseAsParent(), perforationCollection );
dlg.exec();
perforationCollection->updateConnectedEditors();
@@ -123,7 +123,7 @@ std::pair<QStringList, RiaDefines::EnsembleGroupingMode>
QString defaultDir = app->lastUsedDialogDirectory( pathCacheName );
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
dialogTitle,
defaultDir,
m_pathFilter,
@@ -18,7 +18,7 @@
#include "RicCreateGridCaseEnsemblesFromFilesFeature.h"
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaImportEclipseCaseTools.h"
#include "RiaLogging.h"
@@ -165,7 +165,7 @@ std::pair<QStringList, RiaDefines::EnsembleGroupingMode>
QString defaultDir = app->lastUsedDialogDirectory( pathCacheName );
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
dialogTitle,
defaultDir,
m_pathFilter,
@@ -19,7 +19,7 @@
#include "RicCreateGridCaseGroupFromFilesFeature.h"
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaImportEclipseCaseTools.h"
#include "RicRecursiveFileSearchDialog.h"
@@ -42,7 +42,7 @@ void RicCreateGridCaseGroupFromFilesFeature::onActionTriggered( bool isChecked )
QString defaultDir = app->lastUsedDialogDirectory( "INPUT_FILES" );
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
"Create Grid Case Group",
defaultDir,
m_pathFilter,
@@ -19,10 +19,9 @@
#include "RicImportEclipseCasesFeature.h"
#include "RiaGuiApplication.h"
#include "RiaImportEclipseCaseTools.h"
#include "RiaApplication.h"
#include "RicRecursiveFileSearchDialog.h"
#include "RimEclipseCaseCollection.h"
@@ -45,7 +44,7 @@ void RicImportEclipseCasesFeature::onActionTriggered( bool isChecked )
QString defaultDir = app->lastUsedDialogDirectory( "BINARY_GRID" );
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
"Import Eclipse Cases",
defaultDir,
m_pathFilter,
@@ -18,7 +18,7 @@
#include "RicAdvancedSnapshotExportFeature.h"
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaViewRedrawScheduler.h"
#include "RicSnapshotViewToFileFeature.h"
@@ -79,7 +79,7 @@ void RicAdvancedSnapshotExportFeature::onActionTriggered( bool isChecked )
// Enable the command system to be able to assign a value to multiple fields at the same time
caf::CmdExecCommandSystemActivator activator;
RiuAdvancedSnapshotExportWidget dlg( nullptr, proj );
RiuAdvancedSnapshotExportWidget dlg( RiaGuiApplication::widgetToUseAsParent(), proj );
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
if ( activeView && proj->multiSnapshotDefinitions.empty() )
@@ -23,6 +23,8 @@
#include "RigFaultReactivationModel.h"
#include "RiuMainWindow.h"
#include "cafSelectionManager.h"
#include <QAction>
@@ -55,7 +57,7 @@ void RicExportInpFileFeature::onActionTriggered( bool isChecked )
QString outErrorText = QString( "Failed to export INP model to file %1.\n\n%2" )
.arg( QString::fromStdString( faultReactivationModel->inputFilename() ) )
.arg( QString::fromStdString( errorMessage ) );
QMessageBox::critical( nullptr, frmTitle, outErrorText );
QMessageBox::critical( RiuMainWindow::instance(), frmTitle, outErrorText );
}
}
}
@@ -23,6 +23,7 @@
#include "Riu3DMainWindowTools.h"
#include "RiuFileDialogTools.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "Rim3dView.h"
@@ -119,7 +120,7 @@ void RicNewFaultReactModelingFeature::onActionTriggered( bool isChecked )
}
else
{
QMessageBox::critical( nullptr, "Fault Reactivation Modeling", errMsg );
QMessageBox::critical( RiuMainWindow::instance(), "Fault Reactivation Modeling", errMsg );
}
}
}
@@ -30,6 +30,7 @@
#include "Riu3DMainWindowTools.h"
#include "Riu3dSelectionManager.h"
#include "RiuFileDialogTools.h"
#include "RiuMainWindow.h"
#include <QAction>
#include <QMessageBox>
@@ -59,7 +60,7 @@ void RicNewWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
if ( !RiaPreferencesGeoMech::current()->validateWIASettings() )
{
QMessageBox::critical( nullptr,
QMessageBox::critical( RiuMainWindow::instance(),
"Well Integrity Analysis",
"Well Integrity Analysis has not been properly set up.\nPlease go to ResInsight "
"preferences and set / check the GeoMechanical settings." );
@@ -85,7 +86,7 @@ void RicNewWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
}
else
{
QMessageBox::critical( nullptr, "Well Integrity Analysis", errMsg );
QMessageBox::critical( RiuMainWindow::instance(), "Well Integrity Analysis", errMsg );
}
}
@@ -31,6 +31,7 @@
#include "Riu3DMainWindowTools.h"
#include "RiuFileDialogTools.h"
#include "RiuMainWindow.h"
#include "cafProgressInfo.h"
#include "cafSelectionManagerTools.h"
@@ -69,7 +70,7 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
QString outErrorText = QString( "Failed to export INP model to file %1.\n\n%2" )
.arg( QString::fromStdString( model->inputFilename() ) )
.arg( QString::fromStdString( errText ) );
QMessageBox::critical( nullptr, frmTitle, outErrorText );
QMessageBox::critical( RiuMainWindow::instance(), frmTitle, outErrorText );
return;
}
@@ -81,7 +82,7 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
infoText += " \"" + model->baseDir() + "\"\n";
infoText += "\nClick OK to start the Abaqus modeling or Cancel to stop.";
auto reply = QMessageBox::information( nullptr, frmTitle, infoText, QMessageBox::Ok | QMessageBox::Cancel );
auto reply = QMessageBox::information( RiuMainWindow::instance(), frmTitle, infoText, QMessageBox::Ok | QMessageBox::Cancel );
if ( reply != QMessageBox::Ok ) return;
}
@@ -98,7 +99,7 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
if ( !process.execute() )
{
QMessageBox::critical( nullptr, frmTitle, "Failed to run modeling. Check log window for additional information." );
QMessageBox::critical( RiuMainWindow::instance(), frmTitle, "Failed to run modeling. Check log window for additional information." );
return;
}
@@ -126,7 +127,7 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
RiaApplication* app = RiaApplication::instance();
if ( !app->openOdbCaseFromFile( QString::fromStdString( model->outputOdbFilename() ) ) )
{
QMessageBox::critical( nullptr,
QMessageBox::critical( RiuMainWindow::instance(),
frmTitle,
"Failed to load modeling results from file \"" + QString::fromStdString( model->outputOdbFilename() ) +
"\". Check log window for additional information." );
@@ -33,6 +33,7 @@
#include "Riu3DMainWindowTools.h"
#include "Riu3dSelectionManager.h"
#include "RiuFileDialogTools.h"
#include "RiuMainWindow.h"
#include "cafProgressInfo.h"
#include "cafSelectionManagerTools.h"
@@ -61,13 +62,13 @@ void RicRunWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
if ( !modelSettings->geomechCase() )
{
QMessageBox::critical( nullptr, wiaTitle, "GeoMechanical case is not selected. Please check your model settings." );
QMessageBox::critical( RiuMainWindow::instance(), wiaTitle, "GeoMechanical case is not selected. Please check your model settings." );
return;
}
if ( !modelSettings->extractModelData() )
{
QMessageBox::critical( nullptr,
QMessageBox::critical( RiuMainWindow::instance(),
wiaTitle,
"Unable to get necessary data from the defined model box. Is the model box center "
"outside the reservoir?" );
@@ -76,13 +77,13 @@ void RicRunWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
if ( !RifWellIAFileWriter::writeToJsonFile( *modelSettings, outErrorText ) )
{
QMessageBox::critical( nullptr, wiaTitle, outErrorText );
QMessageBox::critical( RiuMainWindow::instance(), wiaTitle, outErrorText );
return;
}
if ( !RifWellIAFileWriter::writeToCSVFile( *modelSettings, outErrorText ) )
{
QMessageBox::critical( nullptr, wiaTitle, outErrorText );
QMessageBox::critical( RiuMainWindow::instance(), wiaTitle, outErrorText );
return;
}
@@ -94,7 +95,7 @@ void RicRunWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
infoText += " \"" + modelSettings->outputBaseDirectory() + "\"\n";
infoText += "\nClick OK to start the Abaqus modeling or Cancel to stop.";
auto reply = QMessageBox::information( nullptr, wiaTitle, infoText, QMessageBox::Ok | QMessageBox::Cancel );
auto reply = QMessageBox::information( RiuMainWindow::instance(), wiaTitle, infoText, QMessageBox::Ok | QMessageBox::Cancel );
if ( reply != QMessageBox::Ok ) return;
}
@@ -111,7 +112,7 @@ void RicRunWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
if ( !process.execute() )
{
QMessageBox::critical( nullptr, wiaTitle, "Failed to run modeling. Check log window for additional information." );
QMessageBox::critical( RiuMainWindow::instance(), wiaTitle, "Failed to run modeling. Check log window for additional information." );
return;
}
@@ -121,7 +122,7 @@ void RicRunWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
RiaApplication* app = RiaApplication::instance();
if ( !app->openOdbCaseFromFile( modelSettings->outputDrillingOdbFilename() ) )
{
QMessageBox::critical( nullptr,
QMessageBox::critical( RiuMainWindow::instance(),
wiaTitle,
"Failed to load modeling results from file \"" + modelSettings->outputDrillingOdbFilename() +
"\". Check log window for additional information." );
@@ -129,7 +130,7 @@ void RicRunWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
if ( !app->openOdbCaseFromFile( modelSettings->outputOdbFilename() ) )
{
QMessageBox::critical( nullptr,
QMessageBox::critical( RiuMainWindow::instance(),
wiaTitle,
"Failed to load modeling results from file \"" + modelSettings->outputOdbFilename() +
"\". Check log window for additional information." );
@@ -29,6 +29,7 @@
#include "RimProject.h"
#include "Riu3DMainWindowTools.h"
#include "RiuMainWindow.h"
#include "cafSelectionManagerTools.h"
@@ -61,7 +62,7 @@ void RicShowFaultReactModelFeature::onActionTriggered( bool isChecked )
{
QString outErrorText =
QString( "Failed to export INP model to file %1.\n\n%2" ).arg( exportFile ).arg( QString::fromStdString( errText ) );
QMessageBox::critical( nullptr, frmTitle, outErrorText );
QMessageBox::critical( RiuMainWindow::instance(), frmTitle, outErrorText );
return;
}
@@ -86,7 +87,7 @@ void RicShowFaultReactModelFeature::onActionTriggered( bool isChecked )
RiaApplication* app = RiaApplication::instance();
if ( !app->openOdbCaseFromFile( exportFile ) )
{
QMessageBox::critical( nullptr,
QMessageBox::critical( RiuMainWindow::instance(),
frmTitle,
"Failed to load INP model from file \"" + exportFile + "\". Check log window for additional information." );
}
@@ -18,6 +18,8 @@
#include "RicStopJobFeature.h"
#include "RiaGuiApplication.h"
#include "Jobs/RimGenericJob.h"
#include "cafSelectionManager.h"
@@ -51,7 +53,10 @@ bool RicStopJobFeature::stopJob( RimGenericJob* job )
{
if ( job == nullptr ) return false;
if ( QMessageBox::question( nullptr, job->name(), "Do you want to stop this job?", QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes )
if ( QMessageBox::question( RiaGuiApplication::widgetToUseAsParent(),
job->name(),
"Do you want to stop this job?",
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes )
{
return job->stop();
}
@@ -18,6 +18,8 @@
#include "RicViewJobLogFeature.h"
#include "RiaGuiApplication.h"
#include "RiuTextDialog.h"
#include "Jobs/RimGenericJob.h"
@@ -40,7 +42,7 @@ void RicViewJobLogFeature::onActionTriggered( bool isChecked )
QString text = log.join( "\n" );
auto* textDlg = new RiuTextDialog();
auto* textDlg = new RiuTextDialog( RiaGuiApplication::widgetToUseAsParent() );
textDlg->setMinimumSize( 600, 800 );
textDlg->setWindowTitle( "Job log for \"" + job->name() + "\"" );
@@ -36,7 +36,7 @@ void RicDeleteOsduTokenFeature::deleteUserToken()
const auto filename = RiaOsduDefines::tokenPath();
if ( !QFile::exists( filename ) ) return;
auto parent = RiaGuiApplication::activeWindow();
auto parent = RiaGuiApplication::widgetToUseAsParent();
QString question = "Do you want to delete your OSDU token file?";
auto reply = QMessageBox::question( parent, "Delete token?", question, QMessageBox::Yes, QMessageBox::No );
@@ -126,7 +126,7 @@ void RicSaveMultiPlotTemplateFeature::onActionTriggered( bool isChecked )
if ( !foundPathInPreferences )
{
QMessageBox msgBox;
QMessageBox msgBox( RiuPlotMainWindow::instance() );
msgBox.setIcon( QMessageBox::Question );
QString questionText;
@@ -18,6 +18,8 @@
#include "RicCreateContourMapPolygonAdvancedFeature.h"
#include "RiaGuiApplication.h"
#include "RicCreateContourMapPolygonTools.h"
#include "RicPolygonFromImageDialog.h"
@@ -35,7 +37,7 @@ void RicCreateContourMapPolygonAdvancedFeature::onActionTriggered( bool isChecke
auto sourceImage = RicCreateContourMapPolygonTools::convertToBinaryImage( rigContourMapProjection );
RicPolygonFromImageDialog dlg;
RicPolygonFromImageDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
dlg.setSourceImageData( sourceImage );
dlg.show();
dlg.updateAndShowImages();
@@ -18,7 +18,7 @@
#include "RicCreateEnsembleSurfaceFeature.h"
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RicCreateEnsembleSurfaceUi.h"
@@ -56,7 +56,7 @@ void RicCreateEnsembleSurfaceFeature::openDialogAndExecuteCommand()
QString fileNameFilter( "*" );
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
"Choose Eclipse Cases",
defaultDir,
pathFilter,
@@ -18,8 +18,8 @@
#include "RicCreateEnsembleWellLogFeature.h"
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RiaGuiApplication.h"
#include "RiaImportEclipseCaseTools.h"
#include "RiaLogging.h"
#include "RiaPreferencesGrid.h"
@@ -73,7 +73,7 @@ void RicCreateEnsembleWellLogFeature::openDialogAndExecuteCommand()
QString fileNameFilter( "*" );
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
"Choose Eclipse Cases",
defaultDir,
pathFilter,
@@ -32,6 +32,8 @@
#include "RimSummaryPlot.h"
#include "RimWellPlotTools.h"
#include "RiuPlotMainWindow.h"
#include "cafPdmObject.h"
#include "cafPdmObjectHandleTools.h"
#include "cafSelectionManager.h"
@@ -85,7 +87,7 @@ void RicDeleteSummaryCaseCollectionFeature::onActionTriggered( bool isChecked )
const auto ensembles = caf::SelectionManager::instance()->objectsByType<RimSummaryEnsemble>();
if ( ensembles.empty() ) return;
QMessageBox msgBox;
QMessageBox msgBox( RiuPlotMainWindow::instance() );
msgBox.setIcon( QMessageBox::Question );
QString questionText;
@@ -18,9 +18,9 @@
#include "RicImportEnsembleSurfaceFeature.h"
#include "RiaApplication.h"
#include "RiaEnsembleNameTools.h"
#include "RiaFilePathTools.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "Summary/RiaSummaryTools.h"
@@ -182,7 +182,7 @@ std::pair<QStringList, RiaDefines::EnsembleGroupingMode>
QString defaultDir = app->lastUsedDialogDirectory( pathCacheName );
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
dialogTitle,
defaultDir,
m_pathFilter,
@@ -18,8 +18,8 @@
#include "RicImportEnsembleWellLogsFeature.h"
#include "RiaApplication.h"
#include "RiaEnsembleNameTools.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RimEnsembleWellLogs.h"
@@ -130,7 +130,7 @@ std::pair<QStringList, RiaDefines::EnsembleGroupingMode>
QString defaultDir = app->lastUsedDialogDirectory( pathCacheName );
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
dialogTitle,
defaultDir,
m_pathFilter,
@@ -197,7 +197,12 @@ RicRecursiveFileSearchDialogResult
RicRecursiveFileSearchDialog::FileType::STIMPLAN_SUMMARY };
RicRecursiveFileSearchDialogResult result =
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr, dialogTitle, defaultDir, m_pathFilter, m_fileNameFilter, fileTypes );
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( RiaGuiApplication::widgetToUseAsParent(),
dialogTitle,
defaultDir,
m_pathFilter,
m_fileNameFilter,
fileTypes );
// Remember filters
m_pathFilter = result.pathFilter;
@@ -37,6 +37,7 @@
#include "RimTimeStepFilter.h"
#include "Riu3dSelectionManager.h"
#include "RiuMainWindow.h"
#include "cafPdmObject.h"
#include "cafSelectionManager.h"
@@ -94,7 +95,7 @@ void RicReplaceCaseFeature::onActionTriggered( bool isChecked )
auto summaryFileNames = helper.findSummaryFileCandidates();
if ( summaryCase && !summaryFileNames.empty() )
{
QMessageBox msgBox;
QMessageBox msgBox( RiuMainWindow::instance() );
msgBox.setIcon( QMessageBox::Question );
QString questionText;
@@ -36,6 +36,7 @@
#include <QTime>
#include <QToolBar>
#include <QVBoxLayout>
#include <QVariant>
//--------------------------------------------------------------------------------------------------
///
@@ -31,6 +31,7 @@
#include "Riu3DMainWindowTools.h"
#include "RiuFileDialogTools.h"
#include "RiuMainWindow.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafSelectionManagerTools.h"
@@ -106,7 +107,7 @@ QString RicImportSeismicFeature::convertSEGYtoVDS( QString filename )
QString outputFilename = fi.path() + "/" + fi.completeBaseName() + ".vds";
segyoptions.setOutputFilename( outputFilename );
caf::PdmUiPropertyViewDialog propDlg( nullptr,
caf::PdmUiPropertyViewDialog propDlg( RiuMainWindow::instance(),
&segyoptions,
"Convert SEG-Y to VDS file format",
"",
@@ -127,14 +128,15 @@ QString RicImportSeismicFeature::convertSEGYtoVDS( QString filename )
if ( QFile::exists( outputFilename ) )
{
QString question = QString( "File \"%1\" already exists. \n\nDo you want to overwrite it?" ).arg( outputFilename );
auto reply = QMessageBox::question( nullptr, "Replace existing file?", question, QMessageBox::Yes, QMessageBox::No );
auto reply =
QMessageBox::question( RiuMainWindow::instance(), "Replace existing file?", question, QMessageBox::Yes, QMessageBox::No );
if ( reply != QMessageBox::Yes ) continue;
}
if ( !segyoptions.headerFormatFilename().isEmpty() && !QFile::exists( segyoptions.headerFormatFilename() ) )
{
QString warning = QString( "Header Format Definition File \"%1\" could not be found." ).arg( segyoptions.headerFormatFilename() );
QMessageBox::warning( nullptr, "File Not Found.", warning );
QMessageBox::warning( RiuMainWindow::instance(), "File Not Found.", warning );
continue;
}
@@ -142,7 +144,7 @@ QString RicImportSeismicFeature::convertSEGYtoVDS( QString filename )
if ( overrideSampleStart && ( sampleStartOffset < 0.0 ) )
{
QString warning = "Depth (Z) Offset Override must be 0 or larger.";
QMessageBox::warning( nullptr, "Invalid input.", warning );
QMessageBox::warning( RiuMainWindow::instance(), "Invalid input.", warning );
continue;
}
@@ -176,7 +178,7 @@ bool RicImportSeismicFeature::runSEGYConversion( RimSEGYConvertOptions* options
if ( !QFile::exists( command ) )
{
QString warning = QString( "The SEG-Y import utility \"%1\" could not be found!" ).arg( command );
QMessageBox::critical( nullptr, "Missing Converter.", warning );
QMessageBox::critical( RiuMainWindow::instance(), "Missing Converter.", warning );
return false;
}
@@ -188,7 +190,7 @@ bool RicImportSeismicFeature::runSEGYConversion( RimSEGYConvertOptions* options
if ( !process.execute( showStdOut, showStdErr ) )
{
QMessageBox::critical( nullptr,
QMessageBox::critical( RiuMainWindow::instance(),
"SEG-Y conversion failed.",
"Failed to convert the input SEG-Y file. Check log window for additional information." );
return false;
@@ -26,6 +26,7 @@
#include "RimSeismicDataCollection.h"
#include "Riu3DMainWindowTools.h"
#include "RiuMainWindow.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafSelectionManagerTools.h"
@@ -58,7 +59,7 @@ void RicNewSeismicDifferenceFeature::onActionTriggered( bool isChecked )
if ( seismicInput.size() != 2 )
{
QString warning = "The selected seismic data grids do not match. Cannot create seismic difference data.";
QMessageBox::warning( nullptr, "Invalid input.", warning );
QMessageBox::warning( RiuMainWindow::instance(), "Invalid input.", warning );
return;
}
@@ -18,7 +18,7 @@
#include "RicAsciiExportSummaryPlotFeature.h"
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferencesSummary.h"
@@ -55,7 +55,7 @@ void RicAsciiExportSummaryPlotFeature::onActionTriggered( bool isChecked )
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
// Ask user about resampling
auto result = RicResampleDialog::openDialog();
auto result = RicResampleDialog::openDialog( RiaGuiApplication::widgetToUseAsParent() );
if ( !result.ok ) return;
if ( selectedSummaryPlots.size() == 1 )
@@ -24,6 +24,7 @@
#include "RimProject.h"
#include "RimSummaryCaseMainCollection.h"
#include "RiuPlotMainWindow.h"
#include "RiuPlotMainWindowTools.h"
#include "cafSelectionManagerTools.h"
@@ -40,7 +41,7 @@ CAF_CMD_SOURCE_INIT( RicNewDerivedEnsembleFeature, "RicNewDerivedEnsembleFeature
//--------------------------------------------------------------------------------------------------
void RicNewDerivedEnsembleFeature::showWarningDialog()
{
QMessageBox::warning( nullptr, "Ensemble Matching", "None of the cases in the ensembles match" );
QMessageBox::warning( RiuPlotMainWindow::instance(), "Ensemble Matching", "None of the cases in the ensembles match" );
}
//--------------------------------------------------------------------------------------------------
@@ -48,7 +49,7 @@ void RicNewDerivedEnsembleFeature::showWarningDialog()
//--------------------------------------------------------------------------------------------------
bool RicNewDerivedEnsembleFeature::showWarningDialogWithQuestion()
{
QMessageBox msgBox;
QMessageBox msgBox( RiuPlotMainWindow::instance() );
msgBox.setIcon( QMessageBox::Question );
msgBox.setWindowTitle( "Ensemble Matching" );
msgBox.setText( "None of the cases in the ensembles match" );
@@ -28,6 +28,8 @@
#include "RimFileSummaryCase.h"
#include "RimReloadCaseTools.h"
#include "RiuPlotMainWindow.h"
#include "cafPdmObject.h"
#include "cafSelectionManager.h"
@@ -73,7 +75,7 @@ void RicReplaceSummaryCaseFeature::onActionTriggered( bool isChecked )
auto newGridFileName = helper.findRelatedGridFile();
if ( gridModel && !newGridFileName.isEmpty() )
{
QMessageBox msgBox;
QMessageBox msgBox( RiuPlotMainWindow::instance() );
msgBox.setIcon( QMessageBox::Question );
QString questionText;
@@ -36,7 +36,7 @@ void RicDeleteSumoTokenFeature::deleteUserToken()
const auto filename = RiaSumoDefines::tokenPath();
if ( !QFile::exists( filename ) ) return;
auto parent = RiaGuiApplication::activeWindow();
auto parent = RiaGuiApplication::widgetToUseAsParent();
QString question = "Do you want to delete your SUMO token file?";
auto reply = QMessageBox::question( parent, "Delete token?", question, QMessageBox::Yes, QMessageBox::No );
@@ -18,6 +18,8 @@
#include "RicShowWellPlanFeature.h"
#include "RiaGuiApplication.h"
#include "ApplicationCommands/RicShowPlotDataFeature.h"
#include "RimModeledWellPath.h"
@@ -56,7 +58,7 @@ void RicShowWellPlanFeature::onActionTriggered( bool isChecked )
{
QString title = "Well Plan for " + wellPath->name();
RiuTextDialog* textDialog = new RiuTextDialog();
RiuTextDialog* textDialog = new RiuTextDialog( RiaGuiApplication::widgetToUseAsParent() );
textDialog->setMinimumSize( 800, 600 );
textDialog->setWindowTitle( title );
textDialog->setText( wellPath->wellPlanText() );
@@ -18,8 +18,8 @@
#include "RifSummaryCaseRestartSelector.h"
#include "RiaApplication.h"
#include "RiaFilePathTools.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferencesSummary.h"
@@ -186,7 +186,7 @@ void RifSummaryCaseRestartSelector::determineFilesToImportByAskingUser( const st
defaultGridImportMode,
m_ensembleOrGroupMode,
&lastResult,
nullptr );
RiaGuiApplication::widgetToUseAsParent() );
if ( result.status == RicSummaryCaseRestartDialogResult::SUMMARY_CANCELLED )
{
@@ -19,6 +19,7 @@
#include "RimAnalysisPlot.h"
#include "RiaDefines.h"
#include "RiaGuiApplication.h"
#include "RiaPlotDefines.h"
#include "RiaPreferences.h"
#include "RiaQDateTimeTools.h"
@@ -444,7 +445,7 @@ std::vector<time_t> RimAnalysisPlot::selectedTimeSteps() const
//--------------------------------------------------------------------------------------------------
void RimAnalysisPlot::showSelectVariablesDialog()
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
dlg.enableMultiSelect( true );
dlg.enableIndividualEnsembleCaseSelection( true );
@@ -18,6 +18,7 @@
#include "RimAbstractCorrelationPlot.h"
#include "RiaGuiApplication.h"
#include "RiaPreferences.h"
#include "RiaQDateTimeTools.h"
#include "Summary/RiaSummaryCurveDefinition.h"
@@ -140,7 +141,7 @@ void RimAbstractCorrelationPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
RimPlot::fieldChangedByUi( changedField, oldValue, newValue );
if ( changedField == &m_pushButtonSelectSummaryAddress )
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
if ( m_selectMultipleVectors )
{
@@ -19,6 +19,7 @@
#include "RimGenericJob.h"
#include "RiaColorTools.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RimJobMonitor.h"
@@ -170,7 +171,9 @@ bool RimGenericJob::execute()
m_lastRunFailed = true;
m_isRunning = false;
setDeletable( true );
QMessageBox::critical( nullptr, name(), "Failed to start job. Check log window for additional information." );
QMessageBox::critical( RiaGuiApplication::widgetToUseAsParent(),
name(),
"Failed to start job. Check log window for additional information." );
}
return startOk;
@@ -18,6 +18,7 @@
#include "RimOpmFlowJob.h"
#include "RiaGuiApplication.h"
#include "RiaImportEclipseCaseTools.h"
#include "RiaLogging.h"
#include "RiaPreferencesOpm.h"
@@ -887,7 +888,9 @@ bool RimOpmFlowJob::onRun()
infoText += " \"" + workingDirectory() + "\"\n";
infoText += "\nClick OK to run the Opm Flow simulation.";
auto reply = QMessageBox::information( nullptr, "Opm Flow simulation", infoText, QMessageBox::Ok | QMessageBox::Cancel );
auto parent = RiaGuiApplication::widgetToUseAsParent();
auto reply = QMessageBox::information( parent, "Opm Flow simulation", infoText, QMessageBox::Ok | QMessageBox::Cancel );
if ( reply != QMessageBox::Ok ) return false;
}
@@ -1182,7 +1185,10 @@ void RimOpmFlowJob::selectOpenWellPosition()
kwVec.push_back( std::make_pair( i++, QString::fromStdString( kw ) ) );
}
m_openWellDeckPosition = RimDeckPositionDlg::askForPosition( nullptr, kwVec, "--- Open New Well HERE ---", m_openWellDeckPosition );
m_openWellDeckPosition = RimDeckPositionDlg::askForPosition( RiaGuiApplication::widgetToUseAsParent(),
kwVec,
"--- Open New Well HERE ---",
m_openWellDeckPosition );
}
//--------------------------------------------------------------------------------------------------
@@ -1190,8 +1196,10 @@ void RimOpmFlowJob::selectOpenWellPosition()
//--------------------------------------------------------------------------------------------------
void RimOpmFlowJob::resetEnsembleRunId()
{
if ( QMessageBox::information( nullptr, "Opm Flow Job", "Do you want to reset the ensemble run ID to 0?", QMessageBox::Yes | QMessageBox::No ) ==
QMessageBox::Yes )
if ( QMessageBox::information( RiaGuiApplication::widgetToUseAsParent(),
"Opm Flow Job",
"Do you want to reset the ensemble run ID to 0?",
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes )
{
m_currentRunId = 0;
}
@@ -20,6 +20,7 @@
#include "Rim3dOverlayInfoConfig.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaQDateTimeTools.h"
@@ -241,7 +242,7 @@ RicGridStatisticsDialog* Rim3dOverlayInfoConfig::getOrCreateGridStatisticsDialog
{
if ( !m_gridStatisticsDialog )
{
m_gridStatisticsDialog = std::make_unique<RicGridStatisticsDialog>( nullptr );
m_gridStatisticsDialog = std::make_unique<RicGridStatisticsDialog>( RiaGuiApplication::widgetToUseAsParent() );
}
CVF_ASSERT( m_gridStatisticsDialog );
return m_gridStatisticsDialog.get();
@@ -18,6 +18,7 @@
#include "RimCustomObjectiveFunctionWeight.h"
#include "RiaGuiApplication.h"
#include "RiaStdStringTools.h"
#include "Summary/RiaSummaryCurveDefinition.h"
@@ -144,7 +145,7 @@ void RimCustomObjectiveFunctionWeight::fieldChangedByUi( const caf::PdmFieldHand
}
else if ( changedField == &m_objectiveValuesSelectSummaryAddressPushButton )
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
RimObjectiveFunctionTools::configureDialogForObjectiveFunctions( &dlg );
RimSummaryEnsemble* candidateEnsemble = parentCurveSet()->summaryEnsemble();
@@ -18,7 +18,7 @@
#include "RimSummaryCalculationVariable.h"
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "Summary/RiaSummaryCurveDefinition.h"
#include "Summary/RiaSummaryTools.h"
@@ -65,7 +65,7 @@ void RimSummaryCalculationVariable::fieldChangedByUi( const caf::PdmFieldHandle*
bool updateContainingEditor = false;
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
dlg.hideEnsembles();
dlg.hideCalculationIncompatibleCategories();
@@ -19,6 +19,7 @@
#include "RimEnsembleCurveFilter.h"
#include "RiaCurveDataTools.h"
#include "RiaGuiApplication.h"
#include "RiaNumericalTools.h"
#include "RiaStdStringTools.h"
#include "Summary/RiaSummaryCurveDefinition.h"
@@ -419,7 +420,7 @@ void RimEnsembleCurveFilter::fieldChangedByUi( const caf::PdmFieldHandle* change
}
else if ( changedField == &m_objectiveValuesSelectSummaryAddressPushButton )
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
RimObjectiveFunctionTools::configureDialogForObjectiveFunctions( &dlg );
RimSummaryEnsemble* candidateEnsemble = parentCurveSet()->summaryEnsemble();
@@ -1058,7 +1058,7 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
}
else if ( changedField == &m_yPushButtonSelectSummaryAddress )
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
RimSummaryEnsemble* candidateEnsemble = m_yValuesSummaryEnsemble();
RifEclipseSummaryAddress candicateAddress = m_yValuesSummaryAddress->address();
@@ -1097,7 +1097,7 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
}
else if ( changedField == &m_objectiveValuesSelectSummaryAddressPushButton )
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
RimObjectiveFunctionTools::configureDialogForObjectiveFunctions( &dlg );
RimSummaryEnsemble* candidateEnsemble = m_yValuesSummaryEnsemble();
@@ -18,6 +18,7 @@
#include "RimSummaryAddressSelector.h"
#include "RiaGuiApplication.h"
#include "RiaResultNames.h"
#include "Summary/RiaSummaryCurveDefinition.h"
#include "Summary/RiaSummaryTools.h"
@@ -195,7 +196,7 @@ void RimSummaryAddressSelector::fieldChangedByUi( const caf::PdmFieldHandle* cha
{
if ( changedField == &m_pushButtonSelectSummaryAddress )
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
if ( isEnsemble() )
{
@@ -1178,7 +1178,7 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
}
else if ( changedField == &m_yPushButtonSelectSummaryAddress )
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
RimSummaryCase* candidateCase = m_yValuesSummaryCase();
RifEclipseSummaryAddress candicateAddress = m_yValuesSummaryAddress->address();
@@ -1212,7 +1212,7 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
}
else if ( changedField == &m_xPushButtonSelectSummaryAddress )
{
RiuSummaryVectorSelectionDialog dlg( nullptr );
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
RimSummaryCase* candidateCase = m_xValuesSummaryCase();
RifEclipseSummaryAddress candicateAddress = m_xValuesSummaryAddress->address();
@@ -381,8 +381,11 @@ void RimSummaryCurvesData::appendToExportData( QString& out, const std::vector<R
{
QString questionStr = QString( "This operation will produce %1 text lines. Do you want to continue?" ).arg( allTimeSteps.size() );
auto reply =
QMessageBox::question( nullptr, "Summary Text Export", questionStr, QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
auto reply = QMessageBox::question( RiaGuiApplication::widgetToUseAsParent(),
"Summary Text Export",
questionStr,
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No );
if ( reply != QMessageBox::Yes ) return;
}
@@ -19,12 +19,15 @@
#include "RigLasFileExporter.h"
#include "RiaDefines.h"
#include "RiaGuiApplication.h"
#include "Well/RigWellLogCurveData.h"
#include "Well/RigWellPath.h"
#include "RimCase.h"
#include "RimWellLogCurve.h"
#include "RimWellLogExtractionCurve.h"
#include "RimWellPath.h"
#include "Well/RigWellLogCurveData.h"
#include "Well/RigWellPath.h"
#include "cafUtils.h"
@@ -379,7 +382,11 @@ std::vector<QString> RigLasFileExporter::writeToFolder( const QString& exportFol
if ( caf::Utils::fileExists( fullPathName ) && !alwaysOverwrite )
{
QString txt = QString( "File %1 exists.\n\nDo you want to overwrite the file?" ).arg( fullPathName );
int ret = QMessageBox::question( nullptr, "LAS File Export", txt, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes );
int ret = QMessageBox::question( RiaGuiApplication::widgetToUseAsParent(),
"LAS File Export",
txt,
QMessageBox::Yes | QMessageBox::No,
QMessageBox::Yes );
if ( ret != QMessageBox::Yes ) continue;
}
@@ -256,16 +256,33 @@ QString createMemoryLabelText()
static QProgressDialog* progressDialog()
{
static QPointer<QProgressDialog> progDialog;
if ( progDialog.isNull() && dynamic_cast<QApplication*>( QCoreApplication::instance() ) )
auto app = dynamic_cast<QApplication*>( QCoreApplication::instance() );
QWidget* parent = app != nullptr ? app->activeWindow() : nullptr;
// Check if the current prog dialog (if any) has a proper parent.
// If not, re-create it, to make sure it is positioned in the correct main window
if ( !progDialog.isNull() && ( progDialog->parent() != parent ) && ( parent != nullptr ) )
{
progDialog =
new QProgressDialog( nullptr, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowStaysOnTopHint );
// Thread check, we can only modify the progDialog if we are in the same thread as it belongs
if ( QThread::currentThread() == progDialog->thread() )
{
progDialog->deleteLater();
progDialog = nullptr;
}
}
if ( progDialog.isNull() )
{
progDialog = new QProgressDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint );
progDialog->hide();
progDialog->setAutoClose( false );
progDialog->setAutoReset( false );
progDialog->setMinimumWidth( 400 );
}
return progDialog;
}