Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MS Windows QWidget virtual files from QDropEvent's mimeData()
Qt 6.11 is out! See what's new in the release blog

MS Windows QWidget virtual files from QDropEvent's mimeData()

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 734 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thecodemonkey
    wrote on last edited by thecodemonkey
    #1

    Hi,

    when dropping for example an e-mail message from Microsoft Outlook to a QWidget the resulting QDropEvent / mimeData() does not fetch the actual .msg file data. I know there are some articles/threads on other sites on this topic, e.g. on MSDN, but I don't understand how to connect this with a QWidget drop event, plus it makes use of MAPI which is not ideal, because it is not a generic approach. This C# example does exactly what I want to achieve without MAPI, but depends on DotNet, but obviously I'm using Qt5/C++. I also read, that there is an abstract class in WinExtras QWinMime which is supposed to "convert" certain Windows specific Clipboard formats, but I can't find any information on implementing concrete classes or how to use within a dropEvent. Can someone help please?

    void DragDropTest::dropEvent(QDropEvent *event) {
        QByteArray fileDescriptor = event->mimeData()->data(QLatin1Literal("application/x-qt-windows-mime;value=\"FileGroupDescriptorW\""));
        // how to process fileDescriptor (or other mime data that is provided here) to get the file data
    }
    
    raven-worxR 1 Reply Last reply
    0
    • T thecodemonkey

      Hi,

      when dropping for example an e-mail message from Microsoft Outlook to a QWidget the resulting QDropEvent / mimeData() does not fetch the actual .msg file data. I know there are some articles/threads on other sites on this topic, e.g. on MSDN, but I don't understand how to connect this with a QWidget drop event, plus it makes use of MAPI which is not ideal, because it is not a generic approach. This C# example does exactly what I want to achieve without MAPI, but depends on DotNet, but obviously I'm using Qt5/C++. I also read, that there is an abstract class in WinExtras QWinMime which is supposed to "convert" certain Windows specific Clipboard formats, but I can't find any information on implementing concrete classes or how to use within a dropEvent. Can someone help please?

      void DragDropTest::dropEvent(QDropEvent *event) {
          QByteArray fileDescriptor = event->mimeData()->data(QLatin1Literal("application/x-qt-windows-mime;value=\"FileGroupDescriptorW\""));
          // how to process fileDescriptor (or other mime data that is provided here) to get the file data
      }
      
      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @thecodemonkey
      I had the same problem once. Its not solvable via Qt. You will need to use WinAPI to access the drop data and this requires a pointer to the drop-handle pointer IIRC. But this is hidden in the Qt internals and required a change to the Qt source code to be able to handle this in the dropEvent() handler.

      There is also a bugreport regarding the missing ability to handle FileContents/FileGroupDescriptor mime-types, but i can't find it though.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved