[PyQt] selectionChanged or currentChanged in QTreeView

Hans-Peter Jansen hpj at urpla.net
Wed Oct 6 23:02:20 BST 2010


On Wednesday 06 October 2010, 22:57:10 danny wrote:
> Howdy,
>
> I have a QTreeView and I want to tie a dock window properties editor to
> the currently selected node. This is a pretty standard paradigm that I
> can't find in any of the samples.

http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Widgets/qtpropertybrowser/

Unfortunately, there's no PyQt binding available, AFAICS. Nevertheless, many 
of the pull-ups in that code are due to the static nature of C++, and could 
surely be obviated with PyQt. Anyway, it might be worth wrapping it once 
and for all.

> There seem to be two methods: selectionChanged and
> currentChanged that I could override to send out a signal.

Are you sure, that the activated signal doesn't fit your needs?

> I can't quite 
> figure out the difference between the two methods. Can anyone please
> explain the difference?

Two different concepts: the former manages the concept of _different_ 
selection models (one, many, ...) while the latter manages the concept of a 
single _current_ item, hence you will want to use that one, if activated 
doesn't fit.

Pete


More information about the PyQt mailing list