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