Hi,

I'm struggling to get the following work:
Ive connected a CustomContextMenuRequest to a QWidgetTree and indeed the menu pops open. But, however, when I want to clear this QWidgetTree in this request I get a null pointer exception. When i run this piece of code in another place or slot it works just fine.

When there are multiple items present in the treewidget, i can delete them one for one, and everything works fine, but when I delete the last one the exception occurs again.

Qt Code:
  1. void N3LAB_Software::contextMenuTree(const QPoint& pos){
  2. this->objectList->clear(); % The QTreeWidget
  3. }
To copy to clipboard, switch view to plain text mode 

Does somebody know whats causing this problem or how to fix this?

Thanks,

Perry

Ps:
Im using Qt 5.6 with visual studio 2015