https://bugs.kde.org/show_bug.cgi?id=402077

--- Comment #1 from Chris Holland <zrenf...@gmail.com> ---
I was wrong, setLabelText is *suppose* to set the label next to the filename
TextField but it seems the the KDE KDialog ignores it.
https://github.com/qt/qtbase/blob/5.11/src/widgets/dialogs/qfiledialog.cpp#L605

Looking at the selectFile logic...
https://github.com/qt/qtbase/blob/5.11/src/widgets/dialogs/qfiledialog.cpp#L1047

It seems that it will set the lineEdit text even if the filename does not
exist, and even if it's a relative path.

So I suggest we move the selectFile(currentName) after we navigate to the
correct directory.

    if (!currentFolder.isEmpty()) {
        fileDialog->setDirectoryUrl(QUrl(currentFolder));
    }

    if (!currentFile.isEmpty()) {
        fileDialog->selectFile(currentFile);
    }

    if (!currentName.isEmpty()) {
        fileDialog->selectFile(currentName);
    }

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to