[PyQt] Issue with selected cells in a QTableView

Hans-Peter Jansen hpj at urpla.net
Tue Mar 22 21:59:57 GMT 2011

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..


More information about the PyQt mailing list