
Public Member Functions | |
| DumpStudyFileDlg (QWidget *parent) | |
| bool | isOpenDlg () const |
| Check if the dialog box is used for opening or saving the file. | |
| bool | checkPermissions () const |
| Get 'check file permissions' flag. | |
| void | setCheckPermissions (const bool) |
| Set 'check file permissions' flag. | |
| SUIT_FileValidator * | validator () const |
| Get file validator. | |
| void | setValidator (SUIT_FileValidator *) |
| Set file validator. | |
| bool | addWidgets (QWidget *, QWidget *, QWidget *) |
| Adds the specified widgets to the bottom of the file dialog. | |
| QStringList | selectedFiles () const |
| Get list of selected files. | |
| QString | selectedFile () const |
| Get selected file. | |
| void | selectFile (const QString &) |
| Selects current file. | |
Static Public Member Functions | |
| static QString | getLastVisitedDirectory () |
| Get last visited directory. | |
| static QString | getFileName (QWidget *, const QString &, const QStringList &, const QString &=QString(), const bool=true, const bool=true, SUIT_FileValidator *=0) |
| Show dialog box for the file opening/saving. | |
| static QString | getFileName (QWidget *, const QString &, const QString &, const QString &=QString(), const bool=true, const bool=true, SUIT_FileValidator *=0) |
| Show dialog box for the file opening/saving.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This method can be used to select the file for opening or saving. The behavior is defined by the open parameter. Note, that selection validation depends on the dialog mode used. | |
| static QStringList | getOpenFileNames (QWidget *, const QString &, const QStringList &, const QString &=QString(), const bool=true, SUIT_FileValidator *=0) |
| Show dialog box for the multiple files selection. | |
| static QStringList | getOpenFileNames (QWidget *, const QString &, const QString &, const QString &=QString(), const bool=true, SUIT_FileValidator *=0) |
| Show dialog box for the multiple file opening.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. If initial parameter is not null string it is used as starting directory or file at which dialog box is opened. | |
| static QString | getExistingDirectory (QWidget *, const QString &, const QString &=QString(), const bool=true, SUIT_FileValidator *=0) |
| Show dialog box for the existing directory selection. | |
| static QString | getLastVisitedPath () |
| Get last visited path. | |
Data Fields | |
| QCheckBox * | myPublishChk |
| QCheckBox * | myMultiFileChk |
| QCheckBox * | mySaveGUIChk |
Protected Slots | |
| void | accept () |
| Called when the user presses "Open"or "Save" button. | |
| void | quickDir (const QString &) |
| Called when user selects directory from the "Quick Dir" combo box. | |
| void | addQuickDir () |
| Called when user presses "Quick Dir Add" button. | |
Protected Member Functions | |
| virtual bool | event (QEvent *) |
| Customize events processing. | |
| QLineEdit * | lineEdit () const |
| Get line edit which is used to enter file name. | |
| virtual bool | acceptData () |
| Validate user selection. | |
| QString | addExtension (const QString &) const |
| Add an extension to the specified file name. | |
| bool | processPath (const QString &) |
| Processes selection : tries to set specified sirectory or filename as current file dialog selection. | |
| void | addFilter (const QString &) |
| Add file filter and activates it. | |
Static Protected Member Functions | |
| static bool | hasWildCards (const QString &) |
| Check if the string contains wildcard symbols. | |
Private class used in Dump Study operation. Consists 2 check boxes: "Publish in study" and "Save GUI parameters"
| DumpStudyFileDlg.DumpStudyFileDlg | ( | QWidget * | parent | ) |
References myMultiFileChk, myPublishChk, and mySaveGUIChk.
| bool SUIT_FileDlg::isOpenDlg | ( | ) | const [inherited] |
true if dialog is used for file opening and false otherwise | bool SUIT_FileDlg::checkPermissions | ( | ) | const [inherited] |
| void SUIT_FileDlg::setCheckPermissions | ( | const bool | checkPerm | ) | [inherited] |
If this flag is set and file validator is not null, the validator will check the file permissions also.
| checkPerm | new flag value |
References SUIT_FileDlg.myCheckPermissions.
| SUIT_FileValidator * SUIT_FileDlg::validator | ( | ) | const [inherited] |
| void SUIT_FileDlg::setValidator | ( | SUIT_FileValidator * | v | ) | [inherited] |
Destroys previous validator if the dialog owns it.
| v | new file validator |
References SUIT_FileDlg.myValidator, and SUIT_FileValidator.parent().
The first widget (usually label) l is placed underneath the "file name" and the "file types" labels. The widget w is placed underneath the file types combobox. The last widget (usually button) b is placed underneath the Cancel push button.
In general, the widgets can be arbitrary. This method is added to support the functionality provided by the Qt series 3.x.
If you don't want to have one of the widgets added, pass 0 in that widget's position. Every time this function is called, a new row of widgets is added to the bottom of the file dialog.
| l | first widget (e.g. text label) |
| w | second widget (e.g. combo box) |
| b | third widget (e.g. push button) |
true if widgets have been added successfully | QStringList SUIT_FileDlg::selectedFiles | ( | ) | const [inherited] |
References SUIT_FileDlg.addExtension().
| QString SUIT_FileDlg::selectedFile | ( | ) | const [inherited] |
References SUIT_FileDlg.selectedFiles().
| void SUIT_FileDlg::selectFile | ( | const QString & | f | ) | [inherited] |
This version of selectFile() methods works similar to Qt version 3.x: it selects the given file as current and it changes the current file dialog's directory to the directory of the file
| f | - new current file name |
References Qtx.dir().
| QString SUIT_FileDlg::getLastVisitedDirectory | ( | ) | [static, inherited] |
Note, that last visited path is memorized only if the dialog box is accepted.
References SUIT_FileDlg.myLastVisitedPath.
| QString SUIT_FileDlg::getFileName | ( | QWidget * | parent, |
| const QString & | initial, | ||
| const QStringList & | filters, | ||
| const QString & | caption = QString(), |
||
| const bool | open = true, |
||
| const bool | showQuickDir = true, |
||
| SUIT_FileValidator * | validator = 0 |
||
| ) | [static, inherited] |
This method can be used to select the file for opening or saving. The behavior is defined by the open parameter. Note, that selection validation depends on the dialog mode used.
If initial parameter is not null string it is used as starting directory or file at which dialog box is opened.
The parameter filters defines file filters (wildcards) to be used. If filters list is empty, "All files (*)" is used by default.
The parameter caption is used as dialog box title. If it is is empty, the default title is used.
The parameter showQuickDir specifies if it is necessary to show additional quick directories list controls in the bottom part of the dialog box.
The validation of the user selection is done with help of the file validator (SUIT_FileValidator class). The last parameter validator can be used to pass the custom file validator to the dialog box.
| parent | parent widget |
| initial | initial file (or directory) dialog box to be opened on |
| filters | file filters list |
| caption | dialog box title |
| open | if true dialog box is used for file opening, otherwise - for saving |
| showQuickDir | if true the quick directory list widgets will be shown |
| validator | custom file validator |
References SUIT_FileDlg.processPath(), SUIT_FileDlg.selectedFile(), and SUIT_FileDlg.setValidator().
| QString SUIT_FileDlg::getFileName | ( | QWidget * | parent, |
| const QString & | initial, | ||
| const QString & | filters, | ||
| const QString & | caption = QString(), |
||
| const bool | open = true, |
||
| const bool | showQuickDir = true, |
||
| SUIT_FileValidator * | validator = 0 |
||
| ) | [static, inherited] |
If initial parameter is not null string it is used as starting directory or file at which dialog box is opened.
The parameter filters defines file filters (wildcards) to be used. This is the list of wildcards, separated by the ";;" symbols. If filters list is empty, "All files (*)" is used by default.
The parameter caption is used as dialog box title. If it is is empty, the default title is used.
The parameter showQuickDir specifies if it is necessary to show additional quick directories list controls in the bottom part of the dialog box.
The validation of the user selection is done with help of the file validator (SUIT_FileValidator class). The last parameter validator can be used to pass the custom file validator to the dialog box.
| parent | parent widget |
| initial | initial file (or directory) dialog box to be opened on |
| filters | file filters separated by ";;" |
| caption | dialog box title |
| open | if true dialog box is used for file opening, otherwise - for saving |
| showQuickDir | if true the quick directory list widgets will be shown |
| validator | custom file validator |
References SUIT_FileDlg.getFileName(), and SUIT_FileDlg.validator().
| QStringList SUIT_FileDlg::getOpenFileNames | ( | QWidget * | parent, |
| const QString & | initial, | ||
| const QStringList & | filters, | ||
| const QString & | caption = QString(), |
||
| const bool | showQuickDir = true, |
||
| SUIT_FileValidator * | validator = 0 |
||
| ) | [static, inherited] |
If initial parameter is not null string it is used as starting directory or file at which dialog box is opened.
The parameter filters defines file filters (wildcards) to be used. If filters list is empty, "All files (*)" is used by default.
The parameter caption is used as dialog box title. If it is is empty, the default title is used.
The parameter showQuickDir specifies if it is necessary to show additional quick directories list controls in the bottom part of the dialog box.
The validation of the user selection is done with help of the file validator (SUIT_FileValidator class). The last parameter validator can be used to pass the custom file validator to the dialog box.
| parent | parent widget |
| initial | initial file (or directory) dialog box to be opened on |
| filters | file filters list |
| caption | dialog box title |
| showQuickDir | if true the quick directory list widgets will be shown |
| validator | custom file validator |
References SUIT_FileDlg.processPath(), SUIT_FileDlg.selectedFiles(), and SUIT_FileDlg.setValidator().
| QStringList SUIT_FileDlg::getOpenFileNames | ( | QWidget * | parent, |
| const QString & | initial, | ||
| const QString & | filters, | ||
| const QString & | caption = QString(), |
||
| const bool | showQuickDir = true, |
||
| SUIT_FileValidator * | validator = 0 |
||
| ) | [static, inherited] |
The parameter filters defines file filters (wildcards) to be used. This is the list of wildcards, separated by the ";;" symbols. If filters list is empty, "All files (*)" is used by default.
The parameter caption is used as dialog box title. If it is is empty, the default title is used.
The parameter showQuickDir specifies if it is necessary to show additional quick directories list controls in the bottom part of the dialog box.
The validation of the user selection is done with help of the file validator (SUIT_FileValidator class). The last parameter validator can be used to pass the custom file validator to the dialog box.
| parent | parent widget |
| initial | initial file (or directory) dialog box to be opened on |
| filters | file filters separated by ";;" |
| caption | dialog box title |
| showQuickDir | if true the quick directory list widgets will be shown |
| validator | custom file validator |
References SUIT_FileDlg.getOpenFileNames(), and SUIT_FileDlg.validator().
| QString SUIT_FileDlg::getExistingDirectory | ( | QWidget * | parent, |
| const QString & | initial, | ||
| const QString & | caption = QString(), |
||
| const bool | showQuickDir = true, |
||
| SUIT_FileValidator * | validator = 0 |
||
| ) | [static, inherited] |
If initial parameter is not null string it is used as starting directory at which dialog box is opened.
The parameter caption is used as dialog box title. If it is is empty, the default title is used.
The parameter showQuickDir specifies if it is necessary to show additional quick directories list controls in the bottom part of the dialog box.
The validation of the user selection is done with help of the file validator (SUIT_FileValidator class). The last parameter validator can be used to pass the custom file validator to the dialog box.
| parent | parent widget |
| initial | initial directory dialog box to be opened on |
| caption | dialog box title |
| showQuickDir | if true the quick directory list widgets will be shown |
| validator | custom file validator |
References SUIT_FileDlg.processPath(), SUIT_FileDlg.selectedFile(), and SUIT_FileDlg.setValidator().
| QString SUIT_FileDlg::getLastVisitedPath | ( | ) | [static, inherited] |
References SUIT_FileDlg.myLastVisitedPath.
| bool SUIT_FileDlg::event | ( | QEvent * | e | ) | [protected, virtual, inherited] |
| e | event |
true if the event e was recognized and processed References SUIT_FileDlg.polish().
| QLineEdit * SUIT_FileDlg::lineEdit | ( | ) | const [protected, inherited] |
| bool SUIT_FileDlg::acceptData | ( | ) | [protected, virtual, inherited] |
The validation is done by calling the corresponding methods of the validator. If the validator is not set, this method always returns true.
This method can be re-implemented in the subclasses to customize the file dialog behavior. Another solution could be implementing own file validator class.
true if user selection (file(s) or directory) is valid References SUIT_FileDlg.addFilter(), SUIT_FileValidator.canOpen(), SUIT_FileValidator.canReadDir(), SUIT_FileValidator.canSave(), SUIT_FileValidator.canWriteDir(), SUIT_FileDlg.checkPermissions(), SUIT_FileDlg.hasWildCards(), SUIT_FileDlg.isOpenDlg(), SUIT_FileDlg.lineEdit(), SUIT_FileDlg.selectedFiles(), and SUIT_FileDlg.validator().
| QString SUIT_FileDlg::addExtension | ( | const QString & | fileName | ) | const [protected, inherited] |
The extension is extracted from the active filter.
| fileName | file name to be processed |
References Qtx.extension(), and IGNORE_NON_MATCHING_EXTENSION.
| bool SUIT_FileDlg::processPath | ( | const QString & | path | ) | [protected, inherited] |
| path | file or directory path |
true if path is processed correctly and false otherwise References Qtx.dir(), Qtx.file(), and SUIT_FileDlg.selectFile().
| void SUIT_FileDlg::addFilter | ( | const QString & | filter | ) | [protected, inherited] |
| filter | new file filter |
| bool SUIT_FileDlg::hasWildCards | ( | const QString & | s | ) | [static, protected, inherited] |
| s | string to be checked (for example, file name) |
true if string contains "*" or "?" symbols | void SUIT_FileDlg::accept | ( | ) | [protected, slot, inherited] |
Verifies the user choice and closes dialog box, setting the return code to QDialog.Accepted
References SUIT_FileDlg.acceptData(), and SUIT_FileDlg.myLastVisitedPath.
| void SUIT_FileDlg::quickDir | ( | const QString & | dirPath | ) | [protected, slot, inherited] |
Browses the file dialog to the specified directory (if it is valid).
| dirPath | selected directory |
References SUIT_MessageBox.critical(), and SUIT_FileDlg.processPath().
| void SUIT_FileDlg::addQuickDir | ( | ) | [protected, slot, inherited] |
Adds current directory to the quick directories list and to the preferences.
References SUIT_FileDlg.myQuickCombo, SUIT_FileDlg.myUrls, SUIT_Session.resourceMgr(), SUIT_Session.session(), QtxResourceMgr.setValue(), and QtxResourceMgr.stringValue().
| QCheckBox* DumpStudyFileDlg.myPublishChk |
| QCheckBox* DumpStudyFileDlg.myMultiFileChk |
| QCheckBox* DumpStudyFileDlg.mySaveGUIChk |