PDA

View Full Version : How to add network computers into QFileDialog?



tehman
21st June 2012, 09:36
Hello!

My QFileDialog object is for selecting folders. I do like this:


QFileDialog flg(this, "Choose folder", QDir::homePath(), QString());
flg.setFileMode(QFileDialog::Directory);
flg.setOption(QFileDialog::ShowDirsOnly);
if(flg.exec())
{
QStringList folders = flg.selectedFiles();
...

I want the file dialog to display my network places (computers that are in my network) in the left panel (near My Computer, My Documents and etc). I know I can use the static method getExistingDirectory() but in that way I can choose only one folder but I need a multiselection. So what should I do? Would you help me, please?

wysota
21st June 2012, 11:50
AFAIR, non-native dialog will not show network drives.

tehman
22nd June 2012, 13:36
Thank you for the reply. I think you are right. I refused from folders multiselection and now I use the static method getExistingDirectory which displays my network places but allows to choose only one folder.