[Webkit-unassigned] [Bug 71919] New: Qt/Webkit bridge passing Drag and drop data fails

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 9 08:12:45 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=71919

           Summary: Qt/Webkit bridge passing Drag and drop data fails
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Windows 7
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Qt
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: b_clephas at hotmail.com


Created an attachment (id=114285)
 --> (https://bugs.webkit.org/attachment.cgi?id=114285&action=review)
Visual Studio project describing the issue

Passing string data from a (native HTML5) drag and drop action to a Qt C++ object fails.
In the attachment is a minimal example showing a custom Qt/C++ object made accessible from a webpage,
that is modified after a drag and drop action.

device.name is a QString property.

var droppedName = e.dataTransfer.getData('text/plain');

//alert(droppedName); // works
device.name = droppedName;  // Fails. Only 'F' from 'FirstBox' is passed - in memory whole string is present as UTF-32.


//device.name = 'Hardcoded';    // Works

When looking at the QString memory I see this in memory:

0x051B23F2  46 00 00 00 69 00 00 00 72 00 00 00 73 00 00 00 74 00 00 00 42 00  F...i...r...s...t...B.
0x051B2408  00 00 6f 00 00 00 78 00 00 00 00 00 fd fd fd fd ab ab ab ab ab ab  ..o...x.....ýýýý««««««

When doing something like:

device.name = 'hello ' + droppedName;

QString Memory is now shown as

0x02DA8CFA  68 00 65 00 6c 00 6c 00 6f 00 20 00 46 00 00 00 69 00 00 00 72 00  h.e.l.l.o. .F...i...r.
0x02DA8D10  00 00 73 00 00 00 74 00 00 00 42 00 00 00 6f 00 00 00 78 00 00 00  ..s...t...B...o...x...
0x02DA8D26  00 00 fd fd fd fd ab ab ab ab ab ab ab ab ee fe ee fe 00 00 00 00  ..ýýýý««««««««îþîþ....

When doing the same thing but passing the HTML element id instead, a document.getElementById fails to find the element (it does exist)

I'd expect that when I supply a QString from Qt/C++ which is correct and I use it inside a dataTransfer; that when the string is passed back to Qt/C++, the string is still valid/correct.

See attachment for an example (MS Visual Studio 2005, Qt 4.7.4)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list