te::qt::widgets::FileDialog Class Reference

Defines a component for choose a file. More...

#include <FileDialog.h>

Public Types

enum  FileType { RASTER, VECTOR }
 

Public Member Functions

void exec ()
 This method will open the dialog of file selection and populate the class members with the chosen file path. More...
 
 FileDialog (QWidget *parent, FileType type, std::string pathInfo="")
 Constructor. More...
 
std::string getExtension ()
 This method will return the file extension. More...
 
std::string getFileName ()
 This method will return the file name. More...
 
std::map< QString, QString > getMappedExtensions (QString extensions)
 Genarate an extensions map with the extensions returned by driver. More...
 
std::string getPath ()
 This method will return the chosen path. More...
 
bool hasInvalidCharacters (std::string filename)
 Verify if the file name has special characters. More...
 
void setExtension (std::string filePath)
 Sets the file extension. More...
 
void setFileName (std::string filePath)
 Sets the file name. More...
 
void setPath (std::string filePath)
 Sets the file path. More...
 
 ~FileDialog ()
 Destructor. More...
 

Private Attributes

std::string m_extension
 The extension of the file. More...
 
std::string m_fileInfo
 The file path info. More...
 
std::string m_fileName
 The name of the file. More...
 
QWidget * m_parent
 The QWidget parent argumnt. More...
 
std::string m_path
 The path of the file. More...
 
FileType m_type
 The type of file. More...
 

Detailed Description

Defines a component for choose a file.

This class is used to create a QFileDialog in order to facilitate the use of file path, file name and file extension.

Definition at line 52 of file FileDialog.h.

Member Enumeration Documentation

Enumerator
RASTER 
VECTOR 

Definition at line 56 of file FileDialog.h.

Constructor & Destructor Documentation

te::qt::widgets::FileDialog::FileDialog ( QWidget *  parent,
FileType  type,
std::string  pathInfo = "" 
)

Constructor.

Parameters
parentThe QWidget parent argumnt.
te::qt::widgets::FileDialog::~FileDialog ( )
inline

Destructor.

Definition at line 71 of file FileDialog.h.

Member Function Documentation

void te::qt::widgets::FileDialog::exec ( )

This method will open the dialog of file selection and populate the class members with the chosen file path.

std::string te::qt::widgets::FileDialog::getExtension ( )

This method will return the file extension.

Returns
The complete chosen file extension.
std::string te::qt::widgets::FileDialog::getFileName ( )

This method will return the file name.

Returns
The complete chosen file name.
std::map<QString, QString> te::qt::widgets::FileDialog::getMappedExtensions ( QString  extensions)

Genarate an extensions map with the extensions returned by driver.

Parameters
Theextensions returned by driver.
std::string te::qt::widgets::FileDialog::getPath ( )

This method will return the chosen path.

Returns
The complete chosen path.
bool te::qt::widgets::FileDialog::hasInvalidCharacters ( std::string  filename)

Verify if the file name has special characters.

Parameters
Thename of the file.
void te::qt::widgets::FileDialog::setExtension ( std::string  filePath)

Sets the file extension.

Parameters
Thefile path with a file and an extension.
void te::qt::widgets::FileDialog::setFileName ( std::string  filePath)

Sets the file name.

Parameters
Thefile path with a file name.
void te::qt::widgets::FileDialog::setPath ( std::string  filePath)

Sets the file path.

Parameters
Thefile path.

Member Data Documentation

std::string te::qt::widgets::FileDialog::m_extension
private

The extension of the file.

Definition at line 134 of file FileDialog.h.

std::string te::qt::widgets::FileDialog::m_fileInfo
private

The file path info.

Definition at line 131 of file FileDialog.h.

std::string te::qt::widgets::FileDialog::m_fileName
private

The name of the file.

Definition at line 133 of file FileDialog.h.

QWidget* te::qt::widgets::FileDialog::m_parent
private

The QWidget parent argumnt.

Definition at line 129 of file FileDialog.h.

std::string te::qt::widgets::FileDialog::m_path
private

The path of the file.

Definition at line 132 of file FileDialog.h.

FileType te::qt::widgets::FileDialog::m_type
private

The type of file.

Definition at line 130 of file FileDialog.h.


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