[PyQt] Signal on Selection in QTreeView

Andreas Pakulat apaku at gmx.de
Mon Mar 17 22:18:39 GMT 2008

On 17.03.08 13:31:01, Kevin wrote:
> Andreas,
>   The problem is that my connect statement does not call the appropriate 
> function.
>   I've done some searching based on your recommendations, yet I have not 
> been able to find a basic example I can understand.
>    Could you point me to a simple example that would take a list with  
> columns and can return the row number of the row that is selected?  I  
> believe that I can adapt this into my app.

I'd have to dive through the examples myself to see if any of them does
what you seem to want. However that last sentence seems a bit strange to
me and I think you might misunderstand something.

The way these signals work is that whenever the user changes the
selection your slot gets called, with the selected and de-selected
indexes as arguments. As far as I understood your initial problem you'd
then simply ask the data model for the data of the now selected model
indexes and can then display that data in a different widget (the


You possess a mind not merely twisted, but actually sprained.

More information about the PyQt mailing list