From: Jérôme Date: Mon, 12 Oct 2020 16:46:16 +0000 (+0200) Subject: fix issue Button Add and new icon X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9fe36f9adc966bc4c663ec640d375a3296866914;p=modules%2Fshaper.git fix issue Button Add and new icon --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp b/src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp index ff9e6856a..bcd3c225d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp @@ -492,36 +492,38 @@ void FeaturesPlugin_WidgetFilletMultiRadiuses::onAdd() { QModelIndex index = myDataTbl->currentIndex(); int i = index.row(); - if( i != -1 - && myDataTbl->currentItem()->isSelected() && myDataTbl->rowCount() >2 ) - { - myDataTbl->blockSignals(true); + if( i == -1 ) + return false; - if ( i == myDataTbl->rowCount() -1) - i = myDataTbl->rowCount() - 2; + if( !myDataTbl->currentItem()->isSelected() && myDataTbl->rowCount() >2 ) + return false; - if ( i == 0) - i = 1; - else - i= i+1; - myDataTbl->model()->insertRow(i); + myDataTbl->blockSignals(true); - QTableWidgetItem* aItem =0; + if ( i == myDataTbl->rowCount() -1) + i = myDataTbl->rowCount() - 2; - aItem = myDataTbl->item( i, 0 ); - aItem = new QTableWidgetItem( "" ); - myDataTbl->setItem(i, 0, aItem); + if ( i == 0) + i = 1; + else + i= i+1; + myDataTbl->model()->insertRow(i); - aItem = new QTableWidgetItem("0.1"); - myDataTbl->setItem(i, 1, aItem); + QTableWidgetItem* aItem =0; - aItem = new QTableWidgetItem("0.5"); - myDataTbl->setItem(i, 2, aItem); - myDataTbl->blockSignals(false); + aItem = myDataTbl->item( i, 0 ); + aItem = new QTableWidgetItem( "" ); + myDataTbl->setItem(i, 0, aItem); - emit valuesChanged(); - myDataTbl->setCurrentCell( i, 0); - } + aItem = new QTableWidgetItem("0.1"); + myDataTbl->setItem(i, 1, aItem); + + aItem = new QTableWidgetItem("0.5"); + myDataTbl->setItem(i, 2, aItem); + myDataTbl->blockSignals(false); + + emit valuesChanged(); + myDataTbl->setCurrentCell( i, 0); } //********************************************************************************** diff --git a/src/FeaturesPlugin/icons/fillet_var_multiple_radiuses.png b/src/FeaturesPlugin/icons/fillet_var_multiple_radiuses.png index 56e4a78f3..1951a8e4f 100644 Binary files a/src/FeaturesPlugin/icons/fillet_var_multiple_radiuses.png and b/src/FeaturesPlugin/icons/fillet_var_multiple_radiuses.png differ