how select whole directory also in QFileDialog?
How can i support QFileDialog to open multiple files and folders(Directories)?
I'm wrote following code, It enables only to open files not able to open directories. How can i include Directory also?
Code:
this,
"Select one or more files to open",
"/home",
"Images (*.png *.xpm *.jpg)");
Please somebody help me....Thanks in advance..
Re: how select whole directory also in QFileDialog?
Code:
"/home",
"Images (*.png *.xpm *.jpg)",
this,
"open file dialog"
"Choose a file" );
In the above example, The startup directory is set to "/home" ( or if you using windows -"C:\Win") The file filter is set to "Images (*.png *.xpm *.jpg)". The parent of the file dialog is set to this and it is given the identification name - "open file dialog". The caption at the top of file dialog is set to "Choose a file". If you want to use multiple filters, separate each one with two semi-colons, e.g.
"Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"
NOTE - The code given is a working code from Qt 3. I am not sure whether the funtion definition has changed Qt 3 to Qt 4. PLease check the man pages/ documentation.
Hope this clear it out for you do let me/us know if you need anything more.
Re: how select whole directory also in QFileDialog?
Quote:
Originally Posted by
amitahire
Code:
"/home",
"Images (*.png *.xpm *.jpg)",
this,
"open file dialog"
"Choose a file" );
In the above example, The startup directory is set to "/home" (
or if you using windows -"C:\Win") The file filter is set to "Images (*.png *.xpm *.jpg)". The parent of the file dialog is set to this and it is given the identification name - "open file dialog". The caption at the top of file dialog is set to "Choose a file". If you want to use multiple filters, separate each one with two semi-colons, e.g.
"Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"
NOTE - The code given is a working code from Qt 3. I am not sure whether the funtion definition has changed Qt 3 to Qt 4. PLease check the man pages/ documentation.
Hope this clear it out for you do let me/us know if you need anything more.
Thank u...But actual my requirement is the dialog must support opening both MULTIPLE FILES and DIRECTORY...
If i use the code u given, where the list of file names(which is suppose to open) will be stored?
Re: how select whole directory also in QFileDialog?
Quote:
Originally Posted by
aurora
Thank u...But actual my requirement is the dialog must support opening both MULTIPLE FILES and DIRECTORY...
If i use the code u given, where the list of file names(which is suppose to open) will be stored?
I searched around a bit and found that QFileDialog cannot by default select multiple files - http://developer.qt.nokia.com/faq/an...i_select_multi but by getting hold of other classes.
Check these threads out
http://www.qtcentre.org/threads/3422...le-directories
http://www.qtcentre.org/threads/1881...om-QFileDialog
Before posting search in the form first :-). Hope you can solve it.
Re: how select whole directory also in QFileDialog?