|
|
The KFileDialog widget provides a user (and developer) friendly way to select files. The widget can be used as a drop in replacement for the QFileDialog widget, but has greater functionality and a nicer GUI.
You will usually want to use one of the two static methods KFileDialog::getOpenFileName or KFileDialog::getSaveFileName.
The dialog has been designed to allow applications to customise it by subclassing. It uses geometry management to ensure that subclasses can easily add children which will be incorperated into the layout.
|
Construct a KFileBaseDialog
Parameters:
dirName | The name of the directory to start in. |
filter | A shell glob that specifies which files to display. see setFilter for details on how to use this argument |
acceptURLs | If set to false, kfiledialog will just accept files on the local filesystem. |
~ |
Cleans up
QString |
Returns the fully qualified filename.
QString |
Return the path of the selected directory.
void |
Rereads the currently selected directory.
void |
Go back to the previous directory if this is not the first.
void |
Go forward to the next directory if this is not the last.
void |
Go home.
void |
Go to parent.
bool |
[const]
Returns true for local files, false for remote files.
QString |
Returns the url of the selected filename
QStrList |
Returns the URLs of the selected files.
void |
If the argument is true the dialog will accept multiple selections.
bool |
[const]
Returns true if multiple selections are enabled.
QString |
[static]
This method creates a modal directory dialog and returns the selected directory or an empty string if none was chosen. Note that with this method the user must select an existing directory.
Parameters:
url | This specifies the path the dialog will start in. |
parent | The widget the dialog will be centered on initially. |
name | The name of the dialog widget. |
QStrList |
This a multiple selection version of getOpenFileURL().
QStrList |
This a multiple selection version of getSaveFileURL().
void |
Sets the directory to view
Parameters:
name | URL to show |
clearforward | indicate, if the forward queue should be cleared |
void |
Sets the filename to preselect. It takes absolute and relative file names
void |
Sets the filter to be used to filter. You can set more filters for the user to select seperated by \n. Every filter entry is defined through namefilter|text to diplay. If no | is found in the expression, just the namefilter is shown. Examples:
kfile->setFilter("*.cpp|C++ Source Files\n*.h|Header files"); kfile->setFilter("*.cpp"); kfile->setFilter("*.cpp|Sources (*.cpp");
Note: the text to display is not parsed in any way. So, if you want to show the suffix to select by a specific filter, you must repeat it.
void |
[signal]
Emitted when the user selects a file.
void |
[signal]
Emitted when the user highlights a file.
void |
[signal]
Emitted when a new directory is entered.
void |
[signal]
Emitted when the allowable history operations change.
QStack<QString> |
[protected]
Contains all URLs you can reach with the back button.
QStack<QString> |
[protected]
Contains all URLs you can reach with the forward button.
bool |
[protected]
Lock backStack and forwardStack .
QWidget * |
[protected virtual]
Subclasses should reimplement this method to swallow the main layout. This allows the addition of children that are outside the existing layout. The function should return the widget that should be the parent of the main layout.
KFileInfoContents * |
[protected pure virtual]
Subclasses, that want another view should override this function to provide another file view. It will be used to display files.
bool |
[protected pure virtual]
Overload this function, if you want the filter shown/unshown
void |
[protected]
adds a entry of the current directory. If disableUpdating is set to true, it will care about clever updating
void |
[protected]
rebuild geometry managment.
void |
[protected]
Makes a new directory in current directory after asking user for a name
void |
[protected]
takes action on the new location. If it's a directory, change into it, if it's a file, correct the name, etc.
Parameters:
takeFiles | if set to true, if will close the dialog, if txt is a file name |
void |
[protected]
this functions must be called by the constructor of a derived class.
void |
[protected virtual slot]
You should override this method if you change the user interface of this dialog in a subclass in order to invoke your updated user help.
void |
[protected slot]
Add the current location to the global bookmarks list