1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: ParametersPlugin_WidgetParamsMgr.h
4 // Created: 11 Apr 2016
5 // Author: Vitaly SMETANNIKOV
7 #ifndef ParametersPlugin_WidgetParamsMgr_H_
8 #define ParametersPlugin_WidgetParamsMgr_H_
10 #include <ModuleBase_ModelWidget.h>
11 #include <QModelIndex>
12 #include <QAbstractItemDelegate>
15 class QTreeWidgetItem;
16 class ParametersPlugin_ItemDelegate;
20 * Represent a content of the property panel to show/modify parameters of some feature.
22 class ParametersPlugin_WidgetParamsMgr : public ModuleBase_ModelWidget
26 /// Constructs a model widget
27 ParametersPlugin_WidgetParamsMgr(QWidget* theParent, const Config_WidgetAPI* theData);
29 /// Destructs the model widget
30 virtual ~ParametersPlugin_WidgetParamsMgr() {}
32 /// Returns list of widget controls
33 /// \return a control list
34 virtual QList<QWidget*> getControls() const;
37 /// Saves the internal parameters to the given feature
38 /// \return True in success
39 virtual bool storeValueCustom();
41 /// Restore value from attribute data to the widget's control
42 virtual bool restoreValueCustom();
44 /// The method called when widget is activated
45 virtual void activateCustom();
48 /// Slot for reaction on double click in the table (start editing)
49 /// \param theIndex the clicked index
50 void onDoubleClick(const QModelIndex& theIndex);
52 /// Slot for reaction on end of cell editing
53 /// \param theEditor the editor widget
54 /// \param theHint end of edit type
55 void onCloseEditor(QWidget* theEditor, QAbstractItemDelegate::EndEditHint theHint);
57 /// Slot for reaction on add parameter
60 /// Slot for reaction on insert parameter
63 /// Slot for reaction on remove parameter
66 /// Slot for reaction on shift up
69 /// Slot for reaction on shift down
75 void updateFeaturesPart();
77 bool hasName(const QString& theName) const;
80 QTreeWidgetItem* myFeatures;
81 QTreeWidgetItem* myParameters;
82 ParametersPlugin_ItemDelegate* myDelegate;
83 QModelIndex myEditingIndex;
85 QList<FeaturePtr> myParametersList;