From 5bb399c88a1cefa30c03754e57b6c684ce733018 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 23 Dec 2015 18:52:10 +0300 Subject: [PATCH] Correction tab logic. --- src/ModuleBase/ModuleBase_ModelWidget.cpp | 5 ----- src/ModuleBase/ModuleBase_ToolBox.cpp | 1 + src/XGUI/XGUI_PropertyPanel.cpp | 4 +++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index feba11647..fc7beb3e2 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -114,13 +114,8 @@ void ModuleBase_ModelWidget::enableFocusProcessing() { QList aMyControls = getControls(); foreach(QWidget* eachControl, aMyControls) { - if (myIsObligatory) { eachControl->setFocusPolicy(Qt::StrongFocus); eachControl->installEventFilter(this); - } - else { - eachControl->setFocusPolicy(Qt::NoFocus); - } } } diff --git a/src/ModuleBase/ModuleBase_ToolBox.cpp b/src/ModuleBase/ModuleBase_ToolBox.cpp index 592b5a032..57c7332c6 100644 --- a/src/ModuleBase/ModuleBase_ToolBox.cpp +++ b/src/ModuleBase/ModuleBase_ToolBox.cpp @@ -45,6 +45,7 @@ void ModuleBase_ToolBox::addItem( QWidget* thePage, const QString& theName, cons myStack->addWidget( thePage ); QToolButton* aButton = new QToolButton( myButtonsFrame ); + aButton->setFocusPolicy(Qt::StrongFocus); aButton->setCheckable( true ); aButton->setIcon( theIcon ); aButton->setIconSize( theIcon.size() ); diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 1e61bf5e7..a189af9bd 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -171,6 +171,8 @@ void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget) if (!aValidators->isCase(aCurrentWidget->feature(), aCurrentWidget->attributeID())) continue; // this attribute is not participated in the current case + if (!aCurrentWidget->isObligatory()) + continue; // not obligatory widgets are not activated automatically if (aCurrentWidget->focusTo()) { return; @@ -180,7 +182,7 @@ void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget) } activateWidget(NULL); } - +//#define DEBUG_TAB #ifdef DEBUG_TAB void findDirectChildren(QWidget* theParent, QList& theWidgets, const bool theDebug) { -- 2.39.2