Salome HOME
Issue #1954: Set type of data into items delegate on restore data
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_WidgetField.h
index d732d99d408e86d692f8829dc7014ca7e7110604..78af65eb1fc3c438a55bfd30ea8481a0e3dd9585 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <QList>
 #include <QStringList>
+#include <QStyledItemDelegate>
 
 
 class QWidget;
@@ -30,6 +31,28 @@ class QPushButton;
 class QTableWidgetItem;
 class QLineEdit;
 
+
+class DataTableItemDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+public:
+  DataTableItemDelegate(ModelAPI_AttributeTables::ValueType theType) :
+      QStyledItemDelegate() { myType = theType; }
+
+  virtual QWidget* createEditor(QWidget* theParent,
+                                const QStyleOptionViewItem & theOption,
+                                const QModelIndex& theIndex) const;
+
+  ModelAPI_AttributeTables::ValueType dataType() const { return myType; }
+
+  void setDataType(ModelAPI_AttributeTables::ValueType theType) { myType = theType; }
+
+private:
+  ModelAPI_AttributeTables::ValueType myType;
+};
+
+
+
 /*!
  * \ingroup GUI
  * Represent a content of the property panel to show/modify parameters of a Field feature.
@@ -200,6 +223,8 @@ private:
   bool myIsTabEdit;
 
   bool myActivation;
+
+  DataTableItemDelegate* myDelegate;
 };
 
 #endif
\ No newline at end of file