[webkit-qt] Accessing private object/class in Qt from DRT

Robert Hogan lists at roberthogan.net
Fri Mar 26 13:58:56 PDT 2010


On Friday 26 March 2010 20:31:12 Robert Hogan wrote:
> Hi there,
> 
> So I've concluded (without confirming it in practice yet) that in order
>  to support Drag and Drop in layout tests the DRT needs to be able to
>  send the mouseUp() event to the event loop in QDragManager. I believe
>  sending it to QWebView doesn't work for the simple reason that
>  QDragManager has the event loop when a drag is in progress and unless
>  it receives the
> QEvent::MouseButtonRelease it's just going to block the main event loop.
> 
> This matches the way the tests currently fail and my experimentation
>  when trying to get them to work.
> 
> So in order to send a MouseButtonRelease event to QDragManager's event
>  loop it needs to be accessible from the DRT and it is not public API in
>  Qt.
> 
> So what to do? I can try sending a QDropAction to QWebPage but I suspect
> that will get me nowhere as long as the eventloop in QDragManager is
>  still running. A quick grep of qt sources doesn't reveal any precedent
>  for creating accessors to private Qt classes from QtWebKit.
> 
> Does the above sound sensible? If so, what's the best way to solve this?
> 

Jakub on IRC suggested looking at Qt autotests and, although dnd coverage 
there is quite sparse, where it is covered the test bed uses 
QDrag/DropEvents. This approach could be used for QtWebKit too but it would 
mean bypassing the actual drag/drop stuff in WebCore and DragClientQt and 
co.

That might be a reasonable half-way house for the time being, it would sure 
pass a lot of tests!


More information about the webkit-qt mailing list