Remember cursor position and return focus to the formula field.
--HG-- branch : develop
This commit is contained in:
parent
55421d196b
commit
8aea332cda
|
@ -638,7 +638,10 @@ void DialogIncrements::SaveIncrFormula()
|
||||||
void DialogIncrements::DeployFormula()
|
void DialogIncrements::DeployFormula()
|
||||||
{
|
{
|
||||||
SCASSERT(ui->plainTextEditFormula != nullptr);
|
SCASSERT(ui->plainTextEditFormula != nullptr);
|
||||||
SCASSERT(ui->pushButtonGrow != nullptr)
|
SCASSERT(ui->pushButtonGrow != nullptr);
|
||||||
|
|
||||||
|
const QTextCursor cursor = ui->plainTextEditFormula->textCursor();
|
||||||
|
|
||||||
if (ui->plainTextEditFormula->height() < DIALOG_MAX_FORMULA_HEIGHT)
|
if (ui->plainTextEditFormula->height() < DIALOG_MAX_FORMULA_HEIGHT)
|
||||||
{
|
{
|
||||||
ui->plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT);
|
ui->plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT);
|
||||||
|
@ -659,6 +662,9 @@ void DialogIncrements::DeployFormula()
|
||||||
setUpdatesEnabled(false);
|
setUpdatesEnabled(false);
|
||||||
repaint();
|
repaint();
|
||||||
setUpdatesEnabled(true);
|
setUpdatesEnabled(true);
|
||||||
|
|
||||||
|
ui->plainTextEditFormula->setFocus();
|
||||||
|
ui->plainTextEditFormula->setTextCursor(cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -535,7 +535,10 @@ bool DialogTool::SetObject(const quint32 &id, QComboBox *box, const QString &too
|
||||||
void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight)
|
void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight)
|
||||||
{
|
{
|
||||||
SCASSERT(formula != nullptr);
|
SCASSERT(formula != nullptr);
|
||||||
SCASSERT(buttonGrowLength != nullptr)
|
SCASSERT(buttonGrowLength != nullptr);
|
||||||
|
|
||||||
|
const QTextCursor cursor = formula->textCursor();
|
||||||
|
|
||||||
if (formula->height() < DIALOG_MAX_FORMULA_HEIGHT)
|
if (formula->height() < DIALOG_MAX_FORMULA_HEIGHT)
|
||||||
{
|
{
|
||||||
formula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT);
|
formula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT);
|
||||||
|
@ -556,6 +559,9 @@ void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowL
|
||||||
setUpdatesEnabled(false);
|
setUpdatesEnabled(false);
|
||||||
repaint();
|
repaint();
|
||||||
setUpdatesEnabled(true);
|
setUpdatesEnabled(true);
|
||||||
|
|
||||||
|
formula->setFocus();
|
||||||
|
formula->setTextCursor(cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user