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

A dialog for renaming parameters for a user function. More...

#include <RenameParDialog.h>

Inheritance diagram for MantidQt::MantidWidgets::RenameParDialog:

Public Member Functions

 RenameParDialog (std::vector< std::string > old_params, const std::vector< std::string > &new_params, QWidget *parent=nullptr)
 there has to be a default constructor but you can call it with a pointer to the thing that will take ownership of it More...
 
std::vector< std::string > setOutput () const
 Output the new names to a vector. More...
 

Protected Slots

void doNotRename (bool)
 Do not rename the parameters. More...
 
void uniqueIndexedNames (bool)
 

Protected Member Functions

bool isUnique (const QString &name) const
 Checks whether a name is unique. More...
 
QString makeUniqueIndexedName (const QString &name)
 Adds a suffix to the unput parameter name in the form: _n where n is a number. More...
 

Protected Attributes

const std::vector< std::string > m_new_params
 
const std::vector< std::string > m_old_params
 
Ui::RenameParDialog m_uiForm
 User interface elements. More...
 

Detailed Description

A dialog for renaming parameters for a user function.

Definition at line 20 of file RenameParDialog.h.

Constructor & Destructor Documentation

◆ RenameParDialog()

RenameParDialog::RenameParDialog ( std::vector< std::string >  old_params,
const std::vector< std::string > &  new_params,
QWidget *  parent = nullptr 
)

there has to be a default constructor but you can call it with a pointer to the thing that will take ownership of it

Constructor.

Parameters
old_paramsParameter names to rename
new_paramsRenamed parameters
parentThe parent widget for the dialog

Definition at line 20 of file RenameParDialog.cpp.

References doNotRename(), m_uiForm, and uniqueIndexedNames().

Member Function Documentation

◆ doNotRename

void RenameParDialog::doNotRename ( bool  ok)
protectedslot

Do not rename the parameters.

Definition at line 115 of file RenameParDialog.cpp.

References m_uiForm.

Referenced by RenameParDialog().

◆ isUnique()

bool RenameParDialog::isUnique ( const QString &  name) const
protected

Checks whether a name is unique.

The name is compared to the names in m_old_names and in column #1 of the table widget

Definition at line 42 of file RenameParDialog.cpp.

References m_old_params, and m_uiForm.

Referenced by makeUniqueIndexedName().

◆ makeUniqueIndexedName()

QString RenameParDialog::makeUniqueIndexedName ( const QString &  name)
protected

Adds a suffix to the unput parameter name in the form: _n where n is a number.

The method ensures that the new name is unique

Parameters
name:: The name to rename

Definition at line 61 of file RenameParDialog.cpp.

References index, isUnique(), and n.

Referenced by uniqueIndexedNames().

◆ setOutput()

std::vector< std::string > RenameParDialog::setOutput ( ) const

Output the new names to a vector.

Returns
:: new names in a vector

Definition at line 93 of file RenameParDialog.cpp.

References m_uiForm.

Referenced by MantidQt::MantidWidgets::UserFunctionDialog::checkParameters().

◆ uniqueIndexedNames

void RenameParDialog::uniqueIndexedNames ( bool  ok)
protectedslot

Definition at line 102 of file RenameParDialog.cpp.

References m_uiForm, and makeUniqueIndexedName().

Referenced by RenameParDialog().

Member Data Documentation

◆ m_new_params

const std::vector<std::string> MantidQt::MantidWidgets::RenameParDialog::m_new_params
protected

Definition at line 39 of file RenameParDialog.h.

◆ m_old_params

const std::vector<std::string> MantidQt::MantidWidgets::RenameParDialog::m_old_params
protected

Definition at line 38 of file RenameParDialog.h.

Referenced by isUnique().

◆ m_uiForm

Ui::RenameParDialog MantidQt::MantidWidgets::RenameParDialog::m_uiForm
protected

User interface elements.

Definition at line 37 of file RenameParDialog.h.

Referenced by doNotRename(), isUnique(), RenameParDialog(), setOutput(), and uniqueIndexedNames().


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