When a textEdited()
signal is emitted, it can be either because the user has typed/pasted/deleted/replaced some text, or it can be an Undo operation (user has pressed Ctrl+Z, or clicked Undo from the context menu).
I need to distinguish between those somehow. Is there a way to be notified when an Undo operation is performed - subscribe to signal, catch an event perhaps? I couldn't find anything in the QLineEdit documentation myself, but I might have missed it.
Or is there a way to simply check if an Undo has been performed - perhaps a flag, or is there a way to check what the size of the Undo stack is? That way I could compare it its previous size, and if it has decreased, then I would know it's an Undo.
If you want to know why I need this, I'm trying to implement Editable multi-color QLineEdit, and I need this in order to restore the previous colors in the event of an Undo operation.