From e2c991851031653ea53ab0600e1409f4f093663b Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 4 Oct 2017 09:11:44 -0700 Subject: [PATCH] docs cleanup --- pyqtgraph/widgets/ProgressDialog.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pyqtgraph/widgets/ProgressDialog.py b/pyqtgraph/widgets/ProgressDialog.py index 6bda4b95..ae1826bb 100644 --- a/pyqtgraph/widgets/ProgressDialog.py +++ b/pyqtgraph/widgets/ProgressDialog.py @@ -6,7 +6,10 @@ __all__ = ['ProgressDialog'] class ProgressDialog(QtGui.QProgressDialog): """ - Extends QProgressDialog for use in 'with' statements. + Extends QProgressDialog: + + * Adds context management so the dialog may be used in `with` statements + * Allows nesting multiple progress dialogs Example:: @@ -35,8 +38,7 @@ class ProgressDialog(QtGui.QProgressDialog): If ProgressDialog is entered from a non-gui thread, it will always be disabled. nested (bool) If True, then this progress bar will be displayed inside - any pre-existing progress dialogs that also allow nesting (if - any). + any pre-existing progress dialogs that also allow nesting. ============== ================================================================ """ # attributes used for nesting dialogs @@ -198,10 +200,6 @@ class ProgressDialog(QtGui.QProgressDialog): return QtGui.QProgressDialog.setValue(self, val) - if self._topDialog is not None: - tbar = self._topDialog._extractWidgets()[0].bar - tlab = self._topDialog._extractWidgets()[0].label - # Qt docs say this should happen automatically, but that doesn't seem # to be the case. if self.windowModality() == QtCore.Qt.WindowModal: @@ -239,6 +237,9 @@ class ProgressDialog(QtGui.QProgressDialog): class ProgressWidget(QtGui.QWidget): + """Container for a label + progress bar that also allows its child widgets + to be hidden without changing size. + """ def __init__(self, label, bar): QtGui.QWidget.__init__(self) self.hidden = False