Fix issue with cursor position in tabs increments and preview calculations.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-10-17 14:46:22 +03:00
parent 37b4206793
commit b693244847
2 changed files with 9 additions and 9 deletions

View File

@ -557,19 +557,21 @@ void DialogIncrements::LocalUpdateTree()
{ {
doc->LiteParseIncrements(); doc->LiteParseIncrements();
UpdateTree();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::UpdateTree()
{
int row = ui->tableWidgetIncrement->currentRow(); int row = ui->tableWidgetIncrement->currentRow();
FillIncrements(); FillIncrements();
ui->tableWidgetIncrement->blockSignals(true);
ui->tableWidgetIncrement->selectRow(row); ui->tableWidgetIncrement->selectRow(row);
ui->tableWidgetIncrement->blockSignals(false);
row = ui->tableWidgetPC->currentRow(); row = ui->tableWidgetPC->currentRow();
FillPreviewCalculations(); FillPreviewCalculations();
ui->tableWidgetPC->blockSignals(true);
ui->tableWidgetPC->selectRow(row); ui->tableWidgetPC->selectRow(row);
ui->tableWidgetPC->blockSignals(false);
search->RefreshList(ui->lineEditFind->text()); search->RefreshList(ui->lineEditFind->text());
searchPC->RefreshList(ui->lineEditFindPC->text()); searchPC->RefreshList(ui->lineEditFindPC->text());
@ -1209,7 +1211,7 @@ void DialogIncrements::Fx()
const QTableWidgetItem *nameField = table->item(row, 0); const QTableWidgetItem *nameField = table->item(row, 0);
QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(nameField->text()); QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(nameField->text());
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(incr->GetData(), NULL_ID, this); QScopedPointer<DialogEditWrongFormula> dialog(new DialogEditWrongFormula(incr->GetData(), NULL_ID, this));
dialog->setWindowTitle(tr("Edit increment")); dialog->setWindowTitle(tr("Edit increment"));
dialog->SetFormula(qApp->TrVars()->TryFormulaFromUser(plainTextEditFormula->toPlainText().replace("\n", " "), dialog->SetFormula(qApp->TrVars()->TryFormulaFromUser(plainTextEditFormula->toPlainText().replace("\n", " "),
qApp->Settings()->GetOsSeparator())); qApp->Settings()->GetOsSeparator()));
@ -1228,7 +1230,6 @@ void DialogIncrements::Fx()
table->selectRow(row); table->selectRow(row);
} }
delete dialog;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -129,7 +129,6 @@ private:
void EnableDetails(QTableWidget *table, bool enabled); void EnableDetails(QTableWidget *table, bool enabled);
void LocalUpdateTree(); void LocalUpdateTree();
void UpdateTree();
bool IncrementUsed(const QString &name) const; bool IncrementUsed(const QString &name) const;