PDA

View Full Version : QTextEdit - Re-implement key events



QT8seven
19th December 2011, 04:57
I am attempting to re-implement some or all of the key-events attached to QTextEdit. I want to have some menu actions with keyboard shortcuts which are being over-taken by the QTextEdit. I can't figure out where to start to get this working at all.

Added after 1 33 minutes:

Just realized I left something out!

I am attempting to NOT subclass QTextEdit. This is a member of my subclassed QWidget. I am instead hoping to over-take the QTextEdit events with the QWidget.

Lykurg
19th December 2011, 07:17
then install an event filter. The documentation has an example about how to use event filters.

QT8seven
20th December 2011, 02:45
So, I've got the event-filter working, however, I am now wondering how do I pass the event to the menuBar? Do I need to manually check the keys pressed and redirect them or is it possible to have it simply ignore the captured keys and use them toward the setShortcuts?