title: How to set value of a widget without triggering valueChanged callback in PySide?
body: <p>I want to update a widget's value but in order to prevent infinite loops, I need to prevent calling the callback function of this widget's <code>.valueChanged</code> signal. </p>
  
  <p>Following example works entirely as expected: </p>
  
  <pre><code>Qt = PySide
  
  class MainWindow(Actor, Qt.QtGui.QMainWindow):
      def __init__(self):
          Qt.QtGui.QMainWindow.__init__(self)
          Actor.__init__(self)
          self.ui = Qt.loadUI('simulator.ui')
          self.ui.horizontalSlider.valueChanged.connect(self.emit_weight_msg)
  
      def emit_weight_msg(self, value):
          self.send({'WeightMessage': {'val': value}})
  
      def handle_WeightMessage(self, msg):
          self.ui.horizontalSlider.valueChanged.disconnect(self.emit_weight_msg)
          self.ui.horizontalSlider.setValue(msg["val"])
          self.ui.horizontalSlider.valueChanged.connect(self.emit_weight_msg)
  </code></pre>
  
  <p>Since disconnecting and connecting back the <code>valueChanged</code> signals seems a bit like hack, I want to ask if there is a more elegant solution exists. </p>
  
  <p>Full code is here: <a href="https://github.com/ceremcem/weighing-machine-testing" rel="noreferrer">https://github.com/ceremcem/weighing-machine-testing</a></p>
  
  <h1>Edit</h1>
  
  <p>I'm looking for a method, like: </p>
  
  <pre><code>def setValueSilent(QtObject, value):
      tmp_callback = QtObject.get_callback_functions_that_are_set_in_python_code()
      QtObject.valueChanged.disconnect(tmp_callback)
      QtObject.setValue(value)
      QtObject.valueChanged.connect(tmp_callback)
  </code></pre>