There is a QDesktopServices::openUrl function in Qt which opens files with default programs, like when you want to open .docx file with Microsoft Office. However, the function will simply return 0 and do nothing if there is no default program assotiated with the file extension of the requested file. I would like Qt to show something like this instead:

A cross-platform solution would be ideal.
Is it possible with Qt?
This one works for me. But I didn't test it anywhere except my Windows 7 machine
QDesktopServices::openUrl(QUrl::fromLocalFile("D:/file"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With