I am trying to insertText before and after the selected word in QPlainTextEdit PyQt5 For example: when I write "My name is AbdulWahab" and select AbdulWahab then if I press left Parenthesis then AbdulWahab should turn into (AbdulWahab)
Thank you
I am trying to insertText before and after the selected word in QPlainTextEdit PyQt5 For example: when I write "My name is AbdulWahab" and select AbdulWahab then if I press left Parenthesis then AbdulWahab should turn into (AbdulWahab)
Thank you
Copyright © 2021 Jogjafile Inc.
You can achieve Your desired functionality using multiple different approaches.
Especially part with catching keyPressEvent.
I personally prefer re-implementing QPlainTextEdit.
You can find comments in the code, I hope it's clear what's going on there.
Here is sample code You can use: