Mantid
Loading...
Searching...
No Matches
Functions
MantidQt::API::FileDialogHandler Namespace Reference

Contains modifications to Qt functions where problems have been found on certain operating systems. More...

Functions

DLLExport QString addExtension (const QString &filename, const QString &selectedFilter)
 For file dialogs. More...
 
DLLExport QString formatExtension (const std::string &extension)
 Format extension into expected form (*.ext) More...
 
DLLExport QString getCaption (const std::string &dialogName, const Mantid::Kernel::Property *prop)
 
DLLExport QString getFilter (const Mantid::Kernel::Property *baseProp)
 
DLLExport QString getFilter (const std::vector< std::string > &exts)
 For file dialogs. More...
 
DLLExport QString getSaveFileName (QWidget *parent, const Mantid::Kernel::Property *baseProp, const QFileDialog::Options &options)
 Contains modifications to Qt functions where problems have been found on certain operating systems. More...
 

Detailed Description

Contains modifications to Qt functions where problems have been found on certain operating systems.

Function Documentation

◆ addExtension()

QString MantidQt::API::FileDialogHandler::addExtension ( const QString &  filename,
const QString &  selectedFilter 
)

For file dialogs.

This will add the selected extension if an extension doesn't already exist.

Definition at line 54 of file FileDialogHandler.cpp.

Referenced by getSaveFileName().

◆ formatExtension()

QString MantidQt::API::FileDialogHandler::formatExtension ( const std::string &  extension)

Format extension into expected form (*.ext)

Parameters
extension:: extension to be formatted
Returns
a QString of the expected form
Parameters
extension:: extension to be formatted
Returns
a QString of the expected form

Definition at line 127 of file FileDialogHandler.cpp.

Referenced by getFilter().

◆ getCaption()

QString MantidQt::API::FileDialogHandler::getCaption ( const std::string &  dialogName,
const Mantid::Kernel::Property prop 
)

◆ getFilter() [1/2]

QString MantidQt::API::FileDialogHandler::getFilter ( const Mantid::Kernel::Property baseProp)

◆ getFilter() [2/2]

QString MantidQt::API::FileDialogHandler::getFilter ( const std::vector< std::string > &  exts)

For file dialogs.

Parameters
exts:: vector of extensions
Returns
a string that filters files by extenstions

Have each filter on a separate line with Data Files as the first and All Files as the last

Parameters
exts:: vector of extensions
Returns
a string that filters files by extenstions

Definition at line 96 of file FileDialogHandler.cpp.

References formatExtension().

◆ getSaveFileName()

QString MantidQt::API::FileDialogHandler::getSaveFileName ( QWidget *  parent = nullptr,
const Mantid::Kernel::Property baseProp = nullptr,
const QFileDialog::Options &  options = QFileDialog::Options() 
)

Contains modifications to Qt functions where problems have been found on certain operating systems.

Parameters
parent:: the dialog will be shown centered over this parent widget
baseProp:: The property that the dialog parameters will be extracted from.
options:: The options argument holds various options about how to run the dialog

Definition at line 40 of file FileDialogHandler.cpp.

References addExtension(), getCaption(), getFilter(), and Mantid::Kernel::SingletonHolder< T >::Instance().

Referenced by MantidQt::API::FilePropertyWidget::openFileDialog().