title: PyQt SpinBox always returning 0, unless previously set with setValue
body: <p>I have a PyQt GUI using Python 2.7 and QT 4.7 that opens a dialog called by a pushbutton. I can pass values between the dialog and the main GUI just fine for the most part, until it comes to a QSpinBox in the dialog box.</p>
  
  <p>The class that defines the dialog is like so:</p>
  
  <pre><code>class BuyDialog(QDialog):
  def __init__(self):
      QDialog.__init__(self)
      global ci, space, cash, current, price, qtyToBuy
      self.ui = Ui_buyDialog()                                            # Set up the user interface from Designer.
      self.ui.setupUi(self)
      for i in range(0, len(ci)):
          item = str(ci[i][0])
          price = str(ci[i][1])
          self.ui.itemsComboBox.addItem(item)
      price = str(self.getPrice())
      gPrice = "$" + price
      print gPrice
      self.ui.priceFieldLabel.setText(gPrice)
      self.ui.itemsComboBox.currentIndexChanged['QString'].connect(self.updateItems)
      self.ui.availableSpaceFieldLabel.setText(space)
      canBuy = str(funcs.youCanAfford(cash, price))
      self.ui.canAffordFieldLabel.setText(canBuy)
      qtyToBuy = self.ui.buySpinBox.value()
  </code></pre>
  
  <p>The code that handles the dialog itself is</p>
  
  <pre><code>def buyDialog(self):
      global current, price, qtyToBuy
      dialog = BuyDialog()
      result = dialog.exec_()
  
      if result:
          dialogResult = (current, price, qtyToBuy)
          print dialogResult #debug
          return dialogResult
  </code></pre>
  
  <p><code>current</code> comes from a combo box in the dialog, and <code>price</code> comes from a list lookup against <code>current</code>. I know the dialog updates correctly, as the values returned for <code>current</code> and <code>price</code> are correct.  However, <code>qtyToBuy</code> always returns 0.  The only way I've gotten it to return anything different is by calling <code>setValue()</code> on it when it's initiated. Everywhere I've looked, I get the impression I'm the only person that's had this problem, as I can find nothing else regarding this issue.  Does anyone have any idea what the problem is?</p>