{
QWidget* aWidget = qobject_cast<QWidget*>(theObject);
if (theEvent->type() == QEvent::FocusIn) {
- #ifdef _DEBUG
- // The following two lines are for debugging purpose only
QFocusEvent* aFocusEvent = dynamic_cast<QFocusEvent*>(theEvent);
- bool isWinFocus = aFocusEvent->reason() == Qt::ActiveWindowFocusReason;
- #endif
Qt::FocusReason aReason = aFocusEvent->reason();
bool aMouseOrKey = aReason == Qt::MouseFocusReason ||
/*aReason == Qt::TabFocusReason ||
QWidget* theWidget)
{
ModuleBase_ModelWidget* aModelWidget;
+ if (!theWidget)
+ return aModelWidget;
+
QObject* aParent = theWidget->parent();
while (aParent) {
aModelWidget = qobject_cast<ModuleBase_ModelWidget*>(aParent);
QList<ModuleBase_ModelWidget*>::const_iterator anIt = myWidgets.begin(), aLast = myWidgets.end();
bool isFoundWidget = false;
- //ModuleBase_Tools::activateWindow(this, "XGUI_PropertyPanel::activateNextWidget()");
+ ModuleBase_Tools::activateWindow(this, "XGUI_PropertyPanel::activateNextWidget()");
for (; anIt != aLast; anIt++) {
ModuleBase_ModelWidget* aCurrentWidget = *anIt;
if (isFoundWidget || !theWidget) {
}
}
- //ModuleBase_Tools::setFocus(aNewFocusWidget, "XGUI_PropertyPanel::focusNextPrevChild()");
- aNewFocusWidget->setFocus(theIsNext ? Qt::TabFocusReason : Qt::BacktabFocusReason);
+ ModuleBase_Tools::setFocus(aNewFocusWidget, "XGUI_PropertyPanel::focusNextPrevChild()");
+ //aNewFocusWidget->setFocus(theIsNext ? Qt::TabFocusReason : Qt::BacktabFocusReason);
ModuleBase_ModelWidget* aNewFocusMWidget = ModuleBase_ModelWidget::findModelWidget(this,
aNewFocusWidget);
// in order to operation manager could process key events of the panel.
// otherwise they are ignored. It happens only if the same(activateWindow) is
// not happened by property panel activation(e.g. resume operation of Sketch)
- //ModuleBase_Tools::activateWindow(myPropertyPanel, "XGUI_Workshop::showPropertyPanel()");
+ ModuleBase_Tools::activateWindow(myPropertyPanel, "XGUI_Workshop::showPropertyPanel()");
ModuleBase_Tools::setFocus(myPropertyPanel, "XGUI_Workshop::showPropertyPanel()");
}
// set the focus on it. As a result, shortcuts of the application, like
// are processed by this console. For example Undo actions.
// It is possible that this code is to be moved to SHAPER package
- //QMainWindow* aDesktop = desktop();
- //ModuleBase_Tools::activateWindow(aDesktop, "XGUI_Workshop::hidePropertyPanel()");
- //ModuleBase_Tools::setFocus(aDesktop, "XGUI_Workshop::showPropertyPanel()");
+ QMainWindow* aDesktop = desktop();
+ ModuleBase_Tools::activateWindow(aDesktop, "XGUI_Workshop::hidePropertyPanel()");
+ ModuleBase_Tools::setFocus(aDesktop, "XGUI_Workshop::showPropertyPanel()");
}
//******************************************************