Move cursot to end of text.

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-29 15:40:56 +02:00
parent 15691024ae
commit 8158261dcc
16 changed files with 39 additions and 1 deletions

View File

@ -218,6 +218,7 @@ void DialogAlongLine::setFormula(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formula); ui->plainTextEditFormula->setPlainText(formula);
line->setLength(formula); line->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -143,6 +143,7 @@ void DialogArc::SetF2(const QString &value)
} }
ui->plainTextEditF2->setPlainText(f2); ui->plainTextEditF2->setPlainText(f2);
path->setF2(f2); path->setF2(f2);
MoveCursorToEnd(ui->plainTextEditF2);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -160,6 +161,7 @@ void DialogArc::SetF1(const QString &value)
} }
ui->plainTextEditF1->setPlainText(f1); ui->plainTextEditF1->setPlainText(f1);
path->setF1(f1); path->setF1(f1);
MoveCursorToEnd(ui->plainTextEditF1);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -177,6 +179,7 @@ void DialogArc::SetRadius(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(radius); ui->plainTextEditFormula->setPlainText(radius);
path->setRadius(radius); path->setRadius(radius);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -219,6 +219,7 @@ void DialogBisector::setFormula(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formula); ui->plainTextEditFormula->setPlainText(formula);
line->setLength(formula); line->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -120,6 +120,7 @@ void DialogCurveIntersectAxis::setAngle(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formulaAngle); ui->plainTextEditFormula->setPlainText(formulaAngle);
line->setAngle(formulaAngle); line->setAngle(formulaAngle);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -162,6 +162,7 @@ void DialogCutArc::setFormula(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formula); ui->plainTextEditFormula->setPlainText(formula);
path->setLength(formula); path->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -101,6 +101,7 @@ void DialogCutSpline::setFormula(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formula); ui->plainTextEditFormula->setPlainText(formula);
path->setLength(formula); path->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -101,6 +101,7 @@ void DialogCutSplinePath::setFormula(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formula); ui->plainTextEditFormula->setPlainText(formula);
path->setLength(formula); path->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -123,6 +123,7 @@ void DialogEditWrongFormula::setFormula(const QString &value)
this->DeployFormulaTextEdit(); this->DeployFormulaTextEdit();
} }
ui->plainTextEditFormula->setPlainText(formula); ui->plainTextEditFormula->setPlainText(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -189,6 +189,7 @@ void DialogEndLine::setFormula(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formulaLength); ui->plainTextEditFormula->setPlainText(formulaLength);
line->setLength(formulaLength); line->setLength(formulaLength);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -207,6 +208,7 @@ void DialogEndLine::setAngle(const QString &value)
} }
ui->plainTextEditAngle->setPlainText(formulaAngle); ui->plainTextEditAngle->setPlainText(formulaAngle);
line->setAngle(formulaAngle); line->setAngle(formulaAngle);
MoveCursorToEnd(ui->plainTextEditAngle);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -632,14 +632,26 @@
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHereLength</tabstop>
<tabstop>toolButtonEqualLength</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>plainTextEditAngle</tabstop>
<tabstop>toolButtonPutHereAngle</tabstop>
<tabstop>toolButtonEqualAngle</tabstop>
<tabstop>pushButtonGrowLengthAngle</tabstop>
<tabstop>comboBoxBasePoint</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxLineType</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop> <tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop> <tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop> <tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop> <tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop> <tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop> <tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop> <tabstop>listWidget</tabstop>
<tabstop>toolButtonEqualLength</tabstop>
<tabstop>buttonBox</tabstop> <tabstop>buttonBox</tabstop>
</tabstops> </tabstops>
<resources> <resources>

View File

@ -121,6 +121,7 @@ void DialogLineIntersectAxis::setAngle(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formulaAngle); ui->plainTextEditFormula->setPlainText(formulaAngle);
line->setAngle(formulaAngle); line->setAngle(formulaAngle);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -229,6 +229,7 @@ void DialogNormal::setFormula(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formula); ui->plainTextEditFormula->setPlainText(formula);
line->setLength(formula); line->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -259,6 +259,7 @@ void DialogPointOfContact::setRadius(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(radius); ui->plainTextEditFormula->setPlainText(radius);
line->setRadius(radius); line->setRadius(radius);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -247,6 +247,7 @@ void DialogShoulderPoint::setFormula(const QString &value)
} }
ui->plainTextEditFormula->setPlainText(formula); ui->plainTextEditFormula->setPlainText(formula);
line->setLength(formula); line->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -392,6 +392,15 @@ void DialogTool::PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidg
} }
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::MoveCursorToEnd(QPlainTextEdit *plainTextEdit)
{
SCASSERT(plainTextEdit != nullptr);
QTextCursor cursor = plainTextEdit->textCursor();
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
plainTextEdit->setTextCursor(cursor);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief ValFormulaChanged handle change formula * @brief ValFormulaChanged handle change formula

View File

@ -333,6 +333,7 @@ protected:
* @brief SaveData Put dialog data in local variables * @brief SaveData Put dialog data in local variables
*/ */
virtual void SaveData(){} virtual void SaveData(){}
void MoveCursorToEnd(QPlainTextEdit *plainTextEdit);
private: private:
void FillList(QComboBox *box, const QMap<QString, quint32> &list)const; void FillList(QComboBox *box, const QMap<QString, quint32> &list)const;
}; };