title: QtSingleApplication QMessageBox yes action is taken even if no is selected
body: <p>I have an application in Qt that will override a shut down in case a user didn't save their document.  It looks like this:</p>
  
  <pre><code>class MyApplication : public QtSingleApplication
  {
      public:
      MyApplication(int argc, char *argv[]) : QtSingleApplication(argc, argv, true)
      {
      }
  
      ~MyApplication()
      {
      }
  
      void commitData(QSessionManager &amp;manager)
      {
          if(manager.allowsInteraction())
          {
              main-&gt;RequestShutdownOverride();
          }
      }
  
      void SetMainWindow(MainWindow *m)
      {
          main = m;
      }
  
      MainWindow *main;
  };
  
  void MainWindow::RequestShutdownOverride()
  {
      if(myDocument-&gt;hasChanges() == true)
      {
          switch
          (
            QMessageBox::warning
            (
               NULL, 
               "Foobar", 
               "You are exiting without saving.  Would you like to save?", 
               "Yes, save my document", "No, don't save my document", 
               0, 
               0, 
               1
            )
          )
          {
              case 0:
                 myDocument-&gt;save();
              break;
  
              case 1:
                 app-&gt;exit(0);
              break;
          }
      }
  }
  </code></pre>
  
  <p>The problem is for a couple of users they go to shut down, the shut down is overridden they click "no" and it saves the document anyway.  I've tried troubleshooting this code and I can't find anything obvious, and worse - if I create a profile of my own on their machine it works fine again.</p>
  
  <p>Is there anything code-wise that I've screwed up, or could there be something else causing it?  I've tried switching Qt versions.  The only other thing that these two users seem to have in common is that they both use windows vista, but others use vista and haven't reported this problem.  Any ideas?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm using this definition:</p>
  
  <pre><code>static int QMessageBox::warning
  (
     QWidget *parent, 
     const QString &amp;title, 
     const QString &amp;text, 
     const QString &amp;button0Text, 
     const QString &amp;button1Text = QString(), 
     const QString &amp;button2Text = QString(), 
     int defaultButtonNumber = 0, 
     int escapeButtonNumber = -1
  )
  </code></pre>