Salome HOME
SketchShapePlugin: checked group box/multi editor controls, which highlight the paren...
[modules/shaper.git] / src / SketchShapePlugin / SketchShapePlugin_WidgetCheckGroupBox.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchShapePlugin_PageGroupBox.h
4 // Created:     13 Dec 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #include <SketchShapePlugin_WidgetCheckGroupBox.h>
8
9 #include <SketchShapePlugin_PageGroupBox.h>
10
11 SketchShapePlugin_WidgetCheckGroupBox::SketchShapePlugin_WidgetCheckGroupBox(QWidget* theParent,
12                                                                const Config_WidgetAPI* theData,
13                                                                const std::string& theParentId)
14   : ModuleBase_WidgetCheckGroupBox(theParent, theData, theParentId)
15 {
16 }
17
18 void SketchShapePlugin_WidgetCheckGroupBox::setHighlighted(bool isHighlighted)
19 {
20   SketchShapePlugin_PageGroupBox* aShapeGroupBox = 0;
21   QWidget* aParent = qobject_cast<QWidget*>(parent());
22   while (aParent) {
23     aShapeGroupBox = dynamic_cast<SketchShapePlugin_PageGroupBox*>(aParent);
24     if (aShapeGroupBox)
25       break;
26     aParent = qobject_cast<QWidget*>(aParent->parent());
27   }
28
29   if (aShapeGroupBox)
30     aShapeGroupBox->setHighlightedGroupBox(isHighlighted);
31 }
32