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

urls in QDropEvent is not correct when drag and drop file from WSL2 network location to Qt widget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • 5.15.2, 6.0.0
    • 5.12.9, 5.13.1, 5.15.0
    • GUI: Drag and Drop
    • None
    • Windows with WSL2
    • Windows
    • 97de53ee8cce3dc6347b08668f0de45e1000f01c 9ef4fba108761bf30b9572fc53eaf98008bb4aae (qt/qtbase/5.15)

    Description

      When drag and drop file from windows explorer which opened a WSL2 location to a Qt based app, urls from event->mimeData()->urls() in dropEvent(QDropEvent *event) are always missing the hostname and no way to obtian the original url.

      To reproduce:

      • Prepare a Windows system with WSL2(Windows Subsystem for Linux 2) subsystem.
      • Prepare a Qt application which accept file drop and print the URL which dropped on top of that widget/application.
      • Open any WSL2 network location, and drag the file to the Qt application. (example path: \\wsl$\Ubuntu\home\username\filename.png)
      • See the print. (for the example location, the hostname part wsl$ will be disappeared.

      Probably related to QTBUG-86277 but I'm not quite sure. Although wsl$ is not a valid hostname, but since when DnD the url are get handled by Qt internal, so seems no way to workaround. Expecting a way to obtian correct file url for DnD.

      Let me know if you need any additional info.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              blumia Gary Wang
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes