#include <FileBrowser.h>
Signals | |
| void | filenameChanged (const QString &filename) |
Public Member Functions | |
| FileBrowser (QWidget *pParent=NULL) | |
| ~FileBrowser () | |
| void | setFilename (const QString &filename) |
| void | setFilename (const Filename &filename) |
| QString | getFilename () const |
| void | setBrowseCaption (const QString &caption) |
| QString | getBrowseCaption () const |
| void | setBrowseDirectory (const QString &directory) |
| QString | getBrowseDirectory () const |
| void | setBrowseFileFilters (const QString &filters) |
| QString | getBrowseFileFilters () const |
| void | setBrowseExistingFile (bool bExistingFile) |
| bool | isBrowseExistingFile () const |
Protected Slots | |
| void | browse () |
Protected Member Functions | |
| bool | eventFilter (QObject *pObject, QEvent *pEvent) |
The FileBrowser extends the QWidget class to provide a single QWidget capable of performing typical file-browsing tasks. This class associates an editable text-entry field with a button which brings up a file selection dialog by calling either the QFileDialog::getOpenFileName() method or the QFileDialog::getSaveFileName() method. Selecting a file through the file selection dialog will populate the text field.
Definition at line 29 of file FileBrowser.h.
| FileBrowser::FileBrowser | ( | QWidget * | pParent = NULL |
) |
| FileBrowser::~FileBrowser | ( | ) |
Destroys the widget and all child widget items.
| void FileBrowser::setFilename | ( | const QString & | filename | ) |
Sets the name of the file.
This method sets the name of the file to be displayed in the FileBrowser.
| filename | The name of the file. |
| void FileBrowser::setFilename | ( | const Filename & | filename | ) |
Sets the name of the file.
This method sets the name of the file to be displayed in the FileBrowser.
| filename | The name of the file. |
| QString FileBrowser::getFilename | ( | ) | const |
Gets the name of the file.
This method gets the name of the file displayed in the FileBrowser.
| void FileBrowser::setBrowseCaption | ( | const QString & | caption | ) |
Sets the browse caption.
This method sets the browse caption of the FileBrowser. For more information on browse captions, please refer to the QFileDialog::getOpenFileName documentation.
| caption | The browse caption. |
| QString FileBrowser::getBrowseCaption | ( | ) | const |
Gets the browse caption.
This method gets the browse caption of the FileBrowser. For more information on browse captions, please refer to the QFileDialog::getOpenFileName documentation.
| void FileBrowser::setBrowseDirectory | ( | const QString & | directory | ) |
Sets the browse directory.
This method sets the browse directory of the FileBrowser. For more information on browse directories, please refer to the QFileDialog::getOpenFileName documentation.
| directory | The browse directory. |
| QString FileBrowser::getBrowseDirectory | ( | ) | const |
Gets the browse directory.
This method gets the browse directory of the FileBrowser. For more information on browse directories, please refer to the QFileDialog::getOpenFileName documentation.
| void FileBrowser::setBrowseFileFilters | ( | const QString & | filters | ) |
Sets the browse file filters.
This method sets the browse file filters of the FileBrowser. For more information on browse file filters, please refer to the QFileDialog::getOpenFileName documentation.
| filters | The browse file filters. |
| QString FileBrowser::getBrowseFileFilters | ( | ) | const |
Gets the browse file filters.
This method gets the browse file filters of the FileBrowser. For more information on browse file filters, please refer to the QFileDialog::getOpenFileName documentation.
| void FileBrowser::setBrowseExistingFile | ( | bool | bExistingFile | ) |
Sets the file selection dialog to only browse for existing files.
By default if this method is not called, isBrowseExistingFile() returns true.
| bExistingFile | Set this value to true to browse only for existing files. Set the value to false to allow non-existent files to be selected. |
| bool FileBrowser::isBrowseExistingFile | ( | ) | const |
Queries whether the file selection dialog only browses for existing files.
true if the file selection dialog only browses for existing files. Returns false if non-existent files can be selected. Returns true by default if setBrowseExistingFile() has not been called on this instance of the file browser.| void FileBrowser::filenameChanged | ( | const QString & | filename | ) | [signal] |
This signal is emitted when the filename is changed.
| bool FileBrowser::eventFilter | ( | QObject * | pObject, | |
| QEvent * | pEvent | |||
| ) | [protected] |
Sends a focus out event if needed based on the current editing status.
| pObject | The object prompting the event. | |
| pEvent | The event invoked by the object. |
| void FileBrowser::browse | ( | ) | [protected, slot] |
Calls QFileDialog::getOpenFileName to allow the user to specify a file.
If no browse directory has been set, then the current file's directory will be used as the initial directory.