Medical Imaging Interaction Toolkit  2016.11.0
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 32 of file QmitkFileChooser.h.

Constructor & Destructor Documentation

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

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

Definition at line 26 of file QmitkFileChooser.cpp.

References m_File, m_SelectFile, OnFileEditingFinished(), OnSelectFileClicked(), and SetHorizotalLayout().

Member Function Documentation

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

returns the currently set file (an absolute path)

Definition at line 91 of file QmitkFileChooser.cpp.

References m_File.

bool QmitkFileChooser::IsValidFile ( ) const

returns whether the selected file/directory exists

Definition at line 85 of file QmitkFileChooser.cpp.

References info(), and m_File.

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

emitted when the input changed programatically or by the user

Referenced by OnFileEditingFinished(), OnSelectFileClicked(), and SetFile().

void QmitkFileChooser::OnFileEditingFinished ( )
protectedvirtualslot

check for valid here

Definition at line 115 of file QmitkFileChooser.cpp.

References m_File, and NewFileSelected().

Referenced by QmitkFileChooser().

void QmitkFileChooser::OnSelectFileClicked ( bool  )
protectedvirtualslot

show dialog here

Definition at line 96 of file QmitkFileChooser.cpp.

References filename, m_File, m_FileMustExist, m_FilePattern, m_SelectDir, and NewFileSelected().

Referenced by QmitkFileChooser().

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

sets the file input, default=""

Definition at line 70 of file QmitkFileChooser.cpp.

References info(), m_File, m_FileMustExist, and NewFileSelected().

void QmitkFileChooser::SetFileMustExist ( bool  fileMustExist)

determines whether the file/directory mustexist default=true

Definition at line 60 of file QmitkFileChooser.cpp.

References m_FileMustExist.

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

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

Definition at line 80 of file QmitkFileChooser.cpp.

References m_FilePattern.

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)

Definition at line 40 of file QmitkFileChooser.cpp.

References m_File, and m_SelectFile.

Referenced by QmitkFileChooser().

void QmitkFileChooser::SetReadOnly ( bool  ReadOnly)

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

Definition at line 65 of file QmitkFileChooser.cpp.

References m_File.

void QmitkFileChooser::SetSelectDir ( bool  selectDir)

determines whether the selection must be a directory default=false

Definition at line 55 of file QmitkFileChooser.cpp.

References m_SelectDir.

Member Data Documentation

QLineEdit* QmitkFileChooser::m_File
protected

the line edit to show the current file

Definition at line 115 of file QmitkFileChooser.h.

Referenced by GetFile(), IsValidFile(), OnFileEditingFinished(), OnSelectFileClicked(), QmitkFileChooser(), SetFile(), SetHorizotalLayout(), and SetReadOnly().

bool QmitkFileChooser::m_FileMustExist
protected
See also
SetFileMustExist()

Definition at line 102 of file QmitkFileChooser.h.

Referenced by OnSelectFileClicked(), SetFile(), and SetFileMustExist().

QString QmitkFileChooser::m_FilePattern
protected
See also
SetFilePattern()

Definition at line 107 of file QmitkFileChooser.h.

Referenced by OnSelectFileClicked(), and SetFilePattern().

bool QmitkFileChooser::m_SelectDir
protected
See also
SetSelectDir()

Definition at line 98 of file QmitkFileChooser.h.

Referenced by OnSelectFileClicked(), and SetSelectDir().

QPushButton* QmitkFileChooser::m_SelectFile
protected

the select file button

Definition at line 111 of file QmitkFileChooser.h.

Referenced by QmitkFileChooser(), and SetHorizotalLayout().


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