XDG Desktop portal in Qt
Unsolved
General and Desktop
-
I'm trying to open file in a Qt app via org.freedesktop.portal.FileChooser. So far it works the thing I'm stuck with is the filters.
The doc say to use the format filters a(sa(us))
QDBusMessage message = QDBusMessage::createMethodCall( QLatin1String("org.freedesktop.portal.Desktop"), QLatin1String("/org/freedesktop/portal/desktop"), QLatin1String("org.freedesktop.portal.FileChooser"), QLatin1String("OpenFile")); message << QLatin1String("x11:") << QLatin1String("Open PDF File") << QVariantMap { {QLatin1String("handle_token"), getRequestToken()}, {QLatin1String("multiple"), false}, {QLatin1String("filters"), QVariantMap { {QLatin1String ("PDF File"), QVariantList { {} }} }} };
Can some help me how to write a filter for PDF file.
-
Hi,
Not a direct answer but why not use QDesktopService::openUrl ?
Or are you trying to make your app open that file type ?