[PyQt] Issue with selected cells in a QTableView

Vicent Mas uvemas at gmail.com
Tue Mar 22 22:14:49 GMT 2011

On 2011-03-22 "Hans-Peter Jansen" <hpj at urpla.net> said:

> On Tuesday 22 March 2011, 20:50:18 Vicent Mas wrote:
> > 2011/3/22 simozack <simozackml at gmail.com>:
> > > 2011/3/22 Vicent Mas <uvemas at gmail.com>:
> > >> it is explained in my second mail of this thread.  Vincent Van de
> > >> Vyvre asked exactly the same. If it is not clear enough I can
> > >> explain it again. But let me insist, even if my script was purely
> > >> an academic exercise, without practical interest, *if it exposes a
> > >> PyQt4 bug* then the bug has to be reported. My problem is that I'm
> > >> not sure if it is a PyQt4 bug, a Qt4 bug or other thing. Neither I
> > >> see a workaround that I can apply to my real code. Although I
> > >> don't know C++ I've decided to port the script to that language
> > >> and see if the problem persists. In that case I'll report it to
> > >> Nokia. Writing C++ will be painful for me
> > >> 
> > >> :-(, so if someone has more ideas please, tell me.
> > > 
> > > Maybe my poor English does another victim... :)
> > 
> > Or maybe it is just me.
> > 
> > > I don't understand why, inside the updateView method, you
> > > disconnect and then reconnect the signal "selectionChanged". I
> > > think that that signal isn't emitted if the model changed, but only
> > > if the user changes the selection.
> > > 
> > > If you don't do that (disconnecting and reconnecting the signal,
> > > not launching the updateView) do you have a not so good performarce
> > > or what? :)
> > 
> > Let's see it one more time. One thing is the minimal script attached
> > to this thread and other thing is the real code. In the script
> > connecting/disconnecting the signal has the only mission of reproduce
> > the buggy behavior of the real code. The script would work just fine
> > without connecting/disconnecting, that's clear for everybody. The
> > real code is different because there the connect/disconnect trick is
> > meaningful. Please, note that I'm not saying that
> > connecting/disconnecting is the only solution to my problem. As I've
> > already said I'm looking for alternatives or workarounds.
> Vicent, have you tried signal blocking/unblocking? Connecting/
> disconnecting signals does a lot of churn behind the scenes..
> Pete


first of all, thanks to Pavel and Pete.

Pavel, I didn't realise I've disconnected everything from the signal not only 
the trackSelection slot. It fixes things in the script. I'll check if it do the 
same in the real code.

Pete, yes I was considering blocking/unblocking since a few minutes ago. I've 
never used it so I suppose that is why it has taken to me so long to consider 
this possibility.

Once again thanks to both of you (and to other contributors to this thread, of 



	Share what you know, learn what you don't

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110322/78c09c2a/attachment.pgp>

More information about the PyQt mailing list