Skip to content

Instantly share code, notes, and snippets.

@estan
Created April 16, 2018 14:42
Show Gist options
  • Save estan/f3e43f647a112d64c9f17a8bad9a094a to your computer and use it in GitHub Desktop.
Save estan/f3e43f647a112d64c9f17a8bad9a094a to your computer and use it in GitHub Desktop.
#include <QApplication>
#include <QFileDialog>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QFileDialog dialog(0, "Test Dialog");
dialog.setConfirmOverwrite(true);
dialog.setAcceptMode(QFileDialog::AcceptSave);
// As soon as I uncomment this, to use the Qt build-in dialog,
// the confirmation dialog is shown when picking an existing file.
//dialog.setOption(QFileDialog::DontUseNativeDialog);
dialog.exec();
return app.exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment