"/home",
"Images (*.png *.xpm *.jpg)",
this,
"open file dialog"
"Choose a file" );
QString s = QFileDialog::getOpenFileName(
"/home",
"Images (*.png *.xpm *.jpg)",
this,
"open file dialog"
"Choose a file" );
To copy to clipboard, switch view to plain text mode
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.
Bookmarks