Fix layout changed when the there are no parents

Also let the model be reset instead of saying all the items
changed if you call layoutChanged without a sort hint (as
it was before)

Change-Id: I8e6ca14519705ef5a2752f15bf83f6feff3d582e