Strings link "\n" "\t" and etc. will be input in the QLineEdit. "\\n" will be got from QLineEdit.text(), but I want to revert it back to "\n".

One simple way is to use the replace function, QString.replace("\\n", "\n"), but it is only limited to some of the escape sequence.

Escape sequence as "\x1b" can not be simply processed by replace function.

Is there any way if I want to process all the escape sequence cases which are input from the QLineEdit?