diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index 907597926..d4c7a1484 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -557,19 +557,21 @@ void DialogIncrements::LocalUpdateTree() { doc->LiteParseIncrements(); - UpdateTree(); -} - -//--------------------------------------------------------------------------------------------------------------------- -void DialogIncrements::UpdateTree() -{ int row = ui->tableWidgetIncrement->currentRow(); + FillIncrements(); + + ui->tableWidgetIncrement->blockSignals(true); ui->tableWidgetIncrement->selectRow(row); + ui->tableWidgetIncrement->blockSignals(false); row = ui->tableWidgetPC->currentRow(); + FillPreviewCalculations(); + + ui->tableWidgetPC->blockSignals(true); ui->tableWidgetPC->selectRow(row); + ui->tableWidgetPC->blockSignals(false); search->RefreshList(ui->lineEditFind->text()); searchPC->RefreshList(ui->lineEditFindPC->text()); @@ -1209,7 +1211,7 @@ void DialogIncrements::Fx() const QTableWidgetItem *nameField = table->item(row, 0); QSharedPointer incr = data->GetVariable(nameField->text()); - DialogEditWrongFormula *dialog = new DialogEditWrongFormula(incr->GetData(), NULL_ID, this); + QScopedPointer dialog(new DialogEditWrongFormula(incr->GetData(), NULL_ID, this)); dialog->setWindowTitle(tr("Edit increment")); dialog->SetFormula(qApp->TrVars()->TryFormulaFromUser(plainTextEditFormula->toPlainText().replace("\n", " "), qApp->Settings()->GetOsSeparator())); @@ -1228,7 +1230,6 @@ void DialogIncrements::Fx() table->selectRow(row); } - delete dialog; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/valentina/dialogs/dialogincrements.h b/src/app/valentina/dialogs/dialogincrements.h index 96c48265e..b753665cd 100644 --- a/src/app/valentina/dialogs/dialogincrements.h +++ b/src/app/valentina/dialogs/dialogincrements.h @@ -129,7 +129,6 @@ private: void EnableDetails(QTableWidget *table, bool enabled); void LocalUpdateTree(); - void UpdateTree(); bool IncrementUsed(const QString &name) const;