Mantid
|
A custom item delegate - an object controlling display and editing of a cell in a table widget. More...
#include <LocalParameterItemDelegate.h>
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... | |
EditLocalParameterDialog * | owner () const |
Cast the parent to EditLocalParameterDialog. More... | |
Private Attributes | |
LocalParameterEditor * | m_currentEditor |
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.
|
explicit |
Constructor.
Definition at line 16 of file LocalParameterItemDelegate.cpp.
|
override |
Create a custom editor LocalParameterEditor.
Definition at line 20 of file LocalParameterItemDelegate.cpp.
References doSetAllValuesToLog(), doSetValueToLog(), fixParameter(), index, m_currentEditor, owner(), setAllFixed(), setAllValues(), setAllValuesToLog(), setConstraint(), setConstraintAll(), setTie(), setTieAll(), and setValueToLog().
|
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().
|
privateslot |
Slot: close the editor and re-emit the signal.
i | :: [input] Index of row |
Definition at line 88 of file LocalParameterItemDelegate.cpp.
References m_currentEditor, and setValueToLog().
Referenced by createEditor().
|
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.
|
signal |
Referenced by createEditor().
|
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().
|
overrideprotected |
Paint the table cell.
Definition at line 64 of file LocalParameterItemDelegate.cpp.
References MantidQt::MantidWidgets::EditLocalParameterDialog::getTie(), index, owner(), and Mantid::Geometry::rect.
void MantidQt::MantidWidgets::LocalParameterItemDelegate::prepareForPastedData | ( | ) |
Data is about to be pasted into the table.
Prepare for this by:
Definition at line 112 of file LocalParameterItemDelegate.cpp.
References m_currentEditor.
Referenced by MantidQt::MantidWidgets::EditLocalParameterDialog::paste().
|
signal |
Referenced by createEditor().
|
signal |
Referenced by createEditor().
|
signal |
Referenced by createEditor(), and doSetAllValuesToLog().
|
signal |
Referenced by createEditor().
|
signal |
Referenced by createEditor().
|
override |
Initialize the editor with the current data in the cell.
Definition at line 42 of file LocalParameterItemDelegate.cpp.
|
override |
Update the data in the cell with the text in the editor.
Definition at line 47 of file LocalParameterItemDelegate.cpp.
References index.
|
signal |
Referenced by createEditor().
|
signal |
Referenced by createEditor().
|
signal |
Referenced by createEditor(), and doSetValueToLog().
|
mutableprivate |
Definition at line 56 of file LocalParameterItemDelegate.h.
Referenced by createEditor(), doSetAllValuesToLog(), doSetValueToLog(), eventFilter(), and prepareForPastedData().