Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle key press events with the QPlainTextEdit

Tags:

key

events

qt

I've been developing with QT for around a week now and am pleased to say that I'm picking it up really fast. I'm an intermediate C++ programmer but picking up some parts of QT is proving to be challenging. I need to process key press events from the QPlainTextEdit when the user presses enter and I presume that the solution will involve sub classing the widget. Can any of you smart guys give me a potential implementable solution?

like image 986
user682587 Avatar asked Mar 29 '11 17:03

user682587


1 Answers

To really understand Qt and event handling there are two key areas of the documentation you should read. The first is the overview on The Event System and the second is a very important bit which is a cleverly hidden link on that page for QCoreApplication::notify. They should really move that to the main page of the Event System documentation as it really makes things quite clear (to me at least).

like image 144
Arnold Spence Avatar answered Sep 18 '22 22:09

Arnold Spence