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

Multi drag n drop is not managed properly with a Windows mime type 'FileContents'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.0
    • 4.7.1
    • GUI: Drag and Drop
    • None
    • Windows, VS 2010, qt 4.7.1
    • efbc53858725ec8563bb97423d9bf789c41cf79f

    Description

      There is an issue while for instance we try to drag n drop several mail attachments from outlook.
      I ask the QMimeData object to give me the data related to the mime type: application/x-qt-windows-mime;value="FileContents", and all I retrieve from this is the content of one file of the initial selection.
      The problem is located in the method static QByteArray getData(int cf, IDataObject *pDataObj) (line 156) in the file qmime_win.cpp.

      The code looks like that:

      //Try reading IStream data
      formatetc.tymed = TYMED_ISTREAM;
      if (pDataObj->GetData(&formatetc, &s) == S_OK) {
         char szBuffer[4096];
         ULONG actualRead = 0;
      

      GetData is done only on one index of the object formatect, designed by the attribute lindex of the Windows structure FORMATETC:

      typedef struct tagFORMATETC
          {
          CLIPFORMAT cfFormat;
          DVTARGETDEVICE *ptd;
          DWORD dwAspect;
          LONG lindex;
          DWORD tymed;
          } 	FORMATETC;
      

      You do not iterate on the index so the only data you read is the data of the first element dropped.
      Would it be possible to fix it please?

      Attachments

        1. drop site.zip
          8 kB
        2. qtbug17373.zip
          5 kB
        3. Untitled.png
          Untitled.png
          76 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dfaure_kdab David Faure
            cyrille_slb Cyrille Rey
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes