Internal delegate class for QTreeWidget.
More...
#include <OpenMS/VISUAL/ParamEditor.h>
|
| ParamEditorDelegate (QObject *parent) |
| Constructor. More...
|
|
QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| Returns the widget(combobox or QLineEdit) used to edit the item specified by index for editing. Prevents edit operations on nodes' values and types. More...
|
|
void | setEditorData (QWidget *editor, const QModelIndex &index) const override |
| Sets the data to be displayed and edited by the editor for the item specified by index. More...
|
|
void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override |
| Sets the data for the specified model and item index from that supplied by the editor. If data changed in a cell, that is if it is different from an initial value, then set its background color to yellow and emit the modified signal otherwise make it white. More...
|
|
void | updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| Updates the editor for the item specified by index according to the style option given. More...
|
|
bool | hasUncommittedData () const |
| true if the underlying tree has an open QLineEdit which has uncommitted data More...
|
|
|
bool | eventFilter (QObject *editor, QEvent *event) override |
| a shortcut to calling commit(), which calls setModelData(); useful for embedded editors, but not for QDialogs etc More...
|
|
bool | exists_ (const QString &name, QModelIndex index) const |
| Checks if a name is valid for the entry corresponding to index (checks if it would be duplicate) More...
|
|
Internal delegate class for QTreeWidget.
This handles editing of items.
◆ ParamEditorDelegate() [1/2]
◆ ParamEditorDelegate() [2/2]
◆ closeEditor_
if cancel in any editor is clicked, the Dialog is closed and changes are rejected
◆ commitAndCloseEditor_
void commitAndCloseEditor_ |
( |
| ) |
|
|
privateslot |
◆ commitAndCloseLineEdit_
void commitAndCloseLineEdit_ |
( |
| ) |
|
|
privateslot |
... a bit special, because reset uncommited data
◆ createEditor()
QWidget* createEditor |
( |
QWidget * |
parent, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Returns the widget(combobox or QLineEdit) used to edit the item specified by index for editing. Prevents edit operations on nodes' values and types.
◆ eventFilter()
bool eventFilter |
( |
QObject * |
editor, |
|
|
QEvent * |
event |
|
) |
| |
|
overrideprotected |
a shortcut to calling commit(), which calls setModelData(); useful for embedded editors, but not for QDialogs etc
◆ exists_()
bool exists_ |
( |
const QString & |
name, |
|
|
QModelIndex |
index |
|
) |
| const |
|
protected |
Checks if a name
is valid for the entry corresponding to index
(checks if it would be duplicate)
◆ hasUncommittedData()
bool hasUncommittedData |
( |
| ) |
const |
true if the underlying tree has an open QLineEdit which has uncommitted data
◆ modified
void modified |
( |
bool |
| ) |
const |
|
signal |
signal for showing ParamEditor if the Model data changed
◆ setEditorData()
void setEditorData |
( |
QWidget * |
editor, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Sets the data to be displayed and edited by the editor for the item specified by index.
◆ setModelData()
void setModelData |
( |
QWidget * |
editor, |
|
|
QAbstractItemModel * |
model, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Sets the data for the specified model and item index from that supplied by the editor. If data changed in a cell, that is if it is different from an initial value, then set its background color to yellow and emit the modified signal otherwise make it white.
◆ updateEditorGeometry()
void updateEditorGeometry |
( |
QWidget * |
editor, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Updates the editor for the item specified by index according to the style option given.
◆ fileName_
used to modify value of output and input files( not for output and input lists)
◆ has_uncommited_data_
bool has_uncommited_data_ |
|
mutableprivate |
true if a QLineEdit is still open and has not committed its data yet (so storing the current param is a bad idea)