title: PyQt: tab order not working for a simple custom widget
body: <p>I have made a custom widget consisting of a spinbox and a checkbox. The widget delegates focus to the spinbox by using setFocusProxy. The checkbox should not get focus.</p>
  
  <p>My problem is that when I use this widget in a layout, the Qt tab order does not work as expected. Below is a minimal working example. In the example, the focus should move from Var 1->Var 3->Var 2->Var 4 when pressing the tab key, but it doesn't.</p>
  
  <p>If I replace the CheckSpinBoxes by regular Qt widgets (e.g. QCheckBoxes), it works as expected. Also using the checkbox as a focus proxy seems to make the tab order work properly. Thus the problem seems to be with using the spinbox as a focus proxy. </p>
  
  <pre><code>from PyQt4 import QtGui, uic, QtCore
  import sys
  
  class CheckSpinBox(QtGui.QWidget):
  
      def __init__(self, parent=None, label=None):
          super(self.__class__, self).__init__(parent)
          self.degSpinBox = QtGui.QSpinBox()
          self.normalCheckBox = QtGui.QCheckBox(label)
          layout = QtGui.QHBoxLayout(self)
          layout.addWidget(self.degSpinBox)
          layout.addWidget(self.normalCheckBox)
          self.degSpinBox.setFocusPolicy(QtCore.Qt.StrongFocus)
          self.normalCheckBox.setFocusPolicy(QtCore.Qt.NoFocus)
          self.setFocusPolicy(QtCore.Qt.StrongFocus)
          self.setFocusProxy(self.degSpinBox)
  
  class EntryApp(QtGui.QWidget):
  
      def __init__(self):
          super(self.__class__, self).__init__()
          layout = QtGui.QGridLayout()
          self.sp1 = CheckSpinBox(label='Var 1')
          self.sp2 = CheckSpinBox(label='Var 2')
          self.sp3 = CheckSpinBox(label='Var 3')
          self.sp4 = CheckSpinBox(label='Var 4')        
  
          layout.addWidget(self.sp1,1,1)
          layout.addWidget(self.sp2,1,2)
          layout.addWidget(self.sp3,2,1)
          layout.addWidget(self.sp4,2,2)
  
          self.setLayout(layout)
  
          self.setTabOrder(self.sp1, self.sp3)
          self.setTabOrder(self.sp3, self.sp2)
          self.setTabOrder(self.sp2, self.sp4)
  
  def main():
      app = QtGui.QApplication(sys.argv)
      eapp = EntryApp()
  
      eapp.show()
      app.exec_()
  
  if __name__ == '__main__':
      main()
  </code></pre>