Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, July 2007
Deactivating common shortcuts


Message 1 in thread

Hello,

How can I deactivate common shortcuts such as Ctrl + A (which selects all
editable text on the focused widget) and Ctrl + V (which pastes stuff)?

The shortcuts described work on Windows and have their equivalents on other
OS.

I'm trying to make a customized QLineEdit that detects key press events and
sets it's contents according to which keys are currently pressed but
whenever I hold Ctrl and then press the A key it isn't detected and the
whole QLineEdit text is selected instead.

What I want would be something like disabling the widget, but in a way that
the widget continues to receive and send key events.

Thanks in advance.

-- 
 [ signature omitted ] 

Message 2 in thread

Hi,

> I'm trying to make a customized QLineEdit that detects key press events 
> and sets it's contents according to which keys are currently pressed but 
> whenever I hold Ctrl and then press the A key it isn't detected and the 
> whole QLineEdit text is selected instead.

Your code needs to intercept the Ctrl+A event before the QLineEdit code. Have 
a look at this piece of documentation:
	http://doc.trolltech.com/4.3/qcoreapplication.html#notify
The event filter should help in this case.

--
 [ signature omitted ]