Unsolved Disable overritten shortcuts in QTextEdit
-
QTextEdit has some overwritten shortcuts for example "Ctrl+V", which I want to disable, to create own action called by"Ctrl+V", which won't be covered by this overwrite one. Any idea???
-
Hi,
What action are you going to replace the past shortcut with ?
Depending on that, you should take into account that you are going against what people are used to and expect from that shortcut. Especially in a text related widget.
-
I want to use it still as paste, but with some "improvements", this overritten function doesn't work always.
-
Take a look at the documentation of QTextEdit::paste. It's likely the starting point you are looking for.
-
Thanks @SGaist, maybe it's way.
Do You know how to implement void insertfromMimeData(I understand that it's what i need), because i get errors about incomplete type const QMimeData. -
Incomplete type errors mean that you are missing the include of the corresponding class.
-
This function works but still dosn't allow me to overwrite shortcut "Ctrl+V" on my own.
-
@stan09
Hi
Can you explain a bit more why
canInsertFromMimeData() and insertFromMimeData()
is not enough for your custom paste feature ? -
I use function keyPressEvent, to uppercase first letter in each sentence , but this cause that if textEdit is empty, pasting by Ctrl+V doesn't work. If I type sth, even space, all works correctly. I created own function paste, and call out it always works(by action in menu), even on the beginning of document. This function has also shortcut Ctrl+V, but is hidden by function paste implemented in QTextEdit and I can't use it by Ctrl+V. Maybe the better way is solve a collision of keyPressEvent and using shortcuts?