OpenMS  2.8.0
Public Slots | Signals | Public Member Functions | Protected Attributes | Private Attributes | List of all members
InputFile Class Reference

A simple widget with a line-edit and a browse button to choose filenames. More...

#include <OpenMS/VISUAL/InputFile.h>

Inheritance diagram for InputFile:
[legend]
Collaboration diagram for InputFile:
[legend]

Public Slots

void showFileDialog ()
 Lets the user select the file via a file dialog. More...
 

Signals

void updatedCWD (QString new_cwd)
 emitted when a new file is added (by drag'n'drop or 'Browse' button) More...
 
void updatedFile (QString new_path)
 emitted when a new file is added (by drag'n'drop or 'Browse' button) More...
 

Public Member Functions

 InputFile (QWidget *parent)
 Constructor. More...
 
 ~InputFile ()
 Destructor. More...
 
void dragEnterEvent (QDragEnterEvent *e) override
 support drag'n'drop of files from OS window manager More...
 
void dropEvent (QDropEvent *e) override
 support drag'n'drop of files from OS window manager More...
 
void dragMoveEvent (QDragMoveEvent *pEvent) override
 
void setFilename (const QString &filename)
 Sets the text in the line-edit. More...
 
QString getFilename () const
 Returns the filename currently set in the line-edit. More...
 
void setFileFormatFilter (const QString &fff)
 Users can only choose certain filetypes, e.g. "Transition sqLite file (*.pqp)". More...
 
const QString & getCWD () const
 get the CWD (according to most recently added file) More...
 
void setCWD (const QString &cwd, bool force=false)
 set the current working directory (for opening files). If the input is not empty, the cwd will not be altered, unless force is used More...
 

Protected Attributes

QString file_format_filter_
 optional filter during file browsing More...
 
QString cwd_
 the current working directory according to the last file added More...
 

Private Attributes

Ui::InputFileTemplate * ui_
 

Detailed Description

A simple widget with a line-edit and a browse button to choose filenames.

Constructor & Destructor Documentation

◆ InputFile()

InputFile ( QWidget parent)

Constructor.

◆ ~InputFile()

~InputFile ( )

Destructor.

Member Function Documentation

◆ dragEnterEvent()

void dragEnterEvent ( QDragEnterEvent *  e)
override

support drag'n'drop of files from OS window manager

◆ dragMoveEvent()

void dragMoveEvent ( QDragMoveEvent *  pEvent)
override

◆ dropEvent()

void dropEvent ( QDropEvent *  e)
override

support drag'n'drop of files from OS window manager

◆ getCWD()

const QString& getCWD ( ) const

get the CWD (according to most recently added file)

◆ getFilename()

QString getFilename ( ) const

Returns the filename currently set in the line-edit.

◆ setCWD()

void setCWD ( const QString &  cwd,
bool  force = false 
)

set the current working directory (for opening files). If the input is not empty, the cwd will not be altered, unless force is used

◆ setFileFormatFilter()

void setFileFormatFilter ( const QString &  fff)

Users can only choose certain filetypes, e.g. "Transition sqLite file (*.pqp)".

◆ setFilename()

void setFilename ( const QString &  filename)

Sets the text in the line-edit.

◆ showFileDialog

void showFileDialog ( )
slot

Lets the user select the file via a file dialog.

◆ updatedCWD

void updatedCWD ( QString  new_cwd)
signal

emitted when a new file is added (by drag'n'drop or 'Browse' button)

◆ updatedFile

void updatedFile ( QString  new_path)
signal

emitted when a new file is added (by drag'n'drop or 'Browse' button)

Member Data Documentation

◆ cwd_

QString cwd_
protected

the current working directory according to the last file added

◆ file_format_filter_

QString file_format_filter_
protected

optional filter during file browsing

◆ ui_

Ui::InputFileTemplate* ui_
private