[PyQt] Signal on Selection in QTreeView

Kevin Foss fossks at cox.net
Mon Mar 17 23:31:54 GMT 2008


Andreas,

   Your understanding seems to correct.   I do not want to change the list 
entries at this point.  To confirm what you said, I do want to have the item 
details of a list entry displayed in a separate widget when the user selects 
the list entry.  Part of the explanation below was an idea to get the row 
number of the currently selected list item and then display that individual 
list item in the other widget.  

   Sorry if I'm a bit confusing in my description.  The way I understand how 
these capabilities work skew the way I explain them.

Kevin

On Monday 17 March 2008 03:18:39 pm Andreas Pakulat wrote:
> 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
> groupbox).
>
> Andreas




More information about the PyQt mailing list