title: Checking whether qprocess has finished
body: <p>I have to check whether my process has finished and I need to convert it to bool because I want to you if.<br>
  In MainWindow.h I have created an object<br></p>
  
  <pre><code>QProcess *action;
  </code></pre>
  
  <p>In mainwindow.cpp</p>
  
  <pre><code>void MainWindow:: shutdown()
  {
  action=new QProcess(this);
  action-&gt;start("shutdown -s -t 600");
  //and now I want to use if
  if (action has finished)
  {
    QMessageBox msgBox;
    msgBox.setText("Your computer will shutdown in 1 minute.");
    msgBox.exec();
  }
  </code></pre>