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

A custom item delegate - an object controlling display and editing of a cell in a table widget. More...

#include <LocalParameterItemDelegate.h>

Inheritance diagram for MantidQt::MantidWidgets::LocalParameterItemDelegate:

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

QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Create a custom editor LocalParameterEditor. More...
 
 LocalParameterItemDelegate (EditLocalParameterDialog *parent=nullptr)
 Constructor. More...
 
void prepareForPastedData ()
 Data is about to be pasted into the table. More...
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 Initialize the editor with the current data in the cell. More...
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Update the data in the cell with the text in the editor. More...
 

Protected Member Functions

void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Paint the table cell. More...
 

Private Slots

void doSetAllValuesToLog ()
 Slot: close the editor and re-emit the signal. More...
 
void doSetValueToLog (int)
 Slot: close the editor and re-emit the signal. More...
 

Private Member Functions

bool eventFilter (QObject *obj, QEvent *ev) override
 Re-implemented to resolve an issue: if the parent dialog closes with the editor is active any changes in it get ignored. More...
 
EditLocalParameterDialogowner () const
 Cast the parent to EditLocalParameterDialog. More...
 

Private Attributes

LocalParameterEditorm_currentEditor
 

Detailed Description

A custom item delegate - an object controlling display and editing of a cell in a table widget.

Re-implemented:

Definition at line 26 of file LocalParameterItemDelegate.h.

Constructor & Destructor Documentation

◆ LocalParameterItemDelegate()

MantidQt::MantidWidgets::LocalParameterItemDelegate::LocalParameterItemDelegate ( EditLocalParameterDialog parent = nullptr)
explicit

Constructor.

Definition at line 16 of file LocalParameterItemDelegate.cpp.

Member Function Documentation

◆ createEditor()

QWidget * MantidQt::MantidWidgets::LocalParameterItemDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

◆ doSetAllValuesToLog

void MantidQt::MantidWidgets::LocalParameterItemDelegate::doSetAllValuesToLog ( )
privateslot

Slot: close the editor and re-emit the signal.

Definition at line 99 of file LocalParameterItemDelegate.cpp.

References m_currentEditor, and setAllValuesToLog().

Referenced by createEditor().

◆ doSetValueToLog

void MantidQt::MantidWidgets::LocalParameterItemDelegate::doSetValueToLog ( int  i)
privateslot

Slot: close the editor and re-emit the signal.

Parameters
i:: [input] Index of row

Definition at line 88 of file LocalParameterItemDelegate.cpp.

References m_currentEditor, and setValueToLog().

Referenced by createEditor().

◆ eventFilter()

bool MantidQt::MantidWidgets::LocalParameterItemDelegate::eventFilter ( QObject *  obj,
QEvent *  ev 
)
overrideprivate

Re-implemented to resolve an issue: if the parent dialog closes with the editor is active any changes in it get ignored.

Definition at line 54 of file LocalParameterItemDelegate.cpp.

References m_currentEditor, and obj.

◆ fixParameter

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

Referenced by createEditor().

◆ owner()

EditLocalParameterDialog * MantidQt::MantidWidgets::LocalParameterItemDelegate::owner ( ) const
private

Cast the parent to EditLocalParameterDialog.

Get access to parameter values and fixes.

Definition at line 80 of file LocalParameterItemDelegate.cpp.

Referenced by createEditor(), and paint().

◆ paint()

void MantidQt::MantidWidgets::LocalParameterItemDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overrideprotected

◆ prepareForPastedData()

void MantidQt::MantidWidgets::LocalParameterItemDelegate::prepareForPastedData ( )

Data is about to be pasted into the table.

Prepare for this by:

  • closing the editor (if one is open)

Definition at line 112 of file LocalParameterItemDelegate.cpp.

References m_currentEditor.

Referenced by MantidQt::MantidWidgets::EditLocalParameterDialog::paste().

◆ setAllFixed

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

Referenced by createEditor().

◆ setAllValues

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

Referenced by createEditor().

◆ setAllValuesToLog

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

◆ setConstraint

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

Referenced by createEditor().

◆ setConstraintAll

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

Referenced by createEditor().

◆ setEditorData()

void MantidQt::MantidWidgets::LocalParameterItemDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
override

Initialize the editor with the current data in the cell.

Definition at line 42 of file LocalParameterItemDelegate.cpp.

◆ setModelData()

void MantidQt::MantidWidgets::LocalParameterItemDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const
override

Update the data in the cell with the text in the editor.

Definition at line 47 of file LocalParameterItemDelegate.cpp.

References index.

◆ setTie

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

Referenced by createEditor().

◆ setTieAll

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

Referenced by createEditor().

◆ setValueToLog

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

Referenced by createEditor(), and doSetValueToLog().

Member Data Documentation

◆ m_currentEditor

LocalParameterEditor* MantidQt::MantidWidgets::LocalParameterItemDelegate::m_currentEditor
mutableprivate

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