Solved Check if CTRL is pressed (QLineEdit)
-
In my MainWindow, I have a QLineEdit. When the user presses Enter in this Widget, I process the text entered. This works great because I just have to connect to the returnPressed-Event of QLineEdit. But now I would like to additionally check if the user has pressed CTLR+ENTER. The question is, how can I do that? Do I have to derive from QLineEdit and overwrite the keyPressEvent? Or is there an easier way?
-
You can make use of
eventfilters
http://doc.qt.io/archives/qt-4.8/eventsandfilters.html#event-filters
Sample example here and wiki link. -
@Ratzz
Great, that works! Thanks a lot.