X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FCollectionPlugin%2FCollectionPlugin_WidgetField.cpp;h=f1a5109eff7776b5efcb25e149698b1e29a4e433;hb=refs%2Fheads%2FCR35150;hp=52a54c022b656b3cf0bc8fd46d414673b00b3121;hpb=97917d3698f5a2f7fc9596e7c755ff8f6751e373;p=modules%2Fshaper.git diff --git a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp index 52a54c022..f1a5109ef 100644 --- a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp +++ b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -578,9 +578,9 @@ bool CollectionPlugin_WidgetField::restoreValueCustom() // Add selection names AttributeSelectionPtr aAttr = aSelList->value(k - 1); if (aItem) { - aItem->setText(aAttr->namingName().c_str()); + aItem->setText(QString::fromStdWString(aAttr->namingName())); } else { - aItem = new QTableWidgetItem(aAttr->namingName().c_str()); + aItem = new QTableWidgetItem(QString::fromStdWString(aAttr->namingName())); aTable->setItem(k, j, aItem); } } else if (j > 0) { @@ -598,9 +598,9 @@ bool CollectionPlugin_WidgetField::restoreValueCustom() } } // Restore columns width - for (int i = 0; i < aTable->columnCount(); i++) { - if (i < aColWidth.size()) - aTable->setColumnWidth(i, aColWidth.at(i)); + for (int col = 0; col < aTable->columnCount(); col++) { + if (col < aColWidth.size()) + aTable->setColumnWidth(col, aColWidth.at(col)); } aTable->blockSignals(isBlocked); @@ -769,8 +769,8 @@ void CollectionPlugin_WidgetField::onAddStep() aTable->setItem(j, i, aItem); } AttributeSelectionPtr aAttr = aSelList->value(j - 1); - aItem->setText(aAttr->namingName().c_str()); - aItem->setToolTip(aAttr->namingName().c_str()); + aItem->setText(QString::fromStdWString(aAttr->namingName())); + aItem->setToolTip(QString::fromStdWString(aAttr->namingName())); } } else { QString aDefVal = aTable->item(0, i)->text(); @@ -885,8 +885,8 @@ bool CollectionPlugin_WidgetField:: aTable->setItem(j, i, aItem); } AttributeSelectionPtr aAttr = aSelList->value(j - 1); - aItem->setText(aAttr->namingName().c_str()); - aItem->setToolTip(aAttr->namingName().c_str()); + aItem->setText(QString::fromStdWString(aAttr->namingName())); + aItem->setToolTip(QString::fromStdWString(aAttr->namingName())); } } else { QString aDefVal = aTable->item(0, i)->text(); @@ -904,8 +904,8 @@ bool CollectionPlugin_WidgetField:: // Update only selection name for(int j = 1; j < aNewRows - 1; j++) { AttributeSelectionPtr aAttr = aSelList->value(j); - aTable->item(j, 0)->setText(aAttr->namingName().c_str()); - aTable->item(j, 0)->setToolTip(aAttr->namingName().c_str()); + aTable->item(j, 0)->setText(QString::fromStdWString(aAttr->namingName())); + aTable->item(j, 0)->setToolTip(QString::fromStdWString(aAttr->namingName())); } } } @@ -975,6 +975,9 @@ void CollectionPlugin_WidgetField::onShapeTypeChanged(int theType) if (aTypeName == aSelList->selectionType()) return; aSelList->setSelectionType(aTypeName); + // Updated event has to be sent here in case if type of shapes + // was changed from Part to any other in order to updater Apply button status + myFeature->data()->sendAttributeUpdated(aSelList.get()); //Clear old selection clearData();