PDA

View Full Version : QTextEdit and "Enter" press



krivenok
28th March 2006, 11:42
Hello all!

I want to use QTextEdit in my chat dialog and send messages via "Enter" press.
How to change QTextEdit's behaviour (on Enter press) without reimplementing keyPressEvent???

I can't use class derived of QTextEdit, because it should be used in QT Desinger (i.e. only standart widgets are allowed).

Thanks!

zlatko
28th March 2006, 11:50
I dont understand you...You want create plugin for designer alike custom widget?
Use eventFilter :eek:

jpn
28th March 2006, 12:10
You can use an event filter (http://doc.trolltech.com/4.1/eventsandfilters.html) to catch events without subclassing...