PDA

View Full Version : How to delete a node in treeview?



jasonjoy
10th November 2009, 06:34
I want to delete a node in the treeview, how can i do it ?

yogeshgokul
10th November 2009, 06:39
I want to delete a node in the treeview, how can i do it ?
Delete it from associated model and it will be deleted from view also.;)

jasonjoy
10th November 2009, 06:55
but how can i delete it from associated model? Is there any ready-to-use function?

yogeshgokul
10th November 2009, 07:07
but how can i delete it from associated model? Is there any ready-to-use function?
Yes !!
For example you are using QDirModel, so you can use:

bool QDirModel::remove ( const QModelIndex & index )