From b693244847d7ae30ed965e6a44c441f798060525 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 17 Oct 2017 14:46:22 +0300 Subject: [PATCH] Fix issue with cursor position in tabs increments and preview calculations. --HG-- branch : develop --- src/app/valentina/dialogs/dialogincrements.cpp | 17 +++++++++-------- src/app/valentina/dialogs/dialogincrements.h | 1 - 2 files changed, 9 insertions(+), 9 deletions(-) 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;