#ifndef ParametersPlugin_WidgetParamsMgr_H_
#define ParametersPlugin_WidgetParamsMgr_H_
-#include <ModuleBase_ModelWidget.h>
+#include <ModuleBase_ModelDialogWidget.h>
#include <QModelIndex>
#include <QAbstractItemDelegate>
#include <QTreeWidget>
class QToolButton;
+/*!
+ * \ingroup GUI
+ * Redefinition of QTreeWidget for processing of closeEditor event
+ */
class ParametersPlugin_TreeWidget: public QTreeWidget
{
Q_OBJECT
public:
+ /// Constructor
+ /// \param theParent a parent widget
ParametersPlugin_TreeWidget(QWidget* theParent = 0) : QTreeWidget(theParent) {}
protected slots:
+ /// Redefinition of virtual method
+ /// \param theEditor a editor widget
+ /// \param theHint end of editing hint
virtual void closeEditor(QWidget* theEditor, QAbstractItemDelegate::EndEditHint theHint);
};
* \ingroup GUI
* Represent a content of the property panel to show/modify parameters of some feature.
*/
-class ParametersPlugin_WidgetParamsMgr : public ModuleBase_ModelWidget
+class ParametersPlugin_WidgetParamsMgr : public ModuleBase_ModelDialogWidget
{
Q_OBJECT
public:
FeaturePtr createParameter() const;
/// Creates a new item
- QTreeWidgetItem* createNewItem() const;
+ QTreeWidgetItem* createNewItem(QTreeWidgetItem* theParent) const;
/// Returns currently selected item
QTreeWidgetItem* selectedItem() const;
void updateParametersPart();
+ /// Returns true if values in the widget are valid
+ bool isValid();
+
/// Returns true if parameter with the given name already exists
bool hasName(const QString& theName) const;
- QList<QStringList> featuresItems(const QList<FeaturePtr>& theFeatures) const;
+ /// Enable or disable buttons for parameters managemnt
+ void enableButtons(bool theEnable);
+
+ QList<QStringList> featuresItems(const QList<FeaturePtr>& theFeatures,
+ QList<FeaturePtr>& theFeatureList) const;
QList<QStringList> parametersItems(const QList<FeaturePtr>& theFeatures) const;
void updateParametersFeatures();