Fix Qt warnings about the item already being removed