PyQt QTable
Boudewijn Rempt
boud at valdyas.org
Thu Apr 18 10:58:44 EDT 2002
Michael Melchert wrote:
> Hello,
>
> I am having some difficulties using QTable (PyQt3.0-2.3.1)
> in a python QDialog:
> basically all I want to do is to connect the QTable.clicked() signal to
> a python method [
> self.connect(qtb,SIGNAL('clicked(....)'),self.the_method)] my problem
> arises from the parameters which are defined for
> QTable.clicked(int,int,int,QPoint&). what would be the correct way to
> write the connect() call, especially regarding the QPoint& reference? And
> how would the connected python method be defined?
>
Haven't tested this -- busy studying for a blasted Java exam -- but
you should be able to something like
QObject.connect(qtb, SIGNAL("clicked(int, int, int, const QPoint &"),
self.theMethod)
Note the 'const' -- that's needed.
You need to have either five parameters or a variable-number argument
list to theMethod:
def theMethod(self, row, col, button, point):
bla
or
def theMethod(self, *args):
bla
or even (but I like to have at least an explicite self):
def theMethod(*args):
bla
--
Boudewijn Rempt | http://www.valdyas.org
More information about the Python-list
mailing list