[PyQt] Using a protected slot (columnResized)

Noam Raphael noamraph at gmail.com
Wed Dec 26 17:25:35 GMT 2007


2007/12/26, Andreas Pakulat <apaku at gmx.de>:
> On 26.12.07 18:54:25, Noam Raphael wrote:
> > 2007/12/26, Andreas Pakulat <apaku at gmx.de>:
> > > Sure there is: Listen for the sectionResized signal of the header view.
> > >
> > Thanks! However, it still doesn't work, for some reason. I added this
> > to my code:
> >
> > def columnResized(*args):
> >     print 'columnResized%s' % repr(args)
> > QtCore.QObject.connect(tableView.horizontalHeader(),
> > QtCore.SIGNAL("sectionResized(int,int,int)"), columnResized)
> >
> > The function is never called. Did I do something wrong?
>
> Yes, you used the wrong kind of arguments to the function defintion.
> You're getting self+3 integer arguments, not a list of things.
>
No, the function is ok - if the function is defined like that, it
means that it can get any number of arguments, and they will get into
a tuple named "args". Just to make sure, I changed it into a function
that gets exactly three arguments (I don't need self, since it's not a
method), and it continued to do nothing... :(


More information about the PyQt mailing list