Bug 49545

Summary: [Qt] [WK2] The focus switching does not seems to work with QGraphicsWKView
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: commit-queue, kbalazs
Priority: P4 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Inputs for testing
none
Patch kenneth: review+, commit-queue: commit-queue-

Description Benjamin Poulain 2010-11-15 08:33:27 PST
Created attachment 73902 [details]
Inputs for testing

It seems tabbing between fields does not work with QGraphicsWKView.

To reproduce, open Minibrowser on the attached file and enjoy :)
Comment 1 Benjamin Poulain 2010-11-16 09:49:42 PST
Created attachment 74006 [details]
Patch

The FriendlyWidget of QGraphicsWKView::focusNextPrevChildCallback() is one hell of a ugly hack. Any idea to do that better is welcome.
Comment 2 Kenneth Rohde Christiansen 2010-11-17 01:56:48 PST
Comment on attachment 74006 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=74006&action=review

> WebKit2/UIProcess/API/qt/qgraphicswkview.cpp:146
> +class FriendlyWidget : public QWidget

Simon says that this is OK :-)
Comment 3 WebKit Commit Bot 2010-11-17 02:40:33 PST
Comment on attachment 74006 [details]
Patch

Rejecting patch 74006 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=abarth-cq-sl', 'apply-attachment', '--force-clean', '--non-interactive', 74006]" exit_code: 2
Last 500 characters of output:
ceeded at 81 (offset 6 lines).
patching file WebKit2/UIProcess/API/qt/qwkpage.cpp
patching file WebKit2/UIProcess/API/qt/qwkpage.h
Hunk #1 FAILED at 112.
1 out of 1 hunk FAILED -- saving rejects to file WebKit2/UIProcess/API/qt/qwkpage.h.rej
patching file WebKit2/UIProcess/API/qt/qwkpage_p.h
Hunk #1 succeeded at 55 with fuzz 1 (offset 1 line).

Failed to run "[u'/Users/abarth/git/webkit-queue/WebKitTools/Scripts/svn-apply', u'--reviewer', u'Kenneth Rohde Christiansen', u'--force']" exit_code: 1

Full output: http://queues.webkit.org/results/6182013
Comment 4 Benjamin Poulain 2010-11-17 05:51:35 PST
Committed r72202: <http://trac.webkit.org/changeset/72202>
Comment 5 Balazs Kelemen 2010-11-17 08:48:06 PST
(In reply to comment #1)
> Created an attachment (id=74006) [details]
> Patch
> 
> The FriendlyWidget of QGraphicsWKView::focusNextPrevChildCallback() is one hell of a ugly hack. Any idea to do that better is welcome.

What is the purpose of that? We are assuming the concrete type of the QWidget, 
right? Why not qobject_cast? Or am I misinterpreting it?
Comment 6 Benjamin Poulain 2010-11-17 09:36:48 PST
(In reply to comment #5)
> > The FriendlyWidget of QGraphicsWKView::focusNextPrevChildCallback() is one hell of a ugly hack. Any idea to do that better is welcome.
> 
> What is the purpose of that? We are assuming the concrete type of the QWidget, 
> right? Why not qobject_cast? Or am I misinterpreting it?

It is to change the visibility of a method. This method is usually available through QWidget, but here we are in a QGraphicsWidget, so we can't access it directly.

This cast is a way to make a protected method public.