Decrease minimum QProgressDialog duration

We already have a threshold before we use a QProgressDialog at all, so let's
show it quite quickly and not after 4 seconds.
This commit is contained in:
Florian Bruhin 2018-09-06 17:24:59 +02:00
parent 935d93d10e
commit ab6c8dde9a
2 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,7 @@ class HistoryProgress:
def start(self, text, maximum):
self._progress = QProgressDialog()
self._progress.setMinimumDuration(500)
self._progress.setLabelText(text)
self._progress.setMaximum(maximum)
self._progress.setCancelButton(None)

View File

@ -494,6 +494,7 @@ class TestHistoryProgress:
assert dialog.minimum() == 0
assert dialog.maximum() == 42
assert dialog.value() == 1
assert dialog.minimumDuration() == 500
progress.finish()
assert not dialog.isVisible()