Get rid of empty line in QTreeWidget

I have created a QTreeWidget and filled it.

When i delete an item from the tree,an empty line moves down to the end of the tree.
When i then add to the tree, the item adds below the empty line.

How do i get rid of this empty line.
Topic archived. No new replies allowed.