progress dialog fix (#1861)
This commit is contained in:
parent
775f1d629c
commit
f764e2d3ff
@ -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()
|
||||
|
9
tests/widgets/test_progressdialog.py
Normal file
9
tests/widgets/test_progressdialog.py
Normal 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
|
Loading…
Reference in New Issue
Block a user