]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_PropertyPanel.cpp
Salome HOME
Issue #2365 problem with active panel in feature and Hide faces windows
[modules/shaper.git] / src / XGUI / XGUI_PropertyPanel.cpp
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #include <XGUI_ActionsMgr.h>
22 #include <XGUI_ActiveControlMgr.h>
23 #include <XGUI_SelectionActivate.h>
24 #include <XGUI_ActiveControlSelector.h>
25 #include <XGUI_PropertyPanel.h>
26 #include <XGUI_PropertyPanelSelector.h>
27 #include <XGUI_OperationMgr.h>
28 #include <XGUI_Tools.h>
29 #include <XGUI_Workshop.h>
30
31 //#include <AppElements_Constants.h>
32 #include <ModuleBase_WidgetMultiSelector.h>
33 #include <ModuleBase_Tools.h>
34 #include <ModuleBase_PageBase.h>
35 #include <ModuleBase_PageWidget.h>
36 #include <ModuleBase_WidgetFactory.h>
37 #include <ModuleBase_OperationDescription.h>
38 #include <ModuleBase_Events.h>
39
40 #include <Events_Loop.h>
41
42 #include <ModelAPI_Session.h>
43 #include <ModelAPI_Validator.h>
44
45 #include <QEvent>
46 #include <QFrame>
47 #include <QIcon>
48 #include <QKeyEvent>
49 #include <QLayoutItem>
50 #include <QToolButton>
51 #include <QVBoxLayout>
52 #include <QGridLayout>
53 #include <QWidget>
54 #include <QToolButton>
55 #include <QAction>
56
57 #ifdef _DEBUG
58 #include <iostream>
59 #endif
60
61 //#define DEBUG_TAB_WIDGETS
62
63 //#define DEBUG_ACTIVE_WIDGET
64
65 XGUI_PropertyPanel::XGUI_PropertyPanel(QWidget* theParent, XGUI_OperationMgr* theMgr)
66     : ModuleBase_IPropertyPanel(theParent),
67     myActiveWidget(NULL),
68     myPreselectionWidget(NULL),
69     myPanelPage(NULL),
70     myOperationMgr(theMgr)
71 {
72   setWindowTitle(tr("Property Panel"));
73   QAction* aViewAct = toggleViewAction();
74   setObjectName(PROP_PANEL);
75   setStyleSheet("::title { position: relative; padding-left: 5px; text-align: left center }");
76
77   QWidget* aContent = new QWidget(this);
78   QGridLayout* aMainLayout = new QGridLayout(aContent);
79   const int kPanelColumn = 0;
80   int aPanelRow = 0;
81   aMainLayout->setContentsMargins(3, 3, 3, 3);
82   setWidget(aContent);
83
84   QFrame* aFrm = new QFrame(aContent);
85   aFrm->setFrameStyle(QFrame::Raised);
86   aFrm->setFrameShape(QFrame::Panel);
87   QHBoxLayout* aBtnLay = new QHBoxLayout(aFrm);
88   ModuleBase_Tools::zeroMargins(aBtnLay);
89   aMainLayout->addWidget(aFrm, aPanelRow++, kPanelColumn);
90
91   myHeaderWidget = aFrm;
92
93   QStringList aBtnNames;
94   aBtnNames << QString(PROP_PANEL_HELP)
95             << QString(PROP_PANEL_OK)
96             << QString(PROP_PANEL_CANCEL);
97   foreach(QString eachBtnName, aBtnNames) {
98     QToolButton* aBtn = new QToolButton(aFrm);
99     aBtn->setObjectName(eachBtnName);
100     aBtn->setAutoRaise(true);
101     aBtnLay->addWidget(aBtn);
102   }
103   aBtnLay->insertStretch(1, 1);
104
105   myPanelPage = new ModuleBase_PageWidget(aContent);
106   myPanelPage->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
107   aMainLayout->addWidget(myPanelPage, aPanelRow, kPanelColumn);
108
109   // spit to make the preview button on the bottom of the panel
110   aMainLayout->setRowStretch(aPanelRow++, 1);
111
112   // preview button on the bottom of panel
113   aFrm = new QFrame(aContent);
114   aBtnLay = new QHBoxLayout(aFrm);
115   aBtnLay->addStretch(1);
116   ModuleBase_Tools::zeroMargins(aBtnLay);
117   aMainLayout->addWidget(aFrm, aPanelRow++, kPanelColumn);
118
119   QToolButton* aBtn = new QToolButton(aFrm);
120   aBtn->setObjectName(PROP_PANEL_PREVIEW);
121   aBtnLay->addWidget(aBtn);
122 }
123
124 XGUI_PropertyPanel::~XGUI_PropertyPanel()
125 {
126 }
127
128 void XGUI_PropertyPanel::cleanContent()
129 {
130   if (myActiveWidget)
131     myActiveWidget->deactivate();
132
133   XGUI_ActiveControlSelector* aPPSelector = XGUI_Tools::workshop(myOperationMgr->workshop())->
134     activeControlMgr()->getSelector(XGUI_PropertyPanelSelector::Type());
135   aPPSelector->reset(); // it removes need to be updated widget link
136
137   /// as the widgets are deleted later, it is important that the signals
138   /// of these widgets are not processed. An example of the error is issue 986.
139   /// In the given case, the property panel is firstly filled by new widgets
140   /// of restarted operation and after that the mouse release signal come from
141   /// the widget of the previous operation (Point2d widget about mouse is released
142   /// and focus is out of this widget)
143   QList<ModuleBase_ModelWidget*>::const_iterator anIt = myWidgets.begin(),
144                                                  aLast = myWidgets.end();
145   for (; anIt != aLast; anIt++) {
146     QWidget* aWidget = *anIt;
147     if (aWidget) {
148       aWidget->blockSignals(true);
149     }
150   }
151
152   myWidgets.clear();
153   myPanelPage->clearPage();
154   myActiveWidget = NULL;
155   emit propertyPanelDeactivated();
156   myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
157   myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
158 #ifdef DEBUG_ACTIVE_WIDGET
159   std::cout << "myActiveWidget = NULL" << std::endl;
160 #endif
161
162   findButton(PROP_PANEL_PREVIEW)->setVisible(false); /// by default it is hidden
163   setWindowTitle(tr("Property Panel"));
164 }
165
166 void XGUI_PropertyPanel::setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets)
167 {
168   myWidgets = theWidgets;
169   if (theWidgets.empty()) return;
170   foreach (ModuleBase_ModelWidget* aWidget, theWidgets) {
171     connect(aWidget, SIGNAL(focusInWidget(ModuleBase_ModelWidget*)),
172             this,    SLOT(onFocusInWidget(ModuleBase_ModelWidget*)));
173     connect(aWidget, SIGNAL(focusOutWidget(ModuleBase_ModelWidget*)),
174             this,    SLOT(onActivateNextWidget(ModuleBase_ModelWidget*)));
175     connect(aWidget, SIGNAL(keyReleased(QObject*, QKeyEvent*)),
176             this,    SIGNAL(keyReleased(QObject*, QKeyEvent*)));
177     connect(aWidget, SIGNAL(enterClicked(QObject*)),
178             this,    SIGNAL(enterClicked(QObject*)));
179
180   }
181 }
182
183 const QList<ModuleBase_ModelWidget*>& XGUI_PropertyPanel::modelWidgets() const
184 {
185   return myWidgets;
186 }
187
188 ModuleBase_PageBase* XGUI_PropertyPanel::contentWidget()
189 {
190   return static_cast<ModuleBase_PageBase*>(myPanelPage);
191 }
192
193 void XGUI_PropertyPanel::updateContentWidget(FeaturePtr theFeature)
194 {
195   // Invalid feature case on abort of the operation
196   if (theFeature.get() == NULL)
197     return;
198   if (theFeature->isAction() || !theFeature->data())
199     return;
200   foreach(ModuleBase_ModelWidget* eachWidget, myWidgets) {
201     if (!eachWidget->feature().get())
202       eachWidget->setFeature(theFeature);
203     eachWidget->restoreValue();
204   }
205   // the repaint is used here to immediately react in GUI to the values change.
206   repaint();
207 }
208
209 void XGUI_PropertyPanel::createContentPanel(FeaturePtr theFeature)
210 {
211   // Invalid feature case on abort of the operation
212   if (theFeature.get() == NULL)
213     return;
214   if (theFeature->isAction() || !theFeature->data())
215     return;
216
217   if (myWidgets.empty()) {
218     ModuleBase_Operation* anOperation = myOperationMgr->currentOperation();
219     QString aXmlRepr = anOperation->getDescription()->xmlRepresentation();
220
221     ModuleBase_WidgetFactory aFactory(aXmlRepr.toStdString(), myOperationMgr->workshop());
222     aFactory.createPanel(contentWidget(), theFeature);
223     /// Apply button should be update if the feature was modified by the panel
224     myOperationMgr->onValidateOperation();
225   }
226 }
227
228 void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget)
229 {
230   // it is possible that the property panel widgets have not been visualized
231   // (e.g. on start operation), so it is strictly important to do not check visualized state
232   activateNextWidget(theWidget, false);
233 }
234
235 void XGUI_PropertyPanel::onFocusInWidget(ModuleBase_ModelWidget* theWidget)
236 {
237 #ifdef DEBUG_ACTIVE_WIDGET
238   std::cout << "onFocusInWidget" << std::endl;
239 #endif
240   if (theWidget->canAcceptFocus())
241     activateWidget(theWidget);
242 }
243
244 void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget)
245 {
246   // this slot happens when some widget lost focus, the next widget which accepts the focus
247   // should be shown, so the second parameter is true
248   // it is important for features where in cases the same attributes are used, isCase for this
249   // attribute returns true, however it can be placed in hidden stack widget(extrusion: elements,
250   // sketch multi rotation -> single/full point)
251   // it is important to check the widget visibility to do not check of the next widget visible
252   // state if the current is not shown. (example: sketch circle re-entrant operation after mouse
253   // release in the viewer, next, radius,
254   // widget should be activated but the first is not visualized)
255   bool isVisible = theWidget->isVisible();
256   activateNextWidget(theWidget, isVisible);
257 }
258
259
260 void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget,
261                                             const bool isCheckVisibility)
262 {
263   // TO CHECK: Editing operation does not have automatical activation of widgets
264   if (isEditingMode()) {
265     activateWidget(NULL);
266     return;
267   }
268   ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators();
269
270   QList<ModuleBase_ModelWidget*>::const_iterator anIt = myWidgets.begin(), aLast = myWidgets.end();
271   bool isFoundWidget = false;
272   ModuleBase_Tools::activateWindow(this, "XGUI_PropertyPanel::activateNextWidget()");
273   for (; anIt != aLast; anIt++) {
274     ModuleBase_ModelWidget* aCurrentWidget = *anIt;
275     if (isFoundWidget || !theWidget) {
276
277       if (!aValidators->isCase(aCurrentWidget->feature(), aCurrentWidget->attributeID()))
278         continue; // this attribute does not participate in the current case
279       if (isCheckVisibility && !aCurrentWidget->isInternal()) {
280         if (!aCurrentWidget->isVisible())
281           continue;
282       }
283       if (!aCurrentWidget->isObligatory())
284         continue; // not obligatory widgets are not activated automatically
285
286       if (!aCurrentWidget->canAcceptFocus())
287         continue; // do not set focus if it can not be accepted, case: optional choice
288
289       if (aCurrentWidget->focusTo()) {
290         aCurrentWidget->emitFocusInWidget();
291         return;
292       }
293     }
294     isFoundWidget = isFoundWidget || (*anIt) == theWidget;
295   }
296   // set focus to Ok/Cancel button in Property panel if there are no more active widgets
297   // it should be performed before activateWidget(NULL) because it emits some signals which
298   // can be processed by moudule for example as to activate another widget with setting focus
299   QWidget* aNewFocusWidget = 0;
300   QToolButton* anOkBtn = findButton(PROP_PANEL_OK);
301   if (anOkBtn->isEnabled())
302     aNewFocusWidget = anOkBtn;
303   else {
304     QToolButton* aCancelBtn = findButton(PROP_PANEL_CANCEL);
305     if (aCancelBtn->isEnabled())
306       aNewFocusWidget = aCancelBtn;
307   }
308   if (aNewFocusWidget)
309     ModuleBase_Tools::setFocus(aNewFocusWidget, "XGUI_PropertyPanel::activateNextWidget");
310
311   activateWidget(NULL);
312 }
313
314 void findDirectChildren(QWidget* theParent, QList<QWidget*>& theWidgets, const bool theDebug)
315 {
316   QList<QWidget*> aWidgets;
317
318   if (theParent) {
319     QLayout* aLayout = theParent->layout();
320     if (aLayout) {
321       for (int i = 0, aCount = aLayout->count(); i < aCount; i++) {
322         QLayoutItem* anItem = aLayout->itemAt(i);
323         QWidget* aWidget = anItem ? anItem->widget() : 0;
324         if (aWidget) {
325           if (aWidget->isVisible()) {
326             if (aWidget->focusPolicy() != Qt::NoFocus)
327               theWidgets.append(aWidget);
328             findDirectChildren(aWidget, theWidgets, false);
329           }
330         }
331         else if (anItem->layout()) {
332           QLayout* aLayout = anItem->layout();
333           for (int i = 0, aCount = aLayout->count(); i < aCount; i++) {
334             QLayoutItem* anItem = aLayout->itemAt(i);
335             QWidget* aWidget = anItem ? anItem->widget() : 0;
336             if (aWidget) {
337               if (aWidget->isVisible()) {
338                 if (aWidget->focusPolicy() != Qt::NoFocus)
339                   theWidgets.append(aWidget);
340                 findDirectChildren(aWidget, theWidgets, false);
341               }
342             }
343             else {
344               // TODO: improve recursive search for the case when here QLayout is used
345               // currently, the switch widget uses only 1 level of qlayout in qlayout using for
346               // example for construction plane feature. If there are more levels,
347               // it should be implemented here
348             }
349           }
350         }
351       }
352     }
353   }
354 #ifdef DEBUG_TAB_WIDGETS
355   if (theDebug) {
356     QStringList aWidgetTypes;
357     QList<QWidget*>::const_iterator anIt =  theWidgets.begin(), aLast = theWidgets.end();
358     for (; anIt != aLast; anIt++) {
359       QWidget* aWidget = *anIt;
360       if (aWidget)
361         aWidgetTypes.append(aWidget->objectName());
362     }
363     QString anInfo = QString("theWidgets[%1]: %2")
364       .arg(theWidgets.count()).arg(aWidgetTypes.join(","));
365     qDebug(anInfo.toStdString().c_str());
366   }
367 #endif
368 }
369
370 bool XGUI_PropertyPanel::setFocusNextPrevChild(bool theIsNext)
371 {
372   return focusNextPrevChild(theIsNext);
373 }
374
375 bool XGUI_PropertyPanel::focusNextPrevChild(bool theIsNext)
376 {
377   // it wraps the Tabs clicking to follow in the chain:
378   // controls, last control, Apply, Cancel, first control, controls
379   bool isChangedFocus = false;
380
381   QWidget* aFocusWidget = focusWidget();
382 #ifdef DEBUG_TAB_WIDGETS
383   if (aFocusWidget) {
384     QString anInfo = QString("focus Widget: %1").arg(aFocusWidget->objectName());
385     qDebug(anInfo.toStdString().c_str());
386   }
387 #endif
388   ModuleBase_ModelWidget* aFocusMWidget = ModuleBase_ModelWidget::findModelWidget(this,
389                                                                          aFocusWidget);
390   if (aFocusMWidget)
391     aFocusMWidget->setHighlighted(false);
392
393   QWidget* aNewFocusWidget = 0;
394   if (aFocusWidget) {
395     QList<QWidget*> aChildren;
396     findDirectChildren(this, aChildren, true);
397     int aChildrenCount = aChildren.count();
398     int aFocusWidgetIndex = aChildren.indexOf(aFocusWidget);
399     if (aFocusWidgetIndex >= 0) {
400       if (theIsNext) {
401         if (aFocusWidgetIndex == aChildrenCount-1) {
402           // after the last widget focus should be set to "Apply"
403           QToolButton* anOkBtn = findButton(PROP_PANEL_OK);
404           if (anOkBtn->isEnabled())
405             aNewFocusWidget = anOkBtn;
406           else {
407             QToolButton* aCancelBtn = findButton(PROP_PANEL_CANCEL);
408             if (aCancelBtn->isEnabled())
409               aNewFocusWidget = aCancelBtn;
410           }
411         }
412         else {
413           aNewFocusWidget = aChildren[aFocusWidgetIndex+1];
414         }
415       }
416       else {
417         if (aFocusWidgetIndex == 0) {
418           // before the first widget, the last should accept focus
419           aNewFocusWidget = aChildren[aChildrenCount - 1];
420         }
421         else {
422           // before the "Apply" button, the last should accept focus for consistency with "Next"
423           QToolButton* anOkBtn = findButton(PROP_PANEL_OK);
424           if (aFocusWidget == anOkBtn) {
425             aNewFocusWidget = aChildren[aChildrenCount - 1];
426           }
427           else {
428             aNewFocusWidget = aChildren[aFocusWidgetIndex-1];
429           }
430         }
431       }
432     }
433   }
434   if (aNewFocusWidget) {
435     if (myActiveWidget) {
436       bool isFirstControl = !theIsNext;
437       QWidget* aLastFocusControl = myActiveWidget->getControlAcceptingFocus(isFirstControl);
438       if (aFocusWidget == aLastFocusControl) {
439         setActiveWidget(NULL, false);
440       }
441     }
442
443     // we want to have property panel as an active window to enter values in double control
444     ModuleBase_Tools::setFocus(aNewFocusWidget, "XGUI_PropertyPanel::focusNextPrevChild()");
445
446     ModuleBase_ModelWidget* aNewFocusMWidget = ModuleBase_ModelWidget::findModelWidget(this,
447                                                                               aNewFocusWidget);
448     if (aNewFocusMWidget)
449       aNewFocusMWidget->emitFocusInWidget();
450     isChangedFocus = true;
451   }
452   return isChangedFocus;
453 }
454
455 void XGUI_PropertyPanel::activateNextWidget()
456 {
457   activateNextWidget(myActiveWidget);
458 }
459
460 void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget, const bool theEmitSignal)
461 {
462   std::string aPreviosAttributeID;
463   if(myActiveWidget)
464     aPreviosAttributeID = myActiveWidget->attributeID();
465
466   // Avoid activation of already actve widget. It could happen on focusIn event many times
467   setActiveWidget(theWidget, theEmitSignal);
468 }
469
470 bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, const bool isEmitSignal)
471 {
472   // Avoid activation of already actve widget. It could happen on focusIn event many times
473   if (theWidget == myActiveWidget) {
474     return false;
475   }
476   std::string aPreviosAttributeID;
477   if(myActiveWidget) {
478     aPreviosAttributeID = myActiveWidget->attributeID();
479     myActiveWidget->processValueState();
480     myActiveWidget->deactivate();
481     myActiveWidget->setHighlighted(false);
482   }
483   if(theWidget) {
484     emit beforeWidgetActivated(theWidget);
485     theWidget->setHighlighted(true);
486     theWidget->activate();
487   }
488   myActiveWidget = theWidget;
489
490 #ifdef DEBUG_ACTIVE_WIDGET
491   std::cout << "myActiveWidget = " << (theWidget ? theWidget->context().c_str() : "") << std::endl;
492 #endif
493   bool anIsNoMoreWidgets = false;
494   if (isEmitSignal) {
495     //emit widgetActivated(myActiveWidget);
496     if (!myActiveWidget && !isEditingMode()) {
497       anIsNoMoreWidgets = true;
498       emit noMoreWidgets(aPreviosAttributeID);
499     }
500   }
501   if (myActiveWidget)
502     emit propertyPanelActivated();
503   else
504     emit propertyPanelDeactivated();
505   myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
506   myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
507
508   if (!anIsNoMoreWidgets && myActiveWidget)
509   {
510     // restore widget selection should be done after selection modes of widget activating
511     static Events_ID anEvent = Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION);
512     Events_Loop::loop()->flush(anEvent);
513   }
514   return true;
515 }
516
517 void XGUI_PropertyPanel::setFocusOnOkButton()
518 {
519   QToolButton* anOkBtn = findButton(PROP_PANEL_OK);
520   ModuleBase_Tools::setFocus(anOkBtn, "XGUI_PropertyPanel::setFocusOnOkButton()");
521 }
522
523 void XGUI_PropertyPanel::setCancelEnabled(bool theEnabled)
524 {
525   QToolButton* anCancelBtn = findButton(PROP_PANEL_CANCEL);
526   anCancelBtn->setEnabled(theEnabled);
527 }
528
529 bool XGUI_PropertyPanel::isCancelEnabled() const
530 {
531   QToolButton* anCancelBtn = findButton(PROP_PANEL_CANCEL);
532   return anCancelBtn->isEnabled();
533 }
534
535 void XGUI_PropertyPanel::setEditingMode(bool isEditing)
536 {
537   ModuleBase_IPropertyPanel::setEditingMode(isEditing);
538   foreach(ModuleBase_ModelWidget* aWgt, myWidgets) {
539     aWgt->setEditingMode(isEditing);
540   }
541 }
542
543 void XGUI_PropertyPanel::setupActions(XGUI_ActionsMgr* theMgr)
544 {
545   QStringList aButtonNames;
546   aButtonNames << PROP_PANEL_OK << PROP_PANEL_CANCEL << PROP_PANEL_HELP << PROP_PANEL_PREVIEW;
547   QList<XGUI_ActionsMgr::OperationStateActionId> aActionIds;
548   aActionIds << XGUI_ActionsMgr::Accept << XGUI_ActionsMgr::Abort << XGUI_ActionsMgr::Help
549              << XGUI_ActionsMgr::Preview;
550   for (int i = 0; i < aButtonNames.size(); ++i) {
551     QToolButton* aBtn = findButton(aButtonNames.at(i).toStdString().c_str());
552     QAction* anAct = theMgr->operationStateAction(aActionIds.at(i));
553     aBtn->setDefaultAction(anAct);
554   }
555 }
556
557 ModuleBase_ModelWidget* XGUI_PropertyPanel::preselectionWidget() const
558 {
559   return myPreselectionWidget;
560 }
561
562 void XGUI_PropertyPanel::setPreselectionWidget(ModuleBase_ModelWidget* theWidget)
563 {
564   myPreselectionWidget = theWidget;
565 }
566
567
568 void XGUI_PropertyPanel::closeEvent(QCloseEvent* theEvent)
569 {
570   ModuleBase_Operation* aOp = myOperationMgr->currentOperation();
571   if (aOp) {
572     if (myOperationMgr->canStopOperation(aOp)) {
573       myOperationMgr->abortOperation(aOp);
574       if (myOperationMgr->hasOperation())
575         theEvent->ignore();
576       else
577         theEvent->accept();
578     } else
579       theEvent->ignore();
580   } else
581     ModuleBase_IPropertyPanel::closeEvent(theEvent);
582 }
583
584 QToolButton* XGUI_PropertyPanel::findButton(const char* theInternalName) const
585 {
586   return findChild<QToolButton*>(theInternalName);
587 }