<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br>but didn't find a way of get it from a widget other than the main widget.</div><div><br></div><div>Thank you in advance.</div><div>Regards,</div><div>Jorge<br></div></div><br></blockquote><div><br></div><div>You can implement this on a QLineEdit as well: <a href="http://doc.qt.io/qt-5/qlineedit.html#keyPressEvent">http://doc.qt.io/qt-5/qlineedit.html#keyPressEvent</a> </div><div><br></div><div>(alternatively if you aren't able to use your own QLineEdit subclass, you can probably get it done with an event filter where you check if the source is a QLineEdit, but I wouldn't start there)</div><div><br></div><div>mh</div></div></div></div>