The QFileDialog provides a dialog widget for inputting file names. More...
#include <qfiledlg.h>
Inherits QDialog.
Example:
QString fileName = QFileDialog::getOpenFileName(); if ( !fileName.isNull() ) { // got a file name ... }
There are two ready-made convenience functions, getOpenFileName() and getSaveFileName(), which may be used like this:
QString s( QFileDialog::getOpenFileName() ); if ( s.isNull() ) return; open( s ); // open() being your function to read the file
See also: QPrintDialog.
Constructs a file dialog with a parent, name and modal flag.
The dialog becomes modal if modal is TRUE, otherwise modeless.
Constructs a file dialog with a parent, name and modal flag.
The dialog becomes modal if modal is TRUE, otherwise modeless.
Destroys the file dialog.
Returns the active directory in the file dialog.
See also: setDir().
[signal]
This signal is emitted when the user has selected a new directory.
Returns the active directory path string in the file dialog.
[signal]
This signal is emitted when the user highlights a file.
[signal]
This signal is emitted when the user selects a file.
[static]
Opens a modal file dialog and returns the name of the file to be opened. Returns a null string if the user cancelled the dialog.
This static function is less capable than the full QFileDialog object, but is convenient and easy to use.
Example:
// start at the current working directory and with *.cpp as filter QString f = QFileDialog::getOpenFileName( 0, "*.cpp", this ); if ( !f.isEmpty() ) { // the user selected a valid existing file } else { // the user cancelled the dialog }
getSaveFileName() is another convenience function, equal to this one except that it allows the user to specify the name of a nonexistent file name.
See also: getSaveFileName().
[static]
Opens a modal file dialog and returns the name of the file to be saved. Returns a null string if the user cancelled the dialog.
This static function is less capable than the full QFileDialog object, but is convenient and easy to use.
Example:
// start at the current working directory and with *.cpp as filter QString f = QFileDialog::getSaveFileDialog( 0, "*.cpp", this ); if ( !f.isEmpty() ) { // the user gave a file name } else { // the user cancelled the dialog }
getOpenFileName() is another convenience function, equal to this one except that it allows the user to specify the name of a nonexistent file name.
See also: getOpenFileName().
Re-reads the active directory in the file dialog.
It is seldom necessary to call this function. It is provided in case the directory contents change and you want to refresh the directory list box.
[virtual protected]
Handles resize events for the file dialog.
Reimplemented from QWidget.
Returns the selected file name.
If a file name was selected, the returned string will contain the absolute path name. The returned string will be a null string if no file name was selected.
See also: QString::isNull().
Sets a directory path for the file dialog.
See also: dir().
Sets a directory path string for the file dialog.
See also: dir().
This file is part of the Qt toolkit, copyright © 1995-97 Troll Tech, all rights reserved.
It was generated from the following files: