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

Native QFileDialog does not block file drop events

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.7.0
    • None
    • Windows 10 x64

    Description

      QFileDialog uses native Windows by default. The Windows File dialog does not correctly catch and block drop events. This leads to a modal QFileDialog not preventing drops from occuring below the dialog (through the dialog). This is an issue in Qt Creator as well.

      The screenshots show the issue in action. It shows how a dragged file can be dropped on "non-droppable" areas of the file dialog. The drop is accepted and handled by the window "behind" the modal dialog. In this example, Qt Creator will open the dropped file, while the dialog stays open (and does not interfere with the drop in any way).

      The second screenshot marks the areas which handle file drops as expected (windows file handling)[blue], and the areas where it unexpectedly ignores potential and final file drops with the window/widget "behind" handling it [red].

      Using the QFileDialog::DontUseNativeDialog fixes this issue by using a different dialog.

      This may very well be a Windows dialog issue, so I am not sure if this can be fixed in Qt. Nontheless, it is unexpected, confusing, and kind of defeats the "modality" of the dialog (although I recognize I can still drop files outside of the modal dialog and they will be handled).

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kissaki Jan Klass
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes