class_docstr: Extends QProgressDialog:
  
    * Adds context management so the dialog may be used in `with` statements
    * Allows nesting multiple progress dialogs
  
  Example::
  
      with ProgressDialog("Processing..", minVal, maxVal) as dlg:
          # do stuff
          dlg.setValue(i)   ## could also use dlg += 1
          if dlg.wasCanceled():
              raise Exception("Processing canceled by user")
code: def setValue(self, val):
      if self.disabled:
          return
      QtWidgets.QProgressDialog.setValue(self, val)
  
      # Qt docs say this should happen automatically, but that doesn't seem
      # to be the case.
      if self.windowModality() == QtCore.Qt.WindowModality.WindowModal:
          now = perf_counter()
          if (
              self._lastProcessEvents is None
              or (now - self._lastProcessEvents) > 0.2
          ):
              QtWidgets.QApplication.processEvents()
              self._lastProcessEvents = now
  
imports: from time import perf_counter
  from ..Qt import QtCore, QtGui, QtWidgets
label_desc: Use image node_id 10 for calling the ProgressDialog obj's underlying member method code with example usage: obj.setValue(val) without return types