Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Slots | Private Member Functions | List of all members
MantidQt::MantidWidgets::SelectFunctionDialog Class Reference

Select a function type out of a list of available ones. More...

#include <SelectFunctionDialog.h>

Inheritance diagram for MantidQt::MantidWidgets::SelectFunctionDialog:
MantidQt::API::MantidDialog

Public Member Functions

void clearSearchBoxText () const
 Clear the text in the search box. More...
 
QString getFunction () const
 Return selected function. More...
 
 SelectFunctionDialog (QWidget *parent, const std::vector< std::string > &restrictions)
 Constructor overload with categories to restrict to. More...
 
 SelectFunctionDialog (QWidget *parent=nullptr)
 Default constructor. More...
 
 ~SelectFunctionDialog () override
 
- Public Member Functions inherited from MantidQt::API::MantidDialog
 MantidDialog (QWidget *parent=nullptr, const Qt::WindowFlags &flags=Qt::WindowCloseButtonHint|Qt::WindowType::WindowTitleHint)
 DefaultConstructor. More...
 
 ~MantidDialog () override
 Destructor. More...
 

Protected Attributes

Ui::SelectFunctionDialog * m_form
 Ui elements form. More...
 

Private Slots

void acceptFunction ()
 
void functionDoubleClicked (QTreeWidgetItem *item)
 
void helpClicked () const
 
void rejectFunction ()
 
void searchBoxChanged (const QString &text)
 Called when the text in the search box changes. More...
 

Private Member Functions

void constructFunctionTree (const std::map< std::string, std::vector< std::string > > &categoryFunctionsMap, const std::vector< std::string > &restrictions)
 Construct QTreeWidget with categories and functions. More...
 
void setMinimumHeightOfFunctionTree ()
 Sets the minimum height of the function tree so that all catagories are visible. More...
 

Additional Inherited Members

- Signals inherited from MantidQt::API::MantidDialog
void runAsPythonScript (const QString &code, bool)
 
- Static Public Member Functions inherited from MantidQt::API::MantidDialog
static bool handle (QObject *receiver, const std::exception &e)
 Handles the exception caught in an event handler. More...
 
- Protected Member Functions inherited from MantidQt::API::MantidDialog
virtual void handleException (const std::exception &e)
 Override this method to handle an exception in a derived class. More...
 
QString runPythonCode (const QString &code, bool no_output=false)
 Run python code that is passed to it and, optionally, return anything it wrote to standard output as a string. More...
 

Detailed Description

Select a function type out of a list of available ones.

Definition at line 29 of file SelectFunctionDialog.h.

Constructor & Destructor Documentation

◆ SelectFunctionDialog() [1/2]

MantidQt::MantidWidgets::SelectFunctionDialog::SelectFunctionDialog ( QWidget *  parent = nullptr)

Default constructor.

Constructor.

Parameters
parent:: A parent widget

Definition at line 37 of file SelectFunctionDialog.cpp.

◆ SelectFunctionDialog() [2/2]

MantidQt::MantidWidgets::SelectFunctionDialog::SelectFunctionDialog ( QWidget *  parent,
const std::vector< std::string > &  restrictions 
)

Constructor overload with categories to restrict to.

Constructor with categories to restrict to.

Parameters
parent:: A parent widget
restrictions:: List of categories to restrict to

Definition at line 45 of file SelectFunctionDialog.cpp.

References acceptFunction(), constructFunctionTree(), functionDoubleClicked(), helpClicked(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_form, rejectFunction(), searchBoxChanged(), and setMinimumHeightOfFunctionTree().

◆ ~SelectFunctionDialog()

MantidQt::MantidWidgets::SelectFunctionDialog::~SelectFunctionDialog ( )
override

Definition at line 170 of file SelectFunctionDialog.cpp.

References m_form.

Member Function Documentation

◆ acceptFunction

void MantidQt::MantidWidgets::SelectFunctionDialog::acceptFunction ( )
privateslot

Definition at line 220 of file SelectFunctionDialog.cpp.

References getFunction(), and m_form.

Referenced by functionDoubleClicked(), and SelectFunctionDialog().

◆ clearSearchBoxText()

void MantidQt::MantidWidgets::SelectFunctionDialog::clearSearchBoxText ( ) const

Clear the text in the search box.

Definition at line 199 of file SelectFunctionDialog.cpp.

References m_form.

Referenced by MantidQt::MantidWidgets::FunctionTreeView::addFunctionBegin().

◆ constructFunctionTree()

void MantidQt::MantidWidgets::SelectFunctionDialog::constructFunctionTree ( const std::map< std::string, std::vector< std::string > > &  categoryFunctionsMap,
const std::vector< std::string > &  restrictions 
)
private

Construct QTreeWidget with categories and functions.

Construct the QTreeWidget based on the map information of categories and their respective fit functions.

Parameters
categoryFunctionsMap:: [input] Map of categories to functions
restrictions:: [input] List of categories to restrict choice to. If empty, no restriction.

Definition at line 97 of file SelectFunctionDialog.cpp.

References m_form.

Referenced by SelectFunctionDialog().

◆ functionDoubleClicked

void MantidQt::MantidWidgets::SelectFunctionDialog::functionDoubleClicked ( QTreeWidgetItem *  item)
privateslot

Definition at line 215 of file SelectFunctionDialog.cpp.

References acceptFunction().

Referenced by SelectFunctionDialog().

◆ getFunction()

QString MantidQt::MantidWidgets::SelectFunctionDialog::getFunction ( ) const

◆ helpClicked

void MantidQt::MantidWidgets::SelectFunctionDialog::helpClicked ( ) const
privateslot

◆ rejectFunction

void MantidQt::MantidWidgets::SelectFunctionDialog::rejectFunction ( )
privateslot

Definition at line 231 of file SelectFunctionDialog.cpp.

References m_form.

Referenced by SelectFunctionDialog().

◆ searchBoxChanged

void MantidQt::MantidWidgets::SelectFunctionDialog::searchBoxChanged ( const QString &  text)
privateslot

Called when the text in the search box changes.

Definition at line 204 of file SelectFunctionDialog.cpp.

References index, and m_form.

Referenced by SelectFunctionDialog().

◆ setMinimumHeightOfFunctionTree()

void MantidQt::MantidWidgets::SelectFunctionDialog::setMinimumHeightOfFunctionTree ( )
private

Sets the minimum height of the function tree so that all catagories are visible.

Sets the minimum height of the function tree to ensure that all catagories are visible when the dialog is opened.

This method ensures the correct minimum size is used for any screen resolution.

Definition at line 176 of file SelectFunctionDialog.cpp.

References m_form.

Referenced by SelectFunctionDialog().

Member Data Documentation

◆ m_form

Ui::SelectFunctionDialog* MantidQt::MantidWidgets::SelectFunctionDialog::m_form
protected

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