I tried using a QFileDialog
in a program of mine, but I prefer the default file dialog that is used by the host's OS. In my case, since I use Windows 7, it should look like this:
Is there a way to make Qt use the default file dialog that is used by the host's OS?
My code:
QFileDialog saveDialog(this);
saveDialog.setAcceptMode(QFileDialog::AcceptSave);
if (!saveDialog.exec())
return;
Use the static functions for it and it will work.
QString filename = QFileDialog::getOpenFileName(this, ... vars);
It will use the native dialogs for OSX and Windows, but if you don't use one of the static functions to show it, it will use the QT one.
It was written in the docs for those different static functions.
http://doc.qt.io/qt-4.8/qfiledialog.html
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