PDA

View Full Version : QTreeWidget::setCurrentItem ( QTreeWidgetItem * item )



gboelter
14th June 2011, 11:09
Hello!

I have tried in a simple QTreeWidget, created with Qt-Designer, with


treeWidget->setCurrentItem( previous );

to jump to a specific Entry called 'Banken' in this case. It works, but after doing that all items between the old one and the new one are marked like selected.

http://qtforum.de/forum/files/treewidget_995.png


But they are not, because

QList<QTreeWidgetItem *> QTreeWidget::selectedItems () const
returns a QList where size = 1.


I have tried it with QT-4.7.3 (Linux/OpenSource). I can't try an older version because I am using some new functions from Qt-4.7.

Any ideas what's going wrong here?

Thanks in advance.

Guenther

caduel
14th June 2011, 22:21
Sorry, you will need to provide more details for us to be able to help you.

i) have you set any properties?
ii) which (of the QTreeView's) signals have you connected to?
iii) please show the complete code (at least the lines interacting with the treeview)
iv) ideally: something that compiles