Hello everybody,
my question is simple (but the answer is usually not simple). I have a widget and i need to know when this widget loose the focus. I need "some mechanism" that warn me when i loose the focus.
thanks in advance!!
Javi.
Hello everybody,
my question is simple (but the answer is usually not simple). I have a widget and i need to know when this widget loose the focus. I need "some mechanism" that warn me when i loose the focus.
thanks in advance!!
Javi.
The answer is very simpleQApplication::focusChanged().
but i have a problem with this solution, I need to know what's the next widget, but i don't know what's the next widget the user click on...??
how focusChanged is used??
(thanks!!)
Would you take a look at its documentation and look what parameters it has?
jrodway (17th April 2008)
question answered, thanks!!
how can we use this signal? I mean how can we connect with the specified slot. Because it seems QApplication is not an QObject.
Hi, use QCoreApplication::instance() or the static QApplication::qApp to get a pointer for the QApplication object.
Ginsengelf
Hi again,
I 've a problem with this method. Once a new frame is poped up, the focusChange signal does not give the focus to this new widget. Therefore I should reimplement focusIn and focusOut events in this new widget. Is there a better way to do this?
Thanks in advance
Can anyone has any idea?
What exactly are you trying to achieve? Maybe QWidget::activateWindow() is something for you?
Hi again,
I want my widget which grabs the focus by mouse click to be raised.
In my application, the widgets can pop-up upon a button click. Once the particular widget(Widget 1) is popped up, it is raised and may cover some part of the most recently focused widget(Widget 2) (which has just normally lowered in the widget stack).
But when I want to raise it again by clicking on it, it grabs the focus but not raised at all. It couldn't show all of itself ( since the widget 2 covered some part of it.)
I hope I make myself clear.
Hi,
Problem solved!
The problem is in the focusing configuration of the widgets. When the ui class has a focus itself, you shouldn't set any focus to it's subwidgets.
Bookmarks