|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Convenience widget showing a line edit with a file/directory path and a browse button. More...
#include <QmitkFileChooser.h>


Signals | |
| void | NewFileSelected (const std::string &filePath) |
| Emitted when the file path changes, either programmatically or by the user. More... | |
Public Member Functions | |
| QmitkFileChooser (QWidget *parent=nullptr, Qt::WindowFlags f={}) | |
| Construct the file chooser with default settings. More... | |
| void | SetHorizotalLayout (bool horizontalLayout) |
| Set horizontal or vertical layout for the button and line edit. More... | |
| void | SetSelectDir (bool selectDir) |
| Set whether the chooser selects directories instead of files. More... | |
| void | SetFileMustExist (bool fileMustExist) |
| Set whether the selected file or directory must already exist. More... | |
| void | SetFile (const std::string &file) |
| Programmatically set the file path. More... | |
| void | SetFilePattern (const std::string &filepattern) |
| Set the file filter pattern for the file dialog. More... | |
| void | SetReadOnly (bool ReadOnly) |
| Set whether the line edit is read-only. More... | |
| bool | IsValidFile () const |
| Check whether the currently entered file/directory exists. More... | |
| virtual std::string | GetFile () const |
| Get the currently displayed file path. More... | |
Protected Slots | |
| virtual void | OnSelectFileClicked (bool) |
| virtual void | OnFileEditingFinished () |
Protected Attributes | |
| bool | m_SelectDir |
| bool | m_FileMustExist |
| QString | m_FilePattern |
| QPushButton * | m_SelectFile |
| QLineEdit * | m_File |
Convenience widget showing a line edit with a file/directory path and a browse button.
Provides a line edit displaying the current path and a "Select File" button that opens a QFileDialog. Various options control whether files or directories are selected, whether they must exist, and whether the line edit is editable.
Definition at line 29 of file QmitkFileChooser.h.
|
explicit |
Construct the file chooser with default settings.
Defaults: vertical layout, file mode (not directory), file must exist, read-only line edit.
| [in] | parent | The parent widget. |
| [in] | f | Window flags. |
|
virtual |
Get the currently displayed file path.
| bool QmitkFileChooser::IsValidFile | ( | ) | const |
Check whether the currently entered file/directory exists.
|
signal |
Emitted when the file path changes, either programmatically or by the user.
| [in] | filePath | The new file path. |
|
protectedvirtualslot |
check for valid here
|
protectedvirtualslot |
show dialog here
| void QmitkFileChooser::SetFile | ( | const std::string & | file | ) |
Programmatically set the file path.
| [in] | file | The file or directory path to set. |
If fileMustExist is true and the path does not exist, the path is not set.
| void QmitkFileChooser::SetFileMustExist | ( | bool | fileMustExist | ) |
Set whether the selected file or directory must already exist.
| [in] | fileMustExist | True (default) to require existence, false to allow new paths. |
| void QmitkFileChooser::SetFilePattern | ( | const std::string & | filepattern | ) |
Set the file filter pattern for the file dialog.
| [in] | filepattern | A Qt file filter string (e.g. "Images (*.png *.jpg)"). |
| void QmitkFileChooser::SetHorizotalLayout | ( | bool | horizontalLayout | ) |
Set horizontal or vertical layout for the button and line edit.
| [in] | horizontalLayout | If true, button is placed to the right of the line edit. If false (default), button is below. |
| void QmitkFileChooser::SetReadOnly | ( | bool | ReadOnly | ) |
Set whether the line edit is read-only.
| [in] | ReadOnly | True to make read-only (default), false to allow manual editing. |
| void QmitkFileChooser::SetSelectDir | ( | bool | selectDir | ) |
Set whether the chooser selects directories instead of files.
| [in] | selectDir | True for directory selection, false (default) for file selection. |
|
protected |
the line edit to show the current file
Definition at line 133 of file QmitkFileChooser.h.
|
protected |
Definition at line 120 of file QmitkFileChooser.h.
|
protected |
Definition at line 125 of file QmitkFileChooser.h.
|
protected |
Definition at line 116 of file QmitkFileChooser.h.
|
protected |
the select file button
Definition at line 129 of file QmitkFileChooser.h.