Consider the following code QFileDialog dlg; dlg.setMimeTypeFilters({"text/plain", "image/png"}); QObject::connect(&dlg, &QFileDialog::filterSelected, [](const QString &name){ qWarning() << "changed" << name; }); Changing the filter in the file dialog UI emits the filterSelected signal. However when selecting e.g. the PNG filter the name parameter is "image/png", not a QFileDialog filter expression. Running with another platformtheme, like gtk3, or the builtin file dialog gives "PNG image (*.png)"
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-integration/-/merge_requests/116
Git commit 2f94f2af78b55a4e8a9d758101a52ee3f1d14070 by Marco Martin, on behalf of Nicolas Fella. Committed on 07/11/2023 at 17:29. Pushed by nicolasfella into branch 'master'. Adapt to KFileWidget API change And while at it fix filterSelected for mimetypes M +26 -14 qt6/src/platformtheme/kdeplatformfiledialoghelper.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/2f94f2af78b55a4e8a9d758101a52ee3f1d14070