[Qt-interest] [Fwd: [Fwd: Problem with focusNextChild and QPlainTextEdit]]

Ian Thomson Ian.Thomson at iongeo.com
Fri Mar 27 11:13:57 CET 2009


Hi,

Does focusNextChild return true or false? It should return true if it 
succeeds.

Also, could it be that calling the QPlainTextEdit::keyPressEvent after 
checking for F8 means that it takes the focus back? What happens if you 
check for F8 after running QPlainTextEdit::keyPressEvent?

Cheers,
Ian.

Stefano Rosellini wrote:
> Last call for help... Really no one?!?
> 
> I suspect that problem is about the tab key but I haven't found any simple solution.
> 
> 
> --- Original message ---
> 
> No one?
> 
> --- Original message ---
> 
> If I use focusNextChild on a QLineEdit, it works, but on QPlainTextEdit 
> the focus remain on this widget. Does someone know why?
> 
> I used this overload for keyPressEvent (that works perfectly for QLineEdit).
> 
> void PEditorWidget::keyPressEvent(QKeyEvent *event) {
>   if (event->key()==Qt::Key_F8) {
>     focusNextChild();
>     return;
>   }
>   QPlainTextEdit::keyPressEvent(event);
> }
> 
> 
> Thanks.
> 
> Stefano Rosellini
> Informatica Valdinievole
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
> 




More information about the Qt-interest-old mailing list