Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkFileChooser Class Reference

Convenience Widget showing a line edit with the path of a file or directory and a button which invokes a file choose dialog. More...

#include <QmitkFileChooser.h>

Inheritance diagram for QmitkFileChooser:
Collaboration diagram for QmitkFileChooser:

Signals

void NewFileSelected (const std::string &)
 

Public Member Functions

 QmitkFileChooser (QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
 
void SetHorizotalLayout (bool horizontalLayout)
 
void SetSelectDir (bool selectDir)
 
void SetFileMustExist (bool fileMustExist)
 
void SetFile (const std::string &file)
 
void SetFilePattern (const std::string &filepattern)
 
void SetReadOnly (bool ReadOnly)
 
bool IsValidFile () const
 
virtual std::string GetFile () const
 

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
 

Detailed Description

Convenience Widget showing a line edit with the path of a file or directory and a button which invokes a file choose dialog.

Various methods are given to influence the behaviour or presentation

Definition at line 28 of file QmitkFileChooser.h.

Constructor & Destructor Documentation

◆ QmitkFileChooser()

QmitkFileChooser::QmitkFileChooser ( QWidget *  parent = nullptr,
Qt::WindowFlags  f = nullptr 
)
explicit

standard ctor, init values to defaults (see methods for values)

Member Function Documentation

◆ GetFile()

virtual std::string QmitkFileChooser::GetFile ( ) const
virtual

returns the currently set file (an absolute path)

◆ IsValidFile()

bool QmitkFileChooser::IsValidFile ( ) const

returns whether the selected file/directory exists

◆ NewFileSelected

void QmitkFileChooser::NewFileSelected ( const std::string &  )
signal

emitted when the input changed programatically or by the user

◆ OnFileEditingFinished

virtual void QmitkFileChooser::OnFileEditingFinished ( )
protectedvirtualslot

check for valid here

◆ OnSelectFileClicked

virtual void QmitkFileChooser::OnSelectFileClicked ( bool  )
protectedvirtualslot

show dialog here

◆ SetFile()

void QmitkFileChooser::SetFile ( const std::string &  file)

sets the file input, default=""

◆ SetFileMustExist()

void QmitkFileChooser::SetFileMustExist ( bool  fileMustExist)

determines whether the file/directory mustexist default=true

◆ SetFilePattern()

void QmitkFileChooser::SetFilePattern ( const std::string &  filepattern)

sets a file pattern to be selected, default=""

◆ SetHorizotalLayout()

void QmitkFileChooser::SetHorizotalLayout ( bool  horizontalLayout)

determines whether the button "Select file" is shown on the left underneath the line edit, default=false (=is shown in a vertical layout)

◆ SetReadOnly()

void QmitkFileChooser::SetReadOnly ( bool  ReadOnly)

sets whether the user can edit the input, default=false

◆ SetSelectDir()

void QmitkFileChooser::SetSelectDir ( bool  selectDir)

determines whether the selection must be a directory default=false

Member Data Documentation

◆ m_File

QLineEdit* QmitkFileChooser::m_File
protected

the line edit to show the current file

Definition at line 111 of file QmitkFileChooser.h.

◆ m_FileMustExist

bool QmitkFileChooser::m_FileMustExist
protected
See also
SetFileMustExist()

Definition at line 98 of file QmitkFileChooser.h.

◆ m_FilePattern

QString QmitkFileChooser::m_FilePattern
protected
See also
SetFilePattern()

Definition at line 103 of file QmitkFileChooser.h.

◆ m_SelectDir

bool QmitkFileChooser::m_SelectDir
protected
See also
SetSelectDir()

Definition at line 94 of file QmitkFileChooser.h.

◆ m_SelectFile

QPushButton* QmitkFileChooser::m_SelectFile
protected

the select file button

Definition at line 107 of file QmitkFileChooser.h.


The documentation for this class was generated from the following file: