Hi,

I'm trying to get Matplotlib up and running on PySide with some quick
hacks on the PyQt backend and I'm having some trouble with the sliders.

This code:
        QtCore.QObject.connect( self.sliderleft,
                                QtCore.SIGNAL( "valueChanged(int)" ),
                                self.sliderright.setMinimum )

produces the following error:
Error calling slot "setMinimum"
TypeError: setMinimum() takes exactly one argument (0 given)


The following test program also creates the error when moving the first
slider:
import sys
from PySide import QtGui,QtCore

def test(*args):
    print len(args),args

app = QtGui.QApplication(sys.argv)

slider = QtGui.QSlider(QtCore.Qt.Horizontal)
slider2 = QtGui.QSlider(QtCore.Qt.Horizontal)

slider.valueChanged[int].connect(test)
slider.valueChanged[int].connect(slider2.setMaximum)

slider.show()
slider2.show()
app.exec_()
sys.exit()

Am I doing something wrong here or is this working as intended?  I know
that setMaximum and setMinimum aren't, strictly speaking, 'slots', but
it works in PyQt and you can use any old Python function for a slot most
of the time.  I've only been playing with PySide for a couple of weeks
so its quite possible I'm missing something obvious.

I know I could implement a function to use as the slot that does the
same thing as setMaximum/setMinimum but I'd like to keep any changes to
the PyQt code to a minimum.

Thanks for any help,
Gerald.


_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to