title: How to cancel QProcess by clicking in QProgressDialog's cancel button?
body: <p>edit:</p>
  
  <p>please scroll down for the new question. Here is the original:</p>
  
  <p>I have the following code:</p>
  
  <pre><code>self.progress = QtGui.QProgressDialog("Running",  "Cancel", 0, 0)   
  self.progress.show()
  command = "./some_script.exe"
  args =  [ "some", "args"]
  process = QtCore.QProcess(self)
  process.start(command, args)
  self.progress.close()
  </code></pre>
  
  <p>When I run it, the progress dialog closes imediately after starting the QProcess. How do I keep it running until the QProcess finishes?</p>
  
  <p>Thank you so much</p>
  
  <p>edit:</p>
  
  <p>Solved it: I had to connect the finished signal to a function that closes the progress dialog: </p>
  
  <pre><code>QtCore.QObject.connect(self.process,QtCore.SIGNAL("finished(int)"),self.processCompleted)
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>def processCompleted(self):
      self.progress.close()
  </code></pre>
  
  <p>My new question is, how do I cancel the qprocess by clicking the cancel button in the progress dialog?</p>