[Patch] Fix keyboard navigation (tabbing out of a textarea)

Tobias Anton TA at ESC-Electronics.de
Tue Jul 13 14:23:01 BST 2004


On Dienstag, 13. Juli 2004 02:36, bj at altern.org wrote:
> On Monday 12 July 2004 16.31, Tobias Anton wrote:
> > Great! Can we extend this to wheel events, too? (They get swallowed by
> > the text area even if it is already at the top/bottom of the editable
> > area.)
>
> Well, wheel events are only swallowed if the textarea is focused. I don't
> see the point of having to use a context menu when you just need to focus
> in /out to have the wheel action react in textarea/global view. Maybe I
> missed something...

Ah, no, I meant something different: The mouse wheel event should not be 
swallowed if the textarea cannot scroll any further down. The wheel event 
should then be passed up to the parent khtmlview so that it can scroll the 
whole document.

> > And this code:
> >
> > +	    QApplication::sendEvent( parent(), ke );
> > +	    return true;
> >
> > would better be written like this:
> >
> > +         return QWidget::event(ke);
>
> I guess you mean :
> +	    return QApplication::sendEvent( parent(), ke );

Yeah, it was wrong, but QApplication::sendEvent is wrong, too. 


During investigating the event flow, I found a flag "tabChangesFocus" in the 
qtextedit code. It can be modified through the method

QTextEdit::setTabChangesFocus(bool).

If you simply use that function, you neither have to intercept event(), nor 
keyPressEvent() or focusNextPrevChild().

Cheers
-- Tobias




More information about the kfm-devel mailing list