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

Add support to fetch virtual file data in QDropEvent on Microsoft Windows

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P4: Low
    • 6.5.0 FF, 5.15
    • None
    • GUI: Drag and Drop
    • None
    • Microsoft Windows

    • Windows

    Description

      On Microsoft Windows, when dragging from some applications (e.g. an e-mail from MS Outlook) to a QWidget, the QDropEvent contains the Windows specific mime data application/x-qt-windows-mime;value="FileGroupDescriptorW" while the "FileContents" type is empty. So in order to get the actual file content, you would need to use WinAPI  (MemoryStream and whatnot). But to do so you would need access to the internal handle pointer. Thus, the best solution would be an official Qt convenience method, that retrieves the data as QByteArray or QIODevice. Alternatively a method to get the handle pointer (Or maybe something like this already exists and I just didn't find it yet?)

      Also compare https://forum.qt.io/topic/91413/ms-windows-qwidget-virtual-files-from-qdropevent-s-mimedata/2 , https://www.codeproject.com/Articles/28209/Outlook-Drag-and-Drop-in-C?msg=5523921#xx5523921xx and https://social.msdn.microsoft.com/Forums/office/en-US/b2e50357-a87c-4323-a851-5050b0e5b34b/not-able-to-get-filecontents-after-drop-on-form-occured?forum=outlookdev

       

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              thecodemonkey thecodemonkey
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes