Control for scrolling

Aaron Seigo aseigo at kde.org
Thu Dec 11 17:38:24 GMT 2003


On Thursday 11 December 2003 8:19, Carsten Pfeiffer wrote:
> On Thursday 11 December 2003 00:16, Aaron Seigo wrote:
> (yes, I'm still alive, hi everybody :)

=))

> but this would be inconsistent with every other QScrollView then, no?
> QScrollView by default uses Control for fast-scrolling, QTextEdit
> unfortunately overrides that (re-overridden in KTextEdit and KTextBrowser).
>
> So unless you persuade the Trolls to change QScrollView, we wouldn't gain
> any constistency (think about any QListView, , QListBox, QIconView, ...).

QListView, QListBox, QIconView, etc support BOTH Shift and Control as 
fast-scrolling modifiers. they swing both ways, so to speak. ;-) it's really 
a matter of which one to steal for zooming needs. QTextEdit and KView have 
chosen Control, and that makes sense.

As for KTextEdit, here's the appropriate code:


void KTextEdit::contentsWheelEvent( QWheelEvent *e )
{
    if ( KGlobalSettings::wheelMouseZooms() )
        QTextEdit::contentsWheelEvent( e );
    else // thanks, we don't want to zoom, so skip QTextEdit's impl.
        QScrollView::contentsWheelEvent( e );
}

so if we do scroll with the mouse wheel, we use QTextEdit's wheel event 
handler. and that means Control to zoom.

-- 
Aaron J. Seigo




More information about the kde-core-devel mailing list