title: PyQt4: Reorder Ok and Cancel buttons in the QDialogButtonBox
body: <p>How can I override the standard order of buttons in the QDialogButtonBox class?</p>
  
  <p>It seems that PyQt <a href="https://stackoverflow.com/questions/15598313/order-of-push-buttons-on-different-platforms-qdialogbuttonbox">follows some kind of standard based on the platform it runs on</a>.</p>
  
  <p>At the moment Cancel is on the left and Ok on the right (I'm on CentOS 6): </p>
  
  <p><img src="https://i.stack.imgur.com/Se7B4.png" alt="enter image description here"></p>
  
  <p>but my users find it confusing and counter to what they're used to and have asked me to swap them:</p>
  
  <p><img src="https://i.stack.imgur.com/8sosD.png" alt="enter image description here"></p>
  
  <p>This is how I create the box:</p>
  
  <pre><code>    self.buttonBox = QtGui.QDialogButtonBox(self)
      self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
      self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.Cancel)
  </code></pre>