1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_WidgetConcealedObjects.h
4 // Created: 29 Jul 2016
5 // Author: Natalia ERMOLAEVA
7 #ifndef MODULEBASE_WIDGETCONCEALEDOBJECTS_H_
8 #define MODULEBASE_WIDGETCONCEALEDOBJECTS_H_
10 #include <ModuleBase.h>
11 #include <ModuleBase_ModelWidget.h>
17 class ModelAPI_Object;
25 * Implementation of model widget for table of concealed objects.
27 class MODULEBASE_EXPORT ModuleBase_WidgetConcealedObjects : public ModuleBase_ModelWidget
32 /// \param theParent the parent object
33 /// \param theData the widget configuration.
34 ModuleBase_WidgetConcealedObjects(QWidget* theParent,
35 const Config_WidgetAPI* theData);
36 virtual ~ModuleBase_WidgetConcealedObjects();
38 /// Redefinition of virtual method
39 virtual QList<QWidget*> getControls() const;
41 /// The widget can not accept focus
42 virtual bool canAcceptFocus() const { return false; };
45 /// Saves the internal parameters to the given feature
46 /// \return True in success
47 virtual bool storeValueCustom();
49 /// Redefinition of virtual method
50 virtual bool restoreValueCustom();
53 /// Creates a row in view
54 /// \param theResult a result for the row
55 void addViewRow(const std::shared_ptr<ModelAPI_Result>& theResult);
58 /// Processes the display button click in the view.
59 /// \param theState a new state
60 void onItemToggled(bool theState);
63 /// Updates icon of button
64 /// \param theButton a button of the table
65 void updateItemIcon(QToolButton* theButton);
68 std::string myBaseShapeAttribute; ///< attribute of the base object
69 QTableWidget* myView; ///< table view of visibility states
71 std::shared_ptr<ModelAPI_Feature> myBaseFeature; ///< backup of feature of filling the table view
72 /// backup of visualized in the view concealed objects, stored to avoid table rebuild by restore
73 std::map<int, std::shared_ptr<ModelAPI_Result> > myConcealedResults;
76 #endif /* MODULEBASE_WIDGETCONCEALEDOBJECTS_H_ */