Fix bug with Variables Table.
Editing values were almost impossible or very hard because of changing a cursor position. --HG-- branch : develop
This commit is contained in:
parent
60d3b366b7
commit
9f9144dd56
|
@ -963,12 +963,14 @@ void DialogIncrements::SaveIncrName(const QString &text)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QTableWidgetItem *nameField = table->item(row, 0);
|
QTableWidgetItem *nameField = table->item(row, 0);
|
||||||
|
|
||||||
QString newName = text.isEmpty() ? GetCustomName() : CustomIncrSign + text;
|
QString newName = text.isEmpty() ? GetCustomName() : CustomIncrSign + text;
|
||||||
|
bool updateFlag = not text.isEmpty();
|
||||||
|
|
||||||
if (not data->IsUnique(newName))
|
if (not data->IsUnique(newName))
|
||||||
{
|
{
|
||||||
|
updateFlag = false;
|
||||||
qint32 num = 2;
|
qint32 num = 2;
|
||||||
QString name = newName;
|
QString name = newName;
|
||||||
do
|
do
|
||||||
|
@ -986,7 +988,7 @@ void DialogIncrements::SaveIncrName(const QString &text)
|
||||||
CacheRename(nameField->text(), newName);
|
CacheRename(nameField->text(), newName);
|
||||||
|
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
LocalUpdateTree();
|
updateFlag ? LocalUpdateTree() : nameField->setText(newName);
|
||||||
|
|
||||||
table->blockSignals(true);
|
table->blockSignals(true);
|
||||||
table->selectRow(row);
|
table->selectRow(row);
|
||||||
|
@ -1020,11 +1022,12 @@ void DialogIncrements::SaveIncrDescription()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QTextCursor cursor = textEdit->textCursor();
|
||||||
|
|
||||||
const QTableWidgetItem *nameField = table->item(row, 0);
|
const QTableWidgetItem *nameField = table->item(row, 0);
|
||||||
doc->SetIncrementDescription(nameField->text(), textEdit->toPlainText());
|
doc->SetIncrementDescription(nameField->text(), textEdit->toPlainText());
|
||||||
LocalUpdateTree();
|
LocalUpdateTree();
|
||||||
|
|
||||||
const QTextCursor cursor = textEdit->textCursor();
|
|
||||||
table->blockSignals(true);
|
table->blockSignals(true);
|
||||||
table->selectRow(row);
|
table->selectRow(row);
|
||||||
table->blockSignals(false);
|
table->blockSignals(false);
|
||||||
|
@ -1102,10 +1105,11 @@ void DialogIncrements::SaveIncrFormula()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QTextCursor cursor = textEdit->textCursor();
|
||||||
|
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
LocalUpdateTree();
|
LocalUpdateTree();
|
||||||
|
|
||||||
const QTextCursor cursor = textEdit->textCursor();
|
|
||||||
table->blockSignals(true);
|
table->blockSignals(true);
|
||||||
table->selectRow(row);
|
table->selectRow(row);
|
||||||
table->blockSignals(false);
|
table->blockSignals(false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user