#4106 Stop trying to do recursive setting tab order widget

* The double pointer was handled wrongly and shift-tab order isn't working anyway.
This commit is contained in:
Gaute Lindkvist 2019-02-20 09:33:05 +01:00
parent 08c3c4cb0d
commit 66e57890dc
2 changed files with 11 additions and 13 deletions

View File

@ -76,11 +76,12 @@ caf::PdmUiFormLayoutObjectEditor::~PdmUiFormLayoutObjectEditor()
void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingInGridLayoutColumn(
const PdmUiOrdering& uiOrdering,
QWidget* containerWidgetWithGridLayout,
const QString& uiConfigName,
QWidget** previousTabOrderWidget)
const QString& uiConfigName)
{
CAF_ASSERT(containerWidgetWithGridLayout);
QWidget* previousTabOrderWidget = nullptr;
// Currently, only QGridLayout is supported
QGridLayout* parentLayout = dynamic_cast<QGridLayout*>(containerWidgetWithGridLayout->layout());
CAF_ASSERT(parentLayout);
@ -128,7 +129,7 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingIn
{
recursivelyAddGroupToGridLayout(currentItem, containerWidgetWithGridLayout,
uiConfigName, parentLayout, currentRowIndex,
currentColumn, itemColumnSpan, previousTabOrderWidget);
currentColumn, itemColumnSpan);
currentColumn += itemColumnSpan;
}
else
@ -215,12 +216,11 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingIn
currentColumn += fieldColumnSpan;
}
if (previousTabOrderWidget && *previousTabOrderWidget)
if (previousTabOrderWidget)
{
QWidget::setTabOrder(*previousTabOrderWidget, fieldEditorWidget);
QWidget::setTabOrder(previousTabOrderWidget, fieldEditorWidget);
}
//previousTabOrderWidget = &fieldEditorWidget;
previousTabOrderWidget = fieldEditorWidget;
}
fieldEditor->updateUi(uiConfigName);
}
@ -240,8 +240,7 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyAddGroupToGridLayout(PdmUiItem
QGridLayout* parentLayout,
int currentRowIndex,
int currentColumn,
int itemColumnSpan,
QWidget** previousTabOrderWidget)
int itemColumnSpan)
{
PdmUiGroup* group = static_cast<PdmUiGroup*>(currentItem);
@ -250,7 +249,7 @@ void caf::PdmUiFormLayoutObjectEditor::recursivelyAddGroupToGridLayout(PdmUiItem
/// Insert the group box at the correct position of the parent layout
parentLayout->addWidget(groupBox, currentRowIndex, currentColumn, 1, itemColumnSpan);
recursivelyConfigureAndUpdateUiOrderingInGridLayoutColumn(*group, groupBox->contentFrame(), uiConfigName, previousTabOrderWidget);
recursivelyConfigureAndUpdateUiOrderingInGridLayoutColumn(*group, groupBox->contentFrame(), uiConfigName);
}
//--------------------------------------------------------------------------------------------------

View File

@ -74,7 +74,7 @@ protected:
void recursivelyConfigureAndUpdateUiOrderingInGridLayoutColumn(const PdmUiOrdering& uiOrdering,
QWidget* containerWidgetWithGridLayout,
const QString& uiConfigName, QWidget** previousTabOrderWidget = nullptr);
const QString& uiConfigName);
void recursivelyAddGroupToGridLayout(PdmUiItem* currentItem,
QWidget* containerWidget,
@ -82,8 +82,7 @@ protected:
QGridLayout* parentLayout,
int currentRowIndex,
int currentColumn,
int itemColumnSpan,
QWidget** previousTabOrderWidget);
int itemColumnSpan);
QMinimizePanel* findOrCreateGroupBox(QWidget* parent, PdmUiGroup* group, const QString& uiConfigName);
PdmUiFieldEditorHandle* findOrCreateFieldEditor(QWidget* parent, PdmUiFieldHandle* field, const QString& uiConfigName);