Salome HOME
Undoes temporary modifications.
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetTable.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * ModuleBase_WidgetTable.h
5  *
6  *  Created on: Oct 8, 2014
7  *      Author: sbh
8  */
9
10 #ifndef ModuleBase_WidgetTable_H_
11 #define ModuleBase_WidgetTable_H_
12
13 #include <ModuleBase.h>
14 #include <ModuleBase_ModelWidget.h>
15
16 class ModuleBase_TableModel;
17 class QTableView;
18
19 /**
20 * \ingroup GUI
21 * Implementation of model widget for line edit widget.
22 * It can be defined with "stringvalue" keyword.
23 */
24 class MODULEBASE_EXPORT ModuleBase_WidgetTable : public ModuleBase_ModelWidget
25 {
26   Q_OBJECT
27  public:
28   /// Constructor
29   /// \param theParent the parent object
30   /// \param theData the widget configuration.
31   /// \param theParentId is Id of a parent of the current attribute
32   /// \param thePlaceHolder a string of placeholder
33   ModuleBase_WidgetTable( QWidget* theParent,
34                           const Config_WidgetAPI* theData,
35                           const std::string& theParentId );
36   virtual ~ModuleBase_WidgetTable();
37
38   /// Redefinition of virtual method
39   virtual QList<QWidget*> getControls() const;
40
41 protected slots:
42   void onAddRow();
43
44 protected:
45   /// Saves the internal parameters to the given feature
46   /// \return True in success
47   virtual bool storeValueCustom() const { return true;};
48
49   /// Restore value from attribute data to the widget's control
50   virtual bool restoreValueCustom() { return true; }
51
52 private:
53   /// A line edit control
54   ModuleBase_TableModel* myTableModel;
55   QTableView*            myTableView;
56 };
57
58 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */