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

An editor widget for editing a local parameter value. More...

#include <LocalParameterEditor.h>

Inheritance diagram for MantidQt::MantidWidgets::LocalParameterEditor:

Signals

void fixParameter (int, bool)
 
void setAllFixed (bool)
 
void setAllValues (double)
 
void setAllValuesToLog ()
 
void setConstraint (int, QString)
 
void setConstraintAll (QString)
 
void setTie (int, QString)
 
void setTieAll (QString)
 
void setValueToLog (int)
 

Public Member Functions

 LocalParameterEditor (QWidget *parent, int index, double value, bool fixed, const QString &tie, const QString &constraint, bool othersFixed, bool allOthersFixed, bool othersTied, bool logOptionsEnabled)
 Constructor. More...
 

Private Slots

void fixAll ()
 Send a signal to fix all parameters. More...
 
void fixParameter ()
 Toggle the fix state of the current parameter. More...
 
void removeAllConstraints ()
 
void removeAllTies ()
 Remove ties from all parameters. More...
 
void removeConstraint ()
 
void removeTie ()
 Send a signal to remove a tie. More...
 
void setAll ()
 Send a signal to set all parameters to the value in the editor. More...
 
void setConstraint ()
 
void setConstraintAll ()
 
void setLogOptionsEnabled (bool enabled)
 Slot: when log checkbox state changes, enable/disable the "set to log" and "set all to log" options. More...
 
void setTie ()
 Send a signal to tie a parameter. More...
 
void setTieAll ()
 Set all ties for all parameters. More...
 
void setToLog ()
 Send a signal to set value to log. More...
 
void unfixAll ()
 Send a signal to unfix all parameters. More...
 
void updateValue (const QString &value)
 SLOT: when user edits value, make sure m_value is updated. More...
 

Private Member Functions

bool eventFilter (QObject *widget, QEvent *evn) override
 Filter events in the line editor to emulate a shortcut (F to fix/unfix). More...
 
void setEditorState ()
 Set the state of the editor elements (the line editor and the button) according to the state of the parameter (fixed, tied, etc) More...
 

Static Private Member Functions

static QString setConstraintDialog (const QString &tie)
 
static QString setTieDialog (const QString &tie)
 Open an input dialog to enter a tie expression. More...
 

Private Attributes

bool m_allOthersFixed
 
QPushButton * m_button
 
QString m_constraint
 
QLineEdit * m_editor
 
QAction * m_fixAction
 
QAction * m_fixAllAction
 
bool m_fixed
 
int m_index
 
bool m_othersConstrained
 
bool m_othersFixed
 
bool m_othersTied
 
QAction * m_removeAllConstraintsAction
 
QAction * m_removeAllTiesAction
 
QAction * m_removeConstraintAction
 
QAction * m_removeTieAction
 
QAction * m_setAllAction
 
QAction * m_setAllToLogAction
 
QAction * m_setConstraintAction
 
QAction * m_setConstraintToAllAction
 
QAction * m_setTieAction
 
QAction * m_setTieToAllAction
 
QAction * m_setToLogAction
 
QString m_tie
 
QAction * m_unfixAllAction
 
QString m_value
 

Detailed Description

An editor widget for editing a local parameter value.

It allows edit the values as well as fix/unfix the parameter.

Definition at line 23 of file LocalParameterEditor.h.

Constructor & Destructor Documentation

◆ LocalParameterEditor()

MantidQt::MantidWidgets::LocalParameterEditor::LocalParameterEditor ( QWidget *  parent,
int  index,
double  value,
bool  fixed,
const QString &  tie,
const QString &  constraint,
bool  othersFixed,
bool  allOthersFixed,
bool  othersTied,
bool  logOptionsEnabled 
)

Constructor.

Parameters
parent:: Parent widget.
index:: Index of the spectrum which parameter is edited.
value:: Current parameter value.
fixed:: Is the parameter fixed initially?
tie:: Parameter's current tie (or empty string).
constraint:: Parameter's current constraint (or empty string).
othersFixed:: True if some other local parameters are fixed.
allOthersFixed:: True if all other local parameters are fixed.
othersTied:: True if there are other tied parameters.
logOptionsEnabled:: True if the log checkbox is ticked.

Definition at line 34 of file LocalParameterEditor.cpp.

References fixAll(), fixParameter(), m_button, m_editor, m_fixAction, m_fixAllAction, m_fixed, m_removeAllConstraintsAction, m_removeAllTiesAction, m_removeConstraintAction, m_removeTieAction, m_setAllAction, m_setAllToLogAction, m_setConstraintAction, m_setConstraintToAllAction, m_setTieAction, m_setTieToAllAction, m_setToLogAction, m_unfixAllAction, removeAllConstraints(), removeAllTies(), removeConstraint(), removeTie(), setAll(), setAllValuesToLog(), setConstraint(), setConstraintAll(), setEditorState(), setTie(), setTieAll(), setToLog(), unfixAll(), and updateValue().

Member Function Documentation

◆ eventFilter()

bool MantidQt::MantidWidgets::LocalParameterEditor::eventFilter ( QObject *  widget,
QEvent *  evn 
)
overrideprivate

Filter events in the line editor to emulate a shortcut (F to fix/unfix).

Definition at line 248 of file LocalParameterEditor.cpp.

References fixParameter(), m_editor, m_index, m_tie, m_value, and setTie().

◆ fixAll

void MantidQt::MantidWidgets::LocalParameterEditor::fixAll ( )
privateslot

Send a signal to fix all parameters.

Definition at line 159 of file LocalParameterEditor.cpp.

References m_allOthersFixed, m_fixed, m_othersFixed, setAllFixed(), and setEditorState().

Referenced by LocalParameterEditor().

◆ fixParameter [1/2]

void MantidQt::MantidWidgets::LocalParameterEditor::fixParameter ( )
privateslot

Toggle the fix state of the current parameter.

Definition at line 152 of file LocalParameterEditor.cpp.

References fixParameter(), m_fixed, m_index, and setEditorState().

◆ fixParameter [2/2]

void MantidQt::MantidWidgets::LocalParameterEditor::fixParameter ( int  ,
bool   
)
signal

◆ removeAllConstraints

void MantidQt::MantidWidgets::LocalParameterEditor::removeAllConstraints ( )
privateslot

◆ removeAllTies

void MantidQt::MantidWidgets::LocalParameterEditor::removeAllTies ( )
privateslot

Remove ties from all parameters.

Definition at line 205 of file LocalParameterEditor.cpp.

References m_othersTied, m_tie, setEditorState(), and setTieAll().

Referenced by LocalParameterEditor().

◆ removeConstraint

void MantidQt::MantidWidgets::LocalParameterEditor::removeConstraint ( )
privateslot

Definition at line 221 of file LocalParameterEditor.cpp.

References m_constraint, m_index, setConstraint(), and setEditorState().

Referenced by LocalParameterEditor().

◆ removeTie

void MantidQt::MantidWidgets::LocalParameterEditor::removeTie ( )
privateslot

Send a signal to remove a tie.

Definition at line 187 of file LocalParameterEditor.cpp.

References m_index, m_tie, setEditorState(), and setTie().

Referenced by LocalParameterEditor().

◆ setAll

void MantidQt::MantidWidgets::LocalParameterEditor::setAll ( )
privateslot

Send a signal to set all parameters to the value in the editor.

Definition at line 146 of file LocalParameterEditor.cpp.

References m_editor, setAllValues(), and value.

Referenced by LocalParameterEditor().

◆ setAllFixed

void MantidQt::MantidWidgets::LocalParameterEditor::setAllFixed ( bool  )
signal

Referenced by fixAll(), and unfixAll().

◆ setAllValues

void MantidQt::MantidWidgets::LocalParameterEditor::setAllValues ( double  )
signal

Referenced by setAll().

◆ setAllValuesToLog

void MantidQt::MantidWidgets::LocalParameterEditor::setAllValuesToLog ( )
signal

Referenced by LocalParameterEditor().

◆ setConstraint [1/2]

void MantidQt::MantidWidgets::LocalParameterEditor::setConstraint ( )
privateslot

◆ setConstraint [2/2]

void MantidQt::MantidWidgets::LocalParameterEditor::setConstraint ( int  ,
QString   
)
signal

◆ setConstraintAll [1/2]

void MantidQt::MantidWidgets::LocalParameterEditor::setConstraintAll ( )
privateslot

◆ setConstraintAll [2/2]

void MantidQt::MantidWidgets::LocalParameterEditor::setConstraintAll ( QString  )
signal

◆ setConstraintDialog()

QString MantidQt::MantidWidgets::LocalParameterEditor::setConstraintDialog ( const QString &  tie)
staticprivate

Definition at line 307 of file LocalParameterEditor.cpp.

Referenced by setConstraint(), and setConstraintAll().

◆ setEditorState()

void MantidQt::MantidWidgets::LocalParameterEditor::setEditorState ( )
private

◆ setLogOptionsEnabled

void MantidQt::MantidWidgets::LocalParameterEditor::setLogOptionsEnabled ( bool  enabled)
privateslot

Slot: when log checkbox state changes, enable/disable the "set to log" and "set all to log" options.

Parameters
enabled:: [input] Whether to enable or disable options

Definition at line 328 of file LocalParameterEditor.cpp.

References m_setAllToLogAction, and m_setToLogAction.

◆ setTie [1/2]

void MantidQt::MantidWidgets::LocalParameterEditor::setTie ( )
privateslot

Send a signal to tie a parameter.

Definition at line 177 of file LocalParameterEditor.cpp.

References m_index, m_tie, setEditorState(), setTie(), and setTieDialog().

◆ setTie [2/2]

void MantidQt::MantidWidgets::LocalParameterEditor::setTie ( int  ,
QString   
)
signal

◆ setTieAll [1/2]

void MantidQt::MantidWidgets::LocalParameterEditor::setTieAll ( )
privateslot

Set all ties for all parameters.

Definition at line 194 of file LocalParameterEditor.cpp.

References m_othersTied, m_tie, setEditorState(), setTieAll(), and setTieDialog().

◆ setTieAll [2/2]

void MantidQt::MantidWidgets::LocalParameterEditor::setTieAll ( QString  )
signal

◆ setTieDialog()

QString MantidQt::MantidWidgets::LocalParameterEditor::setTieDialog ( const QString &  tie)
staticprivate

Open an input dialog to enter a tie expression.

Definition at line 297 of file LocalParameterEditor.cpp.

Referenced by setTie(), and setTieAll().

◆ setToLog

void MantidQt::MantidWidgets::LocalParameterEditor::setToLog ( )
privateslot

Send a signal to set value to log.

Definition at line 245 of file LocalParameterEditor.cpp.

References m_index, and setValueToLog().

Referenced by LocalParameterEditor().

◆ setValueToLog

void MantidQt::MantidWidgets::LocalParameterEditor::setValueToLog ( int  )
signal

Referenced by setToLog().

◆ unfixAll

void MantidQt::MantidWidgets::LocalParameterEditor::unfixAll ( )
privateslot

Send a signal to unfix all parameters.

Definition at line 168 of file LocalParameterEditor.cpp.

References m_allOthersFixed, m_fixed, m_othersFixed, setAllFixed(), and setEditorState().

Referenced by LocalParameterEditor().

◆ updateValue

void MantidQt::MantidWidgets::LocalParameterEditor::updateValue ( const QString &  value)
privateslot

SLOT: when user edits value, make sure m_value is updated.

Parameters
value:: [input] Changed text in the edit box

Definition at line 321 of file LocalParameterEditor.cpp.

References m_value, and value.

Referenced by LocalParameterEditor().

Member Data Documentation

◆ m_allOthersFixed

bool MantidQt::MantidWidgets::LocalParameterEditor::m_allOthersFixed
private

Definition at line 84 of file LocalParameterEditor.h.

Referenced by fixAll(), setEditorState(), and unfixAll().

◆ m_button

QPushButton* MantidQt::MantidWidgets::LocalParameterEditor::m_button
private

Definition at line 62 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor().

◆ m_constraint

QString MantidQt::MantidWidgets::LocalParameterEditor::m_constraint
private

◆ m_editor

QLineEdit* MantidQt::MantidWidgets::LocalParameterEditor::m_editor
private

Definition at line 61 of file LocalParameterEditor.h.

Referenced by eventFilter(), LocalParameterEditor(), setAll(), and setEditorState().

◆ m_fixAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_fixAction
private

Definition at line 64 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setEditorState().

◆ m_fixAllAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_fixAllAction
private

Definition at line 65 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setEditorState().

◆ m_fixed

bool MantidQt::MantidWidgets::LocalParameterEditor::m_fixed
private

◆ m_index

int MantidQt::MantidWidgets::LocalParameterEditor::m_index
private

◆ m_othersConstrained

bool MantidQt::MantidWidgets::LocalParameterEditor::m_othersConstrained
private

Definition at line 86 of file LocalParameterEditor.h.

Referenced by removeAllConstraints(), and setConstraintAll().

◆ m_othersFixed

bool MantidQt::MantidWidgets::LocalParameterEditor::m_othersFixed
private

Definition at line 83 of file LocalParameterEditor.h.

Referenced by fixAll(), setEditorState(), and unfixAll().

◆ m_othersTied

bool MantidQt::MantidWidgets::LocalParameterEditor::m_othersTied
private

Definition at line 85 of file LocalParameterEditor.h.

Referenced by removeAllTies(), setEditorState(), and setTieAll().

◆ m_removeAllConstraintsAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_removeAllConstraintsAction
private

Definition at line 74 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setEditorState().

◆ m_removeAllTiesAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_removeAllTiesAction
private

Definition at line 70 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setEditorState().

◆ m_removeConstraintAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_removeConstraintAction
private

Definition at line 72 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setEditorState().

◆ m_removeTieAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_removeTieAction
private

Definition at line 68 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setEditorState().

◆ m_setAllAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_setAllAction
private

Definition at line 63 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setEditorState().

◆ m_setAllToLogAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_setAllToLogAction
private

Definition at line 76 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setLogOptionsEnabled().

◆ m_setConstraintAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_setConstraintAction
private

Definition at line 71 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor().

◆ m_setConstraintToAllAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_setConstraintToAllAction
private

Definition at line 73 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor().

◆ m_setTieAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_setTieAction
private

Definition at line 67 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor().

◆ m_setTieToAllAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_setTieToAllAction
private

Definition at line 69 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor().

◆ m_setToLogAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_setToLogAction
private

Definition at line 75 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setLogOptionsEnabled().

◆ m_tie

QString MantidQt::MantidWidgets::LocalParameterEditor::m_tie
private

◆ m_unfixAllAction

QAction* MantidQt::MantidWidgets::LocalParameterEditor::m_unfixAllAction
private

Definition at line 66 of file LocalParameterEditor.h.

Referenced by LocalParameterEditor(), and setEditorState().

◆ m_value

QString MantidQt::MantidWidgets::LocalParameterEditor::m_value
private

Definition at line 79 of file LocalParameterEditor.h.

Referenced by eventFilter(), setEditorState(), and updateValue().


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