[Qt-interest] qtreeview - hot do I get current item?
Andre Somers
andre at familiesomers.nl
Mon Feb 15 10:40:44 CET 2010
Iuri Fiedoruk wrote:
>
>
> Now what I want, is that when the user clicks or use keyboard to
> change the selected item in the tree, I get information about it.
> I tryied the click, like this:
>
> (...)
> But item is always empty.
> Can you please help me to find a way to just get the text/data from
> the current selected item in the tree when it is changed?
Check out the signals QAbstractItemView provides. Your tree view derives
from it, so it will also emit these signals. Connect to the signal that
suits your needs. If none of these do the trick, every view also has a
selection model, which you can get a pointer to. This selection model
also has some signals that may interest you.
André
More information about the Qt-interest-old
mailing list