38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
42 #include <QtWidgets/QLineEdit>
43 #include <QtWidgets/QItemDelegate>
44 #include <QtWidgets/QTreeWidget>
47 class QStyleOptionViewItem;
48 class QAbstractItemModel;
54 class ParamEditorTemplate;
109 void setModelData(
QWidget * editor, QAbstractItemModel * model,
const QModelIndex & index)
const override;
124 bool exists_(QString name, QModelIndex index)
const;
153 bool edit(
const QModelIndex & index, EditTrigger trigger, QEvent * event)
override;
235 Ui::ParamEditorTemplate*
ui_;
Custom QLineEdit which emits a signal when losing focus (such that we can commit its data)
Definition: ParamEditor.h:75
void focusInEvent(QFocusEvent *e) override
void lostFocus()
emitted on focusOutEvent
void focusOutEvent(QFocusEvent *e) override
OpenMSLineEdit(QWidget *w)
Definition: ParamEditor.h:78
Internal delegate class for QTreeWidget.
Definition: ParamEditor.h:98
bool exists_(QString name, QModelIndex index) const
Checks if a name is valid for the entry corresponding to index (checks if it would be duplicate)
ParamEditorDelegate(QObject *parent)
Constructor.
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.
void closeEditor_()
if cancel in any editor is clicked, the Dialog is closed and changes are rejected
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....
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....
bool hasUncommittedData() const
true if the underlying tree has an open QLineEdit which has uncommitted data
bool has_uncommited_data_
true if a QLineEdit is still open and has not committed its data yet (so storing the current param is...
Definition: ParamEditor.h:140
ParamEditorDelegate()
Not implemented.
void commitAndCloseEditor_()
For closing any editor and updating ParamEditor.
QString fileName_
used to modify value of output and input files( not for output and input lists)
Definition: ParamEditor.h:138
void commitAndCloseLineEdit_()
... a bit special, because reset uncommited data
void modified(bool) const
signal for showing ParamEditor if the Model data changed
bool eventFilter(QObject *editor, QEvent *event) override
a shortcut to calling commit(), which calls setModelData(); useful for embedded editors,...
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.
QTreeWidget that emits a signal whenever a new row is selected.
Definition: ParamEditor.h:146
void selected(const QModelIndex &index)
Signal that is emitted when a new item is selected.
ParamTree(QWidget *parent)
Constructor.
bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) override
Overloaded edit method to activate F2 use.
void selectionChanged(const QItemSelection &selected, const QItemSelection &) override
Reimplemented virtual slot.
A GUI for editing or viewing a Param object.
Definition: ParamEditor.h:180
virtual ~ParamEditor()
destructor
Internal::ParamTree * tree_
Pointer to the tree widget.
Definition: ParamEditor.h:226
bool advanced_mode_
Indicates if normal mode or advanced mode is activated.
Definition: ParamEditor.h:232
void storeRecursive_(QTreeWidgetItem *child, String path, std::map< String, String > §ion_descriptions)
recursive helper method for method storeRecursive()
void showDocumentation(const QModelIndex &index)
Shows the documentation of an item in doc_.
void load(Param ¶m)
load method for Param object
bool isModified() const
Indicates if the data changed since last save.
bool modified_
Indicates that the data was modified since last store/load operation.
Definition: ParamEditor.h:230
Ui::ParamEditorTemplate * ui_
Definition: ParamEditor.h:235
void setModified(bool is_modified)
void toggleAdvancedMode(bool advanced)
Switches between normal and advanced mode.
void modified(bool)
item was edited
Param * param_
The data to edit.
Definition: ParamEditor.h:228
ParamEditor(QWidget *parent=nullptr)
constructor
@ NODE
Section.
Definition: ParamEditor.h:187
@ NORMAL_ITEM
Item that is always shown.
Definition: ParamEditor.h:188
void clear()
Clears all parameters.
void store()
store edited data in Param object
Management and storage of parameters / INI files.
Definition: Param.h:70
A more convenient string class.
Definition: String.h:61
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Definition: SwathWizardBase.h:63