PDA

View Full Version : what is currentItem?



Alina
14th February 2006, 03:34
hi
In treeWidget ,what is the currenItem ? is it a clicked treewidgetitem?:( [

zlatko
14th February 2006, 09:41
I think its item that have input focus(so last selected item):)

Chicken Blood Machine
15th February 2006, 07:35
hi
In treeWidget ,what is the currenItem ? is it a clicked treewidgetitem?:( [

The current item is the one that has keyboard focus. When your Tree widget, list widget, etc has a 'single' selection model, the current item is always the selected item. Here's the catch however - the current item is only valid for as long as the widget has focus. If you tab, click or otherwise move focus to another widget, the current item is now invalid and should not be used. The selection however, remains valid.

I tend to avoid using the current item in 90% of cases and stick with the 'selected' item(s).