progress dialog fix (#1861)

This commit is contained in:
Martin Chase 2021-06-23 19:34:55 -07:00 committed by GitHub
parent 775f1d629c
commit f764e2d3ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -73,7 +73,7 @@ class ProgressDialog(QtGui.QProgressDialog):
else:
self.setMinimumDuration(wait)
self.setWindowModality(QtCore.Qt.WindowType.WindowModality.WindowModal)
self.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
self.setValue(self.minimum())
if noCancel:
self.setCancelButton(None)
@ -206,7 +206,7 @@ class ProgressDialog(QtGui.QProgressDialog):
# Qt docs say this should happen automatically, but that doesn't seem
# to be the case.
if self.windowModality() == QtCore.Qt.WindowType.WindowModality.WindowModal:
if self.windowModality() == QtCore.Qt.WindowModality.WindowModal:
now = ptime.time()
if self._lastProcessEvents is None or (now - self._lastProcessEvents) > 0.2:
QtGui.QApplication.processEvents()

View File

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from pyqtgraph import mkQApp, ProgressDialog
mkQApp()
def test_progress_dialog():
with ProgressDialog("test", 0, 1) as dlg:
dlg += 1