[Qt-interest] focus in - focus out events order
Duane Hebert
spoo at flarn.com
Fri Jan 15 18:31:33 CET 2010
"Frederic Tingaud" <tingaud at gostai.com> wrote in message news:4B509147.6060507 at gostai.com...
> Hi,
> I am working on an application which has an object containing a string
> that can be modified by inputing text in a QTextEdit. I would like to
> update the object only when the text is completely typed and not at each
> textChanged() signal, so I tried to use FocusOutEvent(). My problem is
> that I also have a bunch of QToolButtons and I found out that when
> clicking on them, the corresponding QAction is triggered before my
> QTextEdit receives the focusOutEvent. I assume the new focused object
> has its focusInEvent resolved before the focusOutEvent of the previous
> focus.
> Is it the normal behaviour (I use Qt 4.5 by the way) ? Is there a way
> for me to update my object before the action is triggered without
> changing the focusInEvent for all my ToolButtons ?
> Thanks for any help,
You may be able to set the focus policy of the toolbar to strong focus.
I had similar issues with a QLineEdit.
BTW, does it make sense to anyone that the TextEdited signal on a line edit
doesn't fire when there's a validator and the validator state is intermediate?
Had to use the focus out event to know to prompt the user to correct the data.
More information about the Qt-interest-old
mailing list