Sfoglia il codice sorgente

BUG: avoid deadlock on mac on file import

On mac, bringing up the progress dialog on top of the
file dialog leads to a deadlock where the
dialogs go away but the underlying widget is not
responsive and the application requires a Force Quit.
Avoid this by making the progress dialog non-modal.
Unfortunately it remains behind the file dialog but this
is better than hanging.
Steve Pieper 13 anni fa
parent
commit
0d60ffbd03
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      Libs/DICOM/Widgets/ctkDICOMAppWidget.cpp

+ 6 - 1
Libs/DICOM/Widgets/ctkDICOMAppWidget.cpp

@@ -430,7 +430,12 @@ void ctkDICOMAppWidget::onImportDirectory(QString directory)
     // by creating our own
     QLabel* progressLabel = new QLabel(tr("Initialization..."));
     progress.setLabel(progressLabel);
+#ifdef Q_WS_MAC
+    // BUG: avoid deadlock of dialogs on mac
+    progress.setWindowModality(Qt::NonModal);
+#else
     progress.setWindowModality(Qt::ApplicationModal);
+#endif
     progress.setMinimumDuration(0);
     progress.setValue(0);
     progress.show();
@@ -444,8 +449,8 @@ void ctkDICOMAppWidget::onImportDirectory(QString directory)
             this, SLOT(onProgress(int)));
 
     d->DICOMIndexer->addDirectory(*d->DICOMDatabase,directory,targetDirectory);
-    d->DICOMModel.reset();
 
+    d->DICOMModel.reset();
   }
 }