SHAPER  9.15.0
ModuleBase_WidgetConcealedObjects.h
1 // Copyright (C) 2014-2025 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef MODULEBASE_WIDGETCONCEALEDOBJECTS_H_
21 #define MODULEBASE_WIDGETCONCEALEDOBJECTS_H_
22 
23 #include <ModuleBase.h>
24 #include <ModuleBase_ModelWidget.h>
25 
26 #include <string>
27 #include <map>
28 #include <memory>
29 
30 class ModelAPI_Object;
31 
32 class QWidget;
33 class QTableWidget;
34 
40 {
41  Q_OBJECT
42  public:
47  const Config_WidgetAPI* theData);
49 
51  virtual QList<QWidget*> getControls() const;
52 
54  virtual bool canAcceptFocus() const { return false; };
55 
56 protected:
59  virtual bool storeValueCustom();
60 
62  virtual bool restoreValueCustom();
63 
64 private:
67  void addViewRow(const std::shared_ptr<ModelAPI_Result>& theResult);
68 
69 private slots:
72  void onItemToggled(bool theState);
73 
74 private:
75  std::string myBaseShapeAttribute;
76  bool myPickConcealedParents;
77  QTableWidget* myView;
78 
79  std::shared_ptr<ModelAPI_Feature> myBaseFeature;
81  std::map<int, std::shared_ptr<ModelAPI_Result> > myConcealedResults;
82 };
83 
84 #endif /* MODULEBASE_WIDGETCONCEALEDOBJECTS_H_ */
Provides low-level API for WidgetFactory for reading xml definitions of widgets.
Definition: Config_WidgetAPI.h:46
Represents any object in the data model and in the object browser.
Definition: ModelAPI_Object.h:45
An abstract custom widget class.
Definition: ModuleBase_ModelWidget.h:60
virtual QList< QWidget * > getControls() const =0
Returns list of widget controls.
virtual bool storeValueCustom()=0
Saves the internal parameters to the given feature.
virtual bool restoreValueCustom()=0
Restore value from attribute data to the widget's control.
Implementation of model widget for table of concealed objects.
Definition: ModuleBase_WidgetConcealedObjects.h:40
virtual bool canAcceptFocus() const
The widget can not accept focus.
Definition: ModuleBase_WidgetConcealedObjects.h:54