I have implemented a tree subcalassing QTreeWidget and subclassed QItemDelegate to paint the items. The items are a set of custom widgets. So far so good. The problem arise when I try to show only the children of a chosen node by doing the following:

Qt Code:
  1. connect(TreeWidget, SIGNAL(expanded(QModelIndex)), SLOT(setRootIndex(QModelIndex)));
To copy to clipboard, switch view to plain text mode 

Then I get: "This application has requested the Runtime to terminate it in an unusual way. (...)"

Any suggestions on what causes my application to crash?