PDA

View Full Version : QFileDialog options



The Storm
20th December 2007, 21:59
Here what I have


QFileDialog *fileDialog = new QFileDialog();
fileDialog->setWindowTitle("Open media file");
fileDialog->setFilter(QString("Media Files (*.mp3 *.wav *.wma)"));
fileDialog->exec();
QString szTempFile = fileDialog->result();


I can set WindowTitle, Filter and other functions that take flags, but there is no function that take the Options like QFileDialog::ShowDirsOnly, QFileDialog::DontUseNativeDialog and etc. Maybe there is other way and I can't see it? I don't want to use the static public members like getExistingDirectory() and such.

Thanks. :)

wysota
20th December 2007, 23:44
If you use the non-static method, native dialog won't be used. You can substitute ShowDirsOnly with setting the fileMode property.

The Storm
21st December 2007, 11:06
Ahh, ok, then is there a way to add custom widget to the native windows dialog like a checkbox for recursive dirs. I have seen this in some players and other programs or they had created a new custom dialog that looks like the windows one ? :)

wysota
21st December 2007, 12:03
If you access the layout of the widget, then why not...

jpn
21st December 2007, 21:00
Ahh, ok, then is there a way to add custom widget to the native windows dialog like a checkbox for recursive dirs. I have seen this in some players and other programs or they had created a new custom dialog that looks like the windows one ? :)
I suppose the native file dialog has an option for such checkbox. You might have to construct such file dialog yourself via WinAPI...


If you access the layout of the widget, then why not...
I'm afraid a native file dialog doesn't have a layout which would be able to manage QWidgets... ;)

wysota
22nd December 2007, 11:22
Well... yes, somehow I missed the fact that the question was for the native dialog.