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

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.9, 5.13.1, 5.15.0
    • Fix Version/s: None
    • Component/s: GUI: Drag and Drop
    • Labels:
      None
    • Environment:
      Windows with WSL2
    • Platform/s:
      Windows

      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

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

          Activity

            People

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes