Thank you! You made me think about this ones more and I found that didn't draw attention to the fact that in all that examples the following code happens a bit further:
Qt Code:
  1. hboxLayout->addWidget(listView);
  2. mainWgt.setLayout(hboxLayout);
To copy to clipboard, switch view to plain text mode 
So listView will be safely deleted when mainWgt will close.