[Qt-interest] Force file extension with QFileDialog::getSaveFileName?

David Doria daviddoria at gmail.com
Wed Jun 22 20:01:21 CEST 2011


Ah, I follow you guys now. I agree that it seems silly to call a
static function from an object instance, but I guess that's a fight
for a different place and different day!

It does what I expected with:

QFileDialog dialog(this);
dialog.setDefaultSuffix("png");
dialog.exec();
QString fileName = dialog.selectedFiles()[0];

Thanks for the help!



More information about the Qt-interest-old mailing list