CDT
CDT

Reputation: 10661

Qt - How to catch keyboard event in line edit?

How can I catch a return press keyboard event in a line edit in Qt ?

Upvotes: 0

Views: 347

Answers (2)

Andrew
Andrew

Reputation: 24866

Connect to the returnPressed signal.

http://doc.qt.io/qt-4.8/qlineedit.html#returnPressed

Upvotes: 2

SpongeBobFan
SpongeBobFan

Reputation: 964

For all who want to catch another keyboard events - use eventFilter. (In case of return and QLineEdit Andrew's answer is better than mine).

Upvotes: 0

Related Questions