Here is an example with a few of the many ways this could be solved:
https://gist.github.com/justinfx/134992bd323c76d55af2c1b2750ebd84
In the MyListWidget example, it is implementing the edit() hook to capture when an item edit operation is starting, so that we can remember the current value before it changes.
Then when the itemChanged signal fires, we can handle the slot and compare the previous value to the current one and choose to call rename()
The MyListWidget2 example is almost the same, but instead of implementing edit(), it uses the doubleClicked signal to track the current text value before it changes. I think I like the previous approach better because it gives you more specific control over when the edit operation is actually starting. You can even check the specific edit trigger type if you wanted.
Justin