[Qt-interest] Need some help about QLineEdit

Zeljko zeljko at holobit.net
Sun Oct 16 13:05:26 CEST 2011


Andre Somers wrote:

> Op 16-10-2011 11:06, Zeljko schreef:
>> Hi,
>> As I can see there's no way to catch copy(),paste() and cut() ops with any
>> event/signal ?
>> I need to intercept those to know when user copied , pasted and
>> cutted data from QLineEdit and QTextEdit and eventually forbid operation.
>> I know that QValidator helps in case of paste() , but what about copy() and
>> cut() ?
>> Is there any solution (or even planned in 5.0) for such problem (of course
>> there's + selection copy under X11 ...) ?
>>
> You should try an event filter, and filter out the key events.

I can do that for user input events eg. pressed Ctrl +C , but what about context 
menu actions ? When user triggers copy() via context menu (default one) there's 
no events in event filter that shortcut triggered (Ctrl + C) or anything 
similar.

zeljko



More information about the Qt-interest-old mailing list