[webkit-qt] Pinch zoom for QWebView?

Benjamin Poulain benjamin.poulain at nokia.com
Sat Jan 8 08:27:24 PST 2011


Hi,

On 01/08/2011 10:11 AM, ext Harri Pasanen wrote:
> I wonder if pinch zoom is on the roadmap for webkit?
>
> Meanwhile I rolled my own simple implementation which is better than nothing,
> but not perfect.  In my code I'm scaling a pixmap for fluid motion, and at the
> end I call setZoomFactor.  The relevant code is visible here:
> http://pastebin.com/VzimAPD0
>
> It is usable in that it works fluidly and gives you a rough idea what the
> resulting zoom will be.  But pixel positions move around and the end result is
> rarely exact to the zoom preview.
>
> On Symbian3 the native browser's pinch zoom is much more faithful to pixel
> positions and sizing of the preview.  So that must be doing something more
> clever, any hints what?
>
> Better yet, perhaps this is already implemented and I just have to be patient
> and it will be delivered to my door...

Ultimately, I think we will handle gesture directly in the APIs. At the 
moment, we choose to give all freeedom to implementors, which is good 
(more freedom :)) and bad (more work, inconsistency between 
implementations) at the same time.

Do not expect this to change in the short term. Changing this requires 
some effort for which we don't have time at the moment.

If you are doing a project for a device where you mixes mouse input and 
touch input (computer with touchscreen for example), doing as you 
describe is a solution.

If you are targeting a device where touch is the main kind of input, I 
suggest you not to use QWebView but build a mobile interface on top of 
QGraphicsWebView.

There is some documentation being written for such mobile feature: 
https://bugs.webkit.org/show_bug.cgi?id=41465
I suggest you to look at that temporary draft 
(https://bugs.webkit.org/attachment.cgi?id=62768&action=prettypatch ) 
and then ask if you have questions.

cheers,
Benjamin


More information about the webkit-qt mailing list