Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9643

Dragging and dropping text on a webkit plugin, the mimedata is not handled correctly

    XMLWordPrintable

Details

    Description

      Assuming Webkit has encoded the mimedata correctly, then Qt might not be decoding it correctly.

      In the drag, the text coming from Webkit is UTF16, while Qt assumes it is UTF8.
      The representation of the string will then be garbled with extra space or unknown chars, depending on platform.

      If you know the text you are receiving is UTF16, then you can work around it (ref the example, droparea.cpp) by doing:

      DropArea::dropEvent(), line 90

      } else if (mimeData->hasText()) {
                  setText(QTextCodec::codecForName("UTF-16")->toUnicode(mimeData->data("text/plain")));
      		setTextFormat(Qt::PlainText);
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shausman Simon Hausmann
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes