Shortcuts Qt
-
I want to disable all the possible shortcuts in QTextEdit except the Ctrl+V and Ctrl+C ones.
Someone can help me. I can't do this. -
Hi,
What other shortcuts are you referring to ?
What did you try ? -
I mean the Undo-Redo shortcuts for example.
I've tried to filter the event and ignore it. But it doesn't work -
The widget is equipped with an undo stack. Out of curiosity, why do you want to disable it ?
-
I need to disable them for a project in which I need to process only Ctrl+V, Ctrl+C,Ctrl+X.
Whenever I use a combination of Ctrl+another key, I want that nothing happens in my QTextEdit.
I've tried to install an eventFilter into my class, and I've used the following code:ui->textEdit->installEventFilter(this);
I've used the following code to ignore the event:
bool notepad::isAKeyToIgnore(QKeyEvent* event){ return event->modifiers() & Qt::ControlModifier; }
but however the events that I've inserted into the if statement are processed .
-
Did you also handle QShortCutEvent ?
-
what do you mean?
-
I mean the Undo-Redo shortcuts for example.
I've tried to filter the event and ignore it. But it doesn't work@Martinuccia_96 if it's only the undo/redo shortcuts, you can simply disable the redo stack
https://doc.qt.io/qt-5/qtextedit.html#undoRedoEnabled-prop
and they should no longer have a functionality -
@Martinuccia_96 if it's only the undo/redo shortcuts, you can simply disable the redo stack
https://doc.qt.io/qt-5/qtextedit.html#undoRedoEnabled-prop
and they should no longer have a functionality@J-Hilk said in Shortcuts Qt:
@Martinuccia_96 if it's only the undo/redo shortcuts, you can simply disable the redo stack
https://doc.qt.io/qt-5/qtextedit.html#undoRedoEnabled-prop
and they should no longer have a functionalityFunny, I was looking for that property the other day and did not find it 😅