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

QFileDialog returns wrong path

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.9.1
    • None
    • ubuntu 16.04
    • Linux/X11

      Recently, I am learning QT. I want to use QFileDialog to open some file. But I don't want to use native dialog, so I set QFileOption::DontUseNativeDialog to true. It works, and I can see QT own QFileDialog.

      But there is a problem. If I use native dialog, it will select the first item by default when I enter a folder. But QT own QFileDialog doesn't act the same. Exactly, it works wrong.
      Here is the detail.
      When I open a QFileDialog, it select nothing, and the open button is disabled.

      Then I select a file manully, and the open button is enabled.

      Then I enter another folder, but it selects nothing in the folder. What's more the open button is still enabled.

      Finally, I click the open button, and I get a file returned. But its path is not correctly. Its path is /tmp/VMwareDnD/config-err-2Emdj0. But the right path should be /tmp/config-err-2Emdj0

      What should I do to solve this problem?

      My environment.
      ubuntu 16.04

       

      https://forum.qt.io/topic/95464/qfiledialog-returns-wrong-path/2

      https://bugreports.qt.io/browse/QTBUG-2947

       

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            water Qingshui Kong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes