PDA

View Full Version : QLineEdit Focus



zgulser
10th March 2009, 14:43
Hi there,

I have a simple question. I checked out the forum but I couldn't find the proper solution. I want to know if there is a signal to be emitted when the widget(particularly QLineEdit for my situation) when the widget grabs focus.

Thanks in advance.

spirit
10th March 2009, 14:51
there is no such signal. but you can install event filter and catch QEvent::FocusOut/FocusIn event.

zgulser
10th March 2009, 15:01
Hımm,

So I would reimplement focusInEvent(). But where?

spirit
10th March 2009, 15:04
actually you dont need to reimplement that method just install event filter for needed object and catch needed event. read this eventFilter (http://doc.trolltech.com/4.5/qobject.html#eventFilter).