diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp
index cbb375364..af7dd47f4 100644
--- a/src/app/dialogs/tools/dialogalongline.cpp
+++ b/src/app/dialogs/tools/dialogalongline.cpp
@@ -66,9 +66,6 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogAlongLine::DeployFormulaTextEdit);
InitVariables(ui);
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal);
-
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -80,20 +77,7 @@ void DialogAlongLine::FormulaTextChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogAlongLine::DeployFormulaTextEdit()
{
- if (ui->plainTextEditFormula->height() < DIALOGALONLINE_MAX_FORMULA_HEIGHT)
- {
- ui->plainTextEditFormula->setFixedHeight(DIALOGALONLINE_MAX_FORMULA_HEIGHT);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png")));
- }
- else
- {
- ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
- }
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h
index 581d67269..478aef06b 100644
--- a/src/app/dialogs/tools/dialogalongline.h
+++ b/src/app/dialogs/tools/dialogalongline.h
@@ -31,7 +31,6 @@
#include "dialogtool.h"
-#define DIALOGALONLINE_MAX_FORMULA_HEIGHT 64
namespace Ui
{
class DialogAlongLine;
diff --git a/src/app/dialogs/tools/dialogalongline.ui b/src/app/dialogs/tools/dialogalongline.ui
index 5bf4d8691..41f3e0fd4 100644
--- a/src/app/dialogs/tools/dialogalongline.ui
+++ b/src/app/dialogs/tools/dialogalongline.ui
@@ -160,6 +160,12 @@
-
+
+
+ 0
+ 0
+
+
16777215
@@ -189,8 +195,7 @@
-
- :/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png:/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png
+
@@ -468,7 +473,6 @@
-
diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp
index c32e5e514..14d0f2d00 100644
--- a/src/app/dialogs/tools/dialogarc.cpp
+++ b/src/app/dialogs/tools/dialogarc.cpp
@@ -44,10 +44,14 @@
DialogArc::DialogArc(const VContainer *data, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false),
timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(0), radius(QString()), f1(QString()),
- f2(QString()), formulaBaseHeight(0)
+ f2(QString()), formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0)
{
ui->setupUi(this);
+ InitVariables(ui);
+
+ plainTextEditFormula = ui->plainTextEditFormula;
+
timerRadius = new QTimer(this);
connect(timerRadius, &QTimer::timeout, this, &DialogArc::EvalRadius);
@@ -60,13 +64,13 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent)
InitOkCancelApply(ui);
this->formulaBaseHeight=ui->plainTextEditFormula->height();
+ this->formulaBaseHeightF1=ui->plainTextEditF1->height();
+ this->formulaBaseHeightF2=ui->plainTextEditF2->height();
FillComboBoxPoints(ui->comboBoxBasePoint);
CheckState();
- InitVariables(ui);
-
connect(ui->toolButtonPutHereRadius, &QPushButton::clicked, this, &DialogArc::PutRadius);
connect(ui->toolButtonPutHereF1, &QPushButton::clicked, this, &DialogArc::PutF1);
connect(ui->toolButtonPutHereF2, &QPushButton::clicked, this, &DialogArc::PutF2);
@@ -76,31 +80,30 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent)
connect(ui->toolButtonEqualF2, &QPushButton::clicked, this, &DialogArc::EvalF2);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogArc::RadiusChanged);
- connect(ui->lineEditF1, &QLineEdit::textChanged, this, &DialogArc::F1Changed);
- connect(ui->lineEditF2, &QLineEdit::textChanged, this, &DialogArc::F2Changed);
- connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogArc::DeployFormulaTextEdit);
+ connect(ui->plainTextEditF1, &QPlainTextEdit::textChanged, this, &DialogArc::F1Changed);
+ connect(ui->plainTextEditF2, &QPlainTextEdit::textChanged, this, &DialogArc::F2Changed);
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
+ connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogArc::DeployFormulaTextEdit);
+ connect(ui->pushButtonGrowLengthF1, &QPushButton::clicked, this, &DialogArc::DeployF1TextEdit);
+ connect(ui->pushButtonGrowLengthF2, &QPushButton::clicked, this, &DialogArc::DeployF2TextEdit);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogArc::DeployFormulaTextEdit()
{
- if (ui->plainTextEditFormula->height() < DIALOGARC_MAX_FORMULA_HEIGHT)
- {
- ui->plainTextEditFormula->setFixedHeight(DIALOGARC_MAX_FORMULA_HEIGHT);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png")));
- }
- else
- {
- ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
- }
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void DialogArc::DeployF1TextEdit()
+{
+ DeployFormula(ui->plainTextEditF1, ui->pushButtonGrowLengthF1, formulaBaseHeightF1);
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void DialogArc::DeployF2TextEdit()
+{
+ DeployFormula(ui->plainTextEditF2, ui->pushButtonGrowLengthF2, formulaBaseHeightF2);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -127,8 +130,13 @@ void DialogArc::SetCenter(const quint32 &value)
*/
void DialogArc::SetF2(const QString &value)
{
- f2 = value;
- ui->lineEditF2->setText(f2);
+ f2 = qApp->FormulaToUser(value);
+ // increase height if needed.
+ if (f2.length() > 80)
+ {
+ this->DeployF2TextEdit();
+ }
+ ui->plainTextEditF2->setPlainText(f2);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -138,8 +146,13 @@ void DialogArc::SetF2(const QString &value)
*/
void DialogArc::SetF1(const QString &value)
{
- f1 = value;
- ui->lineEditF1->setText(f1);
+ f1 = qApp->FormulaToUser(value);
+ // increase height if needed.
+ if (f1.length() > 80)
+ {
+ this->DeployF1TextEdit();
+ }
+ ui->plainTextEditF1->setPlainText(f1);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -197,8 +210,10 @@ void DialogArc::SaveData()
{
radius = ui->plainTextEditFormula->toPlainText();
radius.replace("\n", " ");
- f1 = ui->lineEditF1->text();
- f2 = ui->lineEditF2->text();
+ f1 = ui->plainTextEditF1->toPlainText();
+ f1.replace("\n", " ");
+ f2 = ui->plainTextEditF2->toPlainText();
+ f2.replace("\n", " ");
center = getCurrentObjectId(ui->comboBoxBasePoint);
}
@@ -239,7 +254,7 @@ void DialogArc::PutRadius()
*/
void DialogArc::PutF1()
{
- PutValHere(ui->lineEditF1, ui->listWidget);
+ PutValHere(ui->plainTextEditF1, ui->listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -248,7 +263,7 @@ void DialogArc::PutF1()
*/
void DialogArc::PutF2()
{
- PutValHere(ui->lineEditF2, ui->listWidget);
+ PutValHere(ui->plainTextEditF2, ui->listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -278,7 +293,7 @@ void DialogArc::RadiusChanged()
void DialogArc::F1Changed()
{
labelEditFormula = ui->labelEditF1;
- ValFormulaChanged(flagF1, ui->lineEditF1, timerF1);
+ ValFormulaChanged(flagF1, ui->plainTextEditF1, timerF1);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -288,7 +303,7 @@ void DialogArc::F1Changed()
void DialogArc::F2Changed()
{
labelEditFormula = ui->labelEditF2;
- ValFormulaChanged(flagF2, ui->lineEditF2, timerF2);
+ ValFormulaChanged(flagF2, ui->plainTextEditF2, timerF2);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -320,7 +335,7 @@ void DialogArc::EvalRadius()
void DialogArc::EvalF1()
{
labelEditFormula = ui->labelEditF1;
- Eval(ui->lineEditF1->text(), flagF1, timerF1, ui->labelResultF1);
+ Eval(ui->plainTextEditF1->toPlainText(), flagF1, timerF1, ui->labelResultF1);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -330,7 +345,7 @@ void DialogArc::EvalF1()
void DialogArc::EvalF2()
{
labelEditFormula = ui->labelEditF2;
- Eval(ui->lineEditF2->text(), flagF2, timerF2, ui->labelResultF2);
+ Eval(ui->plainTextEditF2->toPlainText(), flagF2, timerF2, ui->labelResultF2);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogarc.h b/src/app/dialogs/tools/dialogarc.h
index 411e46f4a..74e1c9ee6 100644
--- a/src/app/dialogs/tools/dialogarc.h
+++ b/src/app/dialogs/tools/dialogarc.h
@@ -31,7 +31,6 @@
#include "dialogtool.h"
-#define DIALOGARC_MAX_FORMULA_HEIGHT 64
namespace Ui
{
class DialogArc;
@@ -69,6 +68,8 @@ public slots:
* @brief DeployFormulaTextEdit grow or shrink formula input
*/
void DeployFormulaTextEdit();
+ void DeployF1TextEdit();
+ void DeployF2TextEdit();
virtual void ValChenged(int row);
void PutRadius();
void PutF1();
@@ -118,6 +119,8 @@ private:
/** @brief formulaBaseHeight base height defined by dialogui */
int formulaBaseHeight;
+ int formulaBaseHeightF1;
+ int formulaBaseHeightF2;
void EvalRadius();
void EvalF1();
diff --git a/src/app/dialogs/tools/dialogarc.ui b/src/app/dialogs/tools/dialogarc.ui
index 606cf83c4..4ffd32682 100644
--- a/src/app/dialogs/tools/dialogarc.ui
+++ b/src/app/dialogs/tools/dialogarc.ui
@@ -23,9 +23,6 @@
-
-
- QLayout::SetDefaultConstraint
-
-
@@ -77,50 +74,17 @@
-
-
-
+
+
+ Qt::Horizontal
+
+
- 16777215
- 24
+ 40
+ 20
-
-
- -
-
-
-
- 18
- 18
-
-
-
-
- 0
- 0
-
-
-
- <html><head/><body><p>Show full calculation in message box</p></body></html>
-
-
-
-
-
-
-
-
-
-
-
- 16
- 16
-
-
-
- true
-
-
+
-
@@ -186,6 +150,60 @@
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 24
+
+
+
+
+ -
+
+
+
+ 18
+ 18
+
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>Show full calculation in message box</p></body></html>
+
+
+
+
+
+
+
+
+
+ 16
+ 16
+
+
+
+ true
+
+
+
+
+
-
-
@@ -239,17 +257,17 @@
-
-
-
-
- 0
- 0
-
+
+
+ Qt::Horizontal
-
- First angle of arc counterclockwise
+
+
+ 40
+ 20
+
-
+
-
@@ -315,6 +333,60 @@
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 24
+
+
+
+
+ -
+
+
+
+ 18
+ 18
+
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>Show full calculation in message box</p></body></html>
+
+
+
+
+
+
+
+
+
+ 16
+ 16
+
+
+
+ true
+
+
+
+
+
-
-
@@ -368,17 +440,17 @@
-
-
-
-
- 0
- 0
-
+
+
+ Qt::Horizontal
-
- Second angle of arc counterclockwise
+
+
+ 40
+ 20
+
-
+
-
@@ -444,6 +516,60 @@
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 24
+
+
+
+
+ -
+
+
+
+ 18
+ 18
+
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>Show full calculation in message box</p></body></html>
+
+
+
+
+
+
+
+
+
+ 16
+ 16
+
+
+
+ true
+
+
+
+
+
-
-
@@ -623,8 +749,6 @@
- lineEditF1
- lineEditF2
comboBoxBasePoint
radioButtonSizeGrowth
radioButtonStandardTable
diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp
index 0eb457e48..8f7f713ac 100644
--- a/src/app/dialogs/tools/dialogbisector.cpp
+++ b/src/app/dialogs/tools/dialogbisector.cpp
@@ -68,9 +68,6 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogBisector::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogBisector::DeployFormulaTextEdit);
-
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -82,20 +79,7 @@ void DialogBisector::FormulaTextChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogBisector::DeployFormulaTextEdit()
{
- if (ui->plainTextEditFormula->height() < DIALOGBISECTOR_MAX_FORMULA_HEIGHT)
- {
- ui->plainTextEditFormula->setFixedHeight(DIALOGBISECTOR_MAX_FORMULA_HEIGHT);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png")));
- }
- else
- {
- ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
- }
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h
index 700f48c18..8757d482f 100644
--- a/src/app/dialogs/tools/dialogbisector.h
+++ b/src/app/dialogs/tools/dialogbisector.h
@@ -31,7 +31,6 @@
#include "dialogtool.h"
-#define DIALOGBISECTOR_MAX_FORMULA_HEIGHT 64
namespace Ui
{
class DialogBisector;
diff --git a/src/app/dialogs/tools/dialogbisector.ui b/src/app/dialogs/tools/dialogbisector.ui
index 5c634c8aa..14a44ddb3 100644
--- a/src/app/dialogs/tools/dialogbisector.ui
+++ b/src/app/dialogs/tools/dialogbisector.ui
@@ -151,6 +151,12 @@
-
+
+
+ 0
+ 0
+
+
16777215
@@ -180,7 +186,7 @@
-
+
diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp
index e4791526c..c597e4efe 100644
--- a/src/app/dialogs/tools/dialogcutarc.cpp
+++ b/src/app/dialogs/tools/dialogcutarc.cpp
@@ -64,9 +64,6 @@ DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent)
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutArc::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutArc::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit);
-
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -78,20 +75,7 @@ void DialogCutArc::FormulaTextChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogCutArc::DeployFormulaTextEdit()
{
- if (ui->plainTextEditFormula->height() < DIALOGCUTARC_MAX_FORMULA_HEIGHT)
- {
- ui->plainTextEditFormula->setFixedHeight(DIALOGCUTARC_MAX_FORMULA_HEIGHT);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png")));
- }
- else
- {
- ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
- }
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h
index f4a6b6a13..02cb79b66 100644
--- a/src/app/dialogs/tools/dialogcutarc.h
+++ b/src/app/dialogs/tools/dialogcutarc.h
@@ -31,7 +31,6 @@
#include "dialogtool.h"
-#define DIALOGCUTARC_MAX_FORMULA_HEIGHT 64
namespace Ui
{
class DialogCutArc;
diff --git a/src/app/dialogs/tools/dialogcutarc.ui b/src/app/dialogs/tools/dialogcutarc.ui
index c79294e69..3450b24fe 100644
--- a/src/app/dialogs/tools/dialogcutarc.ui
+++ b/src/app/dialogs/tools/dialogcutarc.ui
@@ -144,6 +144,12 @@
-
+
+
+ 0
+ 0
+
+
16777215
@@ -173,9 +179,7 @@
-
-
-
+
diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp
index 979c3d34f..fffa1f87d 100644
--- a/src/app/dialogs/tools/dialogcutspline.cpp
+++ b/src/app/dialogs/tools/dialogcutspline.cpp
@@ -39,12 +39,13 @@
* @param parent parent widget
*/
DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
- :DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0)
+ :DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0),
+ formulaBaseHeight(0)
{
ui->setupUi(this);
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
- lineEditFormula = ui->lineEditFormula;
+ plainTextEditFormula = ui->plainTextEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
InitOkCancel(ui);
@@ -53,13 +54,16 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
flagName = false;
CheckState();
+ this->formulaBaseHeight=ui->plainTextEditFormula->height();
+
FillComboBoxSplines(ui->comboBoxSpline);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSpline::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSpline::PutVal);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSpline::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSpline::NamePointChanged);
- connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSpline::FormulaChanged);
+ connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSpline::FormulaChanged);
+ connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSpline::DeployFormulaTextEdit);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -87,7 +91,13 @@ void DialogCutSpline::setPointName(const QString &value)
void DialogCutSpline::setFormula(const QString &value)
{
formula = qApp->FormulaToUser(value);
- ui->lineEditFormula->setText(formula);
+ // increase height if needed. TODO : see if I can get the max number of caracters in one line
+ // of this PlainTextEdit to change 80 to this value
+ if (formula.length() > 80)
+ {
+ this->DeployFormulaTextEdit();
+ }
+ ui->plainTextEditFormula->setPlainText(formula);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -125,7 +135,14 @@ void DialogCutSpline::ChoosedObject(quint32 id, const SceneObject &type)
void DialogCutSpline::DialogAccepted()
{
pointName = ui->lineEditNamePoint->text();
- formula = ui->lineEditFormula->text();
+ formula = ui->plainTextEditFormula->toPlainText();
+ formula.replace("\n", " ");
splineId = getCurrentObjectId(ui->comboBoxSpline);
emit DialogClosed(QDialog::Accepted);
}
+
+//---------------------------------------------------------------------------------------------------------------------
+void DialogCutSpline::DeployFormulaTextEdit()
+{
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
+}
diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h
index 03be441cb..810658c39 100644
--- a/src/app/dialogs/tools/dialogcutspline.h
+++ b/src/app/dialogs/tools/dialogcutspline.h
@@ -61,6 +61,10 @@ public slots:
* @brief DialogApply apply data and emit signal about applied dialog.
*/
virtual void DialogApply(){}
+ /**
+ * @brief DeployFormulaTextEdit grow or shrink formula input
+ */
+ void DeployFormulaTextEdit();
private:
Q_DISABLE_COPY(DialogCutSpline)
@@ -75,6 +79,9 @@ private:
/** @brief splineId keep id of spline */
quint32 splineId;
+
+ /** @brief formulaBaseHeight base height defined by dialogui */
+ int formulaBaseHeight;
};
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogcutspline.ui b/src/app/dialogs/tools/dialogcutspline.ui
index 4fb194f59..7e564cda5 100644
--- a/src/app/dialogs/tools/dialogcutspline.ui
+++ b/src/app/dialogs/tools/dialogcutspline.ui
@@ -6,7 +6,7 @@
0
0
- 520
+ 665
546
@@ -67,17 +67,17 @@
-
-
-
-
- 0
- 0
-
+
+
+ Qt::Horizontal
-
- Formula for the calculation of the spline
+
+
+ 40
+ 20
+
-
+
-
@@ -140,6 +140,60 @@
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 24
+
+
+
+
+ -
+
+
+
+ 18
+ 18
+
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>Show full calculation in message box</p></body></html>
+
+
+
+
+
+
+
+
+
+ 16
+ 16
+
+
+
+ true
+
+
+
+
+
-
-
diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp
index 725c1ef62..ee38e9a3b 100644
--- a/src/app/dialogs/tools/dialogcutsplinepath.cpp
+++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp
@@ -40,12 +40,12 @@
*/
DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()),
- splinePathId(0)
+ splinePathId(0), formulaBaseHeight(0)
{
ui->setupUi(this);
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
- lineEditFormula = ui->lineEditFormula;
+ plainTextEditFormula = ui->plainTextEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
@@ -53,6 +53,7 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent
flagFormula = false;
flagName = false;
CheckState();
+ this->formulaBaseHeight=ui->plainTextEditFormula->height();
FillComboBoxSplinesPath(ui->comboBoxSplinePath);
@@ -60,7 +61,8 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSplinePath::PutVal);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSplinePath::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSplinePath::NamePointChanged);
- connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged);
+ connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged);
+ connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -88,7 +90,13 @@ void DialogCutSplinePath::setPointName(const QString &value)
void DialogCutSplinePath::setFormula(const QString &value)
{
formula = qApp->FormulaToUser(value);
- ui->lineEditFormula->setText(formula);
+ // increase height if needed. TODO : see if I can get the max number of caracters in one line
+ // of this PlainTextEdit to change 80 to this value
+ if (formula.length() > 80)
+ {
+ this->DeployFormulaTextEdit();
+ }
+ ui->plainTextEditFormula->setPlainText(formula);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -126,7 +134,14 @@ void DialogCutSplinePath::ChoosedObject(quint32 id, const SceneObject &type)
void DialogCutSplinePath::DialogAccepted()
{
pointName = ui->lineEditNamePoint->text();
- formula = ui->lineEditFormula->text();
+ formula = ui->plainTextEditFormula->toPlainText();
+ formula.replace("\n", " ");
splinePathId = getCurrentObjectId(ui->comboBoxSplinePath);
emit DialogClosed(QDialog::Accepted);
}
+
+//---------------------------------------------------------------------------------------------------------------------
+void DialogCutSplinePath::DeployFormulaTextEdit()
+{
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
+}
diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h
index 0dd7d421f..8bd39f888 100644
--- a/src/app/dialogs/tools/dialogcutsplinepath.h
+++ b/src/app/dialogs/tools/dialogcutsplinepath.h
@@ -61,6 +61,10 @@ public slots:
* @brief DialogApply apply data and emit signal about applied dialog.
*/
virtual void DialogApply(){}
+ /**
+ * @brief DeployFormulaTextEdit grow or shrink formula input
+ */
+ void DeployFormulaTextEdit();
private:
Q_DISABLE_COPY(DialogCutSplinePath)
@@ -75,6 +79,9 @@ private:
/** @brief splinePathId keep id of splinePath */
quint32 splinePathId;
+
+ /** @brief formulaBaseHeight base height defined by dialogui */
+ int formulaBaseHeight;
};
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogcutsplinepath.ui b/src/app/dialogs/tools/dialogcutsplinepath.ui
index 26351262b..7a441a07c 100644
--- a/src/app/dialogs/tools/dialogcutsplinepath.ui
+++ b/src/app/dialogs/tools/dialogcutsplinepath.ui
@@ -6,7 +6,7 @@
0
0
- 605
+ 464
499
@@ -67,17 +67,17 @@
-
-
-
-
- 0
- 0
-
+
+
+ Qt::Horizontal
-
- Formula for the calculation of the curve length
+
+
+ 40
+ 20
+
-
+
-
@@ -140,6 +140,60 @@
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 24
+
+
+
+
+ -
+
+
+
+ 18
+ 18
+
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>Show full calculation in message box</p></body></html>
+
+
+
+
+
+
+
+
+
+ 16
+ 16
+
+
+
+ true
+
+
+
+
+
-
-
diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp
index c303e8895..6cf8a7b10 100644
--- a/src/app/dialogs/tools/dialogeditwrongformula.cpp
+++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp
@@ -31,24 +31,26 @@
//---------------------------------------------------------------------------------------------------------------------
DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, QWidget *parent)
- :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString())
+ :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), formulaBaseHeight(0)
{
ui->setupUi(this);
InitVariables(ui);
labelResultCalculation = ui->labelResult;
- lineEditFormula = ui->lineEditFormula;
+ plainTextEditFormula = ui->plainTextEditFormula;
labelEditFormula = ui->labelFormula;
InitOkCancel(ui);
flagFormula = false;
CheckState();
+ this->formulaBaseHeight=ui->plainTextEditFormula->height();
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogEditWrongFormula::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEditWrongFormula::PutVal);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogEditWrongFormula::EvalFormula);
- connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged);
+ connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged);
+ connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEditWrongFormula::DeployFormulaTextEdit);
//Disable Qt::WaitCursor
#ifndef QT_NO_CURSOR
@@ -68,7 +70,8 @@ DialogEditWrongFormula::~DialogEditWrongFormula()
//---------------------------------------------------------------------------------------------------------------------
void DialogEditWrongFormula::DialogAccepted()
{
- formula = ui->lineEditFormula->text();
+ formula = ui->plainTextEditFormula->toPlainText();
+ formula.replace("\n", " ");
emit DialogClosed(QDialog::Accepted);
accepted();
}
@@ -80,6 +83,12 @@ void DialogEditWrongFormula::DialogRejected()
rejected();
}
+//---------------------------------------------------------------------------------------------------------------------
+void DialogEditWrongFormula::DeployFormulaTextEdit()
+{
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
+}
+
//---------------------------------------------------------------------------------------------------------------------
void DialogEditWrongFormula::CheckState()
{
@@ -91,7 +100,13 @@ void DialogEditWrongFormula::CheckState()
void DialogEditWrongFormula::setFormula(const QString &value)
{
formula = qApp->FormulaToUser(value);
- ui->lineEditFormula->setText(formula);
+ // increase height if needed. TODO : see if I can get the max number of caracters in one line
+ // of this PlainTextEdit to change 80 to this value
+ if (formula.length() > 80)
+ {
+ this->DeployFormulaTextEdit();
+ }
+ ui->plainTextEditFormula->setPlainText(formula);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogeditwrongformula.h b/src/app/dialogs/tools/dialogeditwrongformula.h
index d7e22f6de..f1459f69d 100644
--- a/src/app/dialogs/tools/dialogeditwrongformula.h
+++ b/src/app/dialogs/tools/dialogeditwrongformula.h
@@ -56,6 +56,10 @@ public:
public slots:
virtual void DialogAccepted();
virtual void DialogRejected();
+ /**
+ * @brief DeployFormulaTextEdit grow or shrink formula input
+ */
+ void DeployFormulaTextEdit();
protected:
virtual void CheckState();
private:
@@ -64,6 +68,9 @@ private:
/** @brief formula string with formula */
QString formula;
+
+ /** @brief formulaBaseHeight base height defined by dialogui */
+ int formulaBaseHeight;
};
diff --git a/src/app/dialogs/tools/dialogeditwrongformula.ui b/src/app/dialogs/tools/dialogeditwrongformula.ui
index 15e900f08..fa86b6032 100644
--- a/src/app/dialogs/tools/dialogeditwrongformula.ui
+++ b/src/app/dialogs/tools/dialogeditwrongformula.ui
@@ -6,305 +6,357 @@
0
0
- 607
+ 507
535
Edit wrong formula
-
+
-
-
+
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
- 255
- 0
- 0
-
-
-
-
-
-
-
-
- 255
- 0
- 0
-
-
-
-
-
-
-
-
- 159
- 158
- 158
-
-
-
-
-
-
-
- Formula
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- First angle of arc counterclockwise
-
-
-
- -
-
-
- Insert variable into formula
-
-
- ...
-
-
-
- :/icon/24x24/putHereLeft.png:/icon/24x24/putHereLeft.png
-
-
-
- 24
- 24
-
-
-
-
- -
-
-
- Calculate value
-
-
- ...
-
-
-
- :/icon/24x24/equal.png:/icon/24x24/equal.png
-
-
-
- 24
- 24
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 87
- 0
-
-
-
- Value of first angle
-
-
- _
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
- 0
- 0
-
-
-
- Input data
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Size and height
-
-
- true
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Standard table
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Increments
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- Length of lines
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- Length of arcs
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- Length of curves
-
-
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- Angle of lines
-
-
-
-
-
-
-
- -
-
-
- Variables
-
-
-
-
-
- -
-
-
-
+
+
+
+ 0
+ 0
+
-
- true
+
+
+
+
+
+
+ 255
+ 0
+ 0
+
+
+
+
+
+
+
+
+ 255
+ 0
+ 0
+
+
+
+
+
+
+
+
+ 159
+ 158
+ 158
+
+
+
+
+
+
+
+ Formula
-
-
+
Qt::Horizontal
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Insert variable into formula
+
+
+ ...
+
+
+
+ :/icon/24x24/putHereLeft.png:/icon/24x24/putHereLeft.png
+
+
+
+ 24
+ 24
+
+
+
+
+ -
+
+
+ Calculate value
+
+
+ ...
+
+
+
+ :/icon/24x24/equal.png:/icon/24x24/equal.png
+
+
+
+ 24
+ 24
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 87
+ 0
+
+
+
+ Value of first angle
+
+
+ _
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 24
+
+
+
+
+ -
+
+
+
+ 18
+ 18
+
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>Show full calculation in message box</p></body></html>
+
+
+
+
+
+
+
+
+
+
+
+ 16
+ 16
+
+
+
+ true
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Input data
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Size and height
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Standard table
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Increments
+
+
+
+ -
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+ Length of lines
+
+
+
+ -
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+ Length of arcs
+
+
+
+ -
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+ Length of curves
+
+
+
+ -
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+ Angle of lines
+
+
+
+
+
+
+
+ -
+
+
+ Variables
+
+
+
+
+
+ -
+
+
+
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp
index aeca74c04..81fd9b5a7 100644
--- a/src/app/dialogs/tools/dialogendline.cpp
+++ b/src/app/dialogs/tools/dialogendline.cpp
@@ -67,10 +67,6 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEndLine::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEndLine::DeployFormulaTextEdit);
-
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
-
}
//---------------------------------------------------------------------------------------------------------------------
@@ -82,20 +78,7 @@ void DialogEndLine::FormulaTextChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogEndLine::DeployFormulaTextEdit()
{
- if (ui->plainTextEditFormula->height() < DIALOGENDLINE_MAX_FORMULA_HEIGHT)
- {
- ui->plainTextEditFormula->setFixedHeight(DIALOGENDLINE_MAX_FORMULA_HEIGHT);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png")));
- }
- else
- {
- ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
- }
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h
index 9f755b7d7..5e53bfe5c 100644
--- a/src/app/dialogs/tools/dialogendline.h
+++ b/src/app/dialogs/tools/dialogendline.h
@@ -31,8 +31,6 @@
#include "dialogtool.h"
-
-#define DIALOGENDLINE_MAX_FORMULA_HEIGHT 64
namespace Ui
{
class DialogEndLine;
diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui
index 12be8bf7a..dc25f6b0d 100644
--- a/src/app/dialogs/tools/dialogendline.ui
+++ b/src/app/dialogs/tools/dialogendline.ui
@@ -189,8 +189,7 @@
-
- :/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png:/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png
+
@@ -677,7 +676,6 @@
-
diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp
index 87cabe48f..6a3e6aa55 100644
--- a/src/app/dialogs/tools/dialognormal.cpp
+++ b/src/app/dialogs/tools/dialognormal.cpp
@@ -65,9 +65,6 @@ DialogNormal::DialogNormal(const VContainer *data, QWidget *parent)
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogNormal::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogNormal::DeployFormulaTextEdit);
-
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -79,18 +76,7 @@ void DialogNormal::FormulaTextChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogNormal::DeployFormulaTextEdit()
{
- if (ui->plainTextEditFormula->height() < DIALOGNORMAL_MAX_FORMULA_HEIGHT)
- {
- ui->plainTextEditFormula->setFixedHeight(DIALOGNORMAL_MAX_FORMULA_HEIGHT);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next"));
- }
- else
- {
- ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down"));
- }
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h
index 2fdcbb6cc..747067463 100644
--- a/src/app/dialogs/tools/dialognormal.h
+++ b/src/app/dialogs/tools/dialognormal.h
@@ -31,7 +31,6 @@
#include "dialogtool.h"
-#define DIALOGNORMAL_MAX_FORMULA_HEIGHT 64
namespace Ui
{
class DialogNormal;
diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui
index a135ba36a..b563b943a 100644
--- a/src/app/dialogs/tools/dialognormal.ui
+++ b/src/app/dialogs/tools/dialognormal.ui
@@ -154,6 +154,12 @@
-
+
+
+ 0
+ 0
+
+
16777215
@@ -183,9 +189,7 @@
-
-
-
+
diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp
index ee3310d4c..3735d6bc1 100644
--- a/src/app/dialogs/tools/dialogpointofcontact.cpp
+++ b/src/app/dialogs/tools/dialogpointofcontact.cpp
@@ -97,9 +97,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfContact::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogPointOfContact::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogPointOfContact::DeployFormulaTextEdit);
-
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -111,20 +108,7 @@ void DialogPointOfContact::FormulaTextChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogPointOfContact::DeployFormulaTextEdit()
{
- if (ui->plainTextEditFormula->height() < DIALOGPOINTOFCONTACT_MAX_FORMULA_HEIGHT)
- {
- ui->plainTextEditFormula->setFixedHeight(DIALOGPOINTOFCONTACT_MAX_FORMULA_HEIGHT);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png")));
- }
- else
- {
- ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
- }
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h
index d0517dd2f..e4413785e 100644
--- a/src/app/dialogs/tools/dialogpointofcontact.h
+++ b/src/app/dialogs/tools/dialogpointofcontact.h
@@ -32,7 +32,6 @@
#include "ui_dialogpointofcontact.h"
#include "dialogtool.h"
-#define DIALOGPOINTOFCONTACT_MAX_FORMULA_HEIGHT 64
namespace Ui
{
class DialogPointOfContact;
diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/app/dialogs/tools/dialogpointofcontact.ui
index 147765832..fd13a0448 100644
--- a/src/app/dialogs/tools/dialogpointofcontact.ui
+++ b/src/app/dialogs/tools/dialogpointofcontact.ui
@@ -154,6 +154,12 @@
-
+
+
+ 0
+ 0
+
+
16777215
@@ -183,9 +189,7 @@
-
-
-
+
diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp
index 0df400703..c579f7bad 100644
--- a/src/app/dialogs/tools/dialogshoulderpoint.cpp
+++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp
@@ -68,9 +68,6 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit);
-
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
}
//---------------------------------------------------------------------------------------------------------------------
@@ -82,20 +79,7 @@ void DialogShoulderPoint::FormulaTextChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogShoulderPoint::DeployFormulaTextEdit()
{
- if (ui->plainTextEditFormula->height() < DIALOGSHOULDERPOINT_MAX_FORMULA_HEIGHT)
- {
- ui->plainTextEditFormula->setFixedHeight(DIALOGSHOULDERPOINT_MAX_FORMULA_HEIGHT);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png")));
- }
- else
- {
- ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight);
- //Set icon from theme (internal for Windows system)
- ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down",
- QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png")));
- }
+ DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h
index 3b7a389a8..17afae0ad 100644
--- a/src/app/dialogs/tools/dialogshoulderpoint.h
+++ b/src/app/dialogs/tools/dialogshoulderpoint.h
@@ -31,7 +31,6 @@
#include "dialogtool.h"
-#define DIALOGSHOULDERPOINT_MAX_FORMULA_HEIGHT 64
namespace Ui
{
class DialogShoulderPoint;
diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/app/dialogs/tools/dialogshoulderpoint.ui
index a9ed3dc8b..583815972 100644
--- a/src/app/dialogs/tools/dialogshoulderpoint.ui
+++ b/src/app/dialogs/tools/dialogshoulderpoint.ui
@@ -154,6 +154,12 @@
-
+
+
+ 0
+ 0
+
+
16777215
@@ -183,9 +189,7 @@
-
-
-
+
diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp
index d7a35b19c..5efafebf4 100644
--- a/src/app/dialogs/tools/dialogtool.cpp
+++ b/src/app/dialogs/tools/dialogtool.cpp
@@ -41,7 +41,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -51,6 +50,8 @@
#include
#include
+#define DIALOGARC_MAX_FORMULA_HEIGHT 64
+
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief DialogTool create dialog
@@ -59,7 +60,7 @@
*/
DialogTool::DialogTool(const VContainer *data, QWidget *parent)
:QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), timerFormula(nullptr),
- bOk(nullptr), bApply(nullptr), spinBoxAngle(nullptr), lineEditFormula(nullptr), plainTextEditFormula(nullptr),
+ bOk(nullptr), bApply(nullptr), spinBoxAngle(nullptr), plainTextEditFormula(nullptr),
listWidget(nullptr), labelResultCalculation(nullptr), labelDescription(nullptr), labelEditNamePoint(nullptr),
labelEditFormula(nullptr), radioButtonSizeGrowth(nullptr), radioButtonStandardTable(nullptr),
radioButtonIncrements(nullptr), radioButtonLengthLine(nullptr), radioButtonLengthArc(nullptr),
@@ -385,12 +386,6 @@ void DialogTool::PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidg
QTextCursor cursor = plainTextEdit->textCursor();
cursor.insertText(item->text());
plainTextEdit->setTextCursor(cursor);
- /*
- int pos = lineEdit->cursorPosition();
- lineEdit->setText(lineEdit->text().insert(lineEdit->cursorPosition(), item->text()));
- lineEdit->setFocus();
- lineEdit->setCursorPosition(pos + item->text().size());
- */
}
//---------------------------------------------------------------------------------------------------------------------
@@ -601,6 +596,27 @@ bool DialogTool::ChoosedPoint(const quint32 &id, QComboBox *box, const QString &
return false;
}
+//---------------------------------------------------------------------------------------------------------------------
+void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight)
+{
+ SCASSERT(formula != nullptr);
+ SCASSERT(buttonGrowLength != nullptr)
+ if (formula->height() < DIALOGARC_MAX_FORMULA_HEIGHT)
+ {
+ formula->setFixedHeight(DIALOGARC_MAX_FORMULA_HEIGHT);
+ //Set icon from theme (internal for Windows system)
+ buttonGrowLength->setIcon(QIcon::fromTheme("go-next",
+ QIcon(":/icons/win.icon.theme/16x16/actions/go-next.png")));
+ }
+ else
+ {
+ formula->setFixedHeight(formulaBaseHeight);
+ //Set icon from theme (internal for Windows system)
+ buttonGrowLength->setIcon(QIcon::fromTheme("go-down",
+ QIcon(":/icons/win.icon.theme/16x16/actions/go-down.png")));
+ }
+}
+
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief FillList fill combobox list
@@ -700,7 +716,7 @@ void DialogTool::DialogRejected()
*/
void DialogTool::FormulaChanged()
{
- QLineEdit* edit = qobject_cast(sender());
+ QPlainTextEdit* edit = qobject_cast(sender());
if (edit)
{
ValFormulaChanged(flagFormula, edit, timerFormula);
@@ -897,12 +913,6 @@ void DialogTool::PutVal(QListWidgetItem *item)
QTextCursor cursor = plainTextEditFormula->textCursor();
cursor.insertText(item->text());
plainTextEditFormula->setTextCursor(cursor);
- /*int pos = plainTextEditFormula->cursorPosition();
- lineEditFormula->setText(lineEditFormula->text().insert(lineEditFormula->cursorPosition(),
- item->text()));
- lineEditFormula->setFocus();
- lineEditFormula->setCursorPosition(pos + item->text().size());
- */
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h
index 5497c2f58..62153427f 100644
--- a/src/app/dialogs/tools/dialogtool.h
+++ b/src/app/dialogs/tools/dialogtool.h
@@ -39,7 +39,6 @@ class QLabel;
class QRadioButton;
class QComboBox;
class QListWidgetItem;
-class QLineEdit;
class QListWidget;
class VContainer;
class QPlainTextEdit;
@@ -134,8 +133,7 @@ protected:
/** @brief spinBoxAngle spinbox for angle */
QDoubleSpinBox *spinBoxAngle;
- /** @brief lineEditFormula linEdit for formula */
- QLineEdit *lineEditFormula;
+ /** @brief plainTextEditFormula formula */
QPlainTextEdit *plainTextEditFormula;
/** @brief listWidget listWidget with variables */
QListWidget *listWidget;
@@ -205,6 +203,7 @@ protected:
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const;
quint32 getCurrentObjectId(QComboBox *box) const;
bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip);
+ void DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight);
template
void InitArrow(T *ui)
{
diff --git a/src/app/share/resources/theme.qrc b/src/app/share/resources/theme.qrc
index cd91162f3..efa266e2b 100644
--- a/src/app/share/resources/theme.qrc
+++ b/src/app/share/resources/theme.qrc
@@ -40,5 +40,8 @@
icons/win.icon.theme/24x24/actions/edit-redo.png
icons/win.icon.theme/32x32/actions/edit-redo.png
icons/win.icon.theme/32x32/actions/edit-undo.png
+ icons/win.icon.theme/16x16/actions/go-down.png
+ icons/win.icon.theme/24x24/actions/go-down.png
+ icons/win.icon.theme/32x32/actions/go-down.png
diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp
index 1c862bf64..6f5906669 100644
--- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp
+++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp
@@ -164,41 +164,51 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt
VSplinePath *splPath1 = new VSplinePath();
VSplinePath *splPath2 = new VSplinePath();
+
+ for (qint32 i = 0; i < splPath->CountPoint(); i++)
+ {
+ if (i <= p1 && i < p2)
+ {
+ if (i == p1)
+ {
+ splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1()+180, spl1.GetKasm1(),
+ spl1.GetAngle1()));
+ VSplinePoint cutPoint;
+ if (typeCreation == Source::FromGui)
+ {
+ cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), spl1.GetAngle2()+180,
+ spl1.GetAngle2());
+ }
+ else
+ {
+ cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), spl2.GetKasm1(),
+ spl1.GetAngle2()+180);
+ }
+ splPath1->append(cutPoint);
+ continue;
+ }
+ splPath1->append(splPath->at(i));
+ }
+ else
+ {
+ if (i == p2)
+ {
+ const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl2.GetAngle1()+180,
+ spl2.GetKasm1(), spl2.GetAngle1());
+ splPath2->append(cutPoint);
+ splPath2->append(VSplinePoint(splP2.P(), spl2.GetKasm2(), spl2.GetAngle2(), splP2.KAsm2(),
+ spl2.GetAngle2()+180));
+ continue;
+ }
+ splPath2->append(splPath->at(i));
+ }
+ }
+
+ splPath1->setMaxCountPoints(splPath->CountPoint());
+ splPath2->setMaxCountPoints(splPath->CountPoint());
+
if (typeCreation == Source::FromGui)
{
- for (qint32 i = 0; i < splPath->CountPoint(); i++)
- {
- if (i <= p1 && i < p2)
- {
- if (i == p1)
- {
- splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1()+180, spl1.GetKasm1(),
- spl1.GetAngle1()));
- const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(),
- spl1.GetAngle2()+180, spl1.GetAngle2());
- splPath1->append(cutPoint);
- continue;
- }
- splPath1->append(splPath->at(i));
- }
- else
- {
- if (i == p2)
- {
- const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl2.GetAngle1()+180,
- spl2.GetKasm1(), spl2.GetAngle1());
- splPath2->append(cutPoint);
- splPath2->append(VSplinePoint(splP2.P(), spl2.GetKasm2(), spl2.GetAngle2(), splP2.KAsm2(),
- spl2.GetAngle2()+180));
- continue;
- }
- splPath2->append(splPath->at(i));
- }
- }
-
- splPath1->setMaxCountPoints(splPath->CountPoint());
- splPath2->setMaxCountPoints(splPath->CountPoint());
-
splPath1id = data->AddGObject(splPath1);
data->AddLengthSpline(splPath1->name(), qApp->fromPixel(splPath1->GetLength()));
@@ -207,39 +217,6 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt
}
else
{
- for (qint32 i = 0; i < splPath->CountPoint(); i++)
- {
- if (i <= p1 && i < p2)
- {
- if (i == p1)
- {
- splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1()+180, spl1.GetKasm1(),
- spl1.GetAngle1()));
- const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(),
- spl2.GetKasm1(), spl1.GetAngle2()+180);
- splPath1->append(cutPoint);
- continue;
- }
- splPath1->append(splPath->at(i));
- }
- else
- {
- if (i == p2)
- {
- const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl2.GetAngle1()+180,
- spl2.GetKasm1(), spl2.GetAngle1());
- splPath2->append(cutPoint);
- splPath2->append(VSplinePoint(splP2.P(), spl2.GetKasm2(), spl2.GetAngle2(), splP2.KAsm2(),
- spl2.GetAngle2()+180));
- continue;
- }
- splPath2->append(splPath->at(i));
- }
- }
-
- splPath1->setMaxCountPoints(splPath->CountPoint());
- splPath2->setMaxCountPoints(splPath->CountPoint());
-
data->UpdateGObject(splPath1id, splPath1);
data->AddLengthSpline(splPath1->name(), qApp->fromPixel(splPath1->GetLength()));
@@ -251,6 +228,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt
doc->UpdateToolData(id, data);
}
}
+
VDrawTool::AddRecord(id, Tool::CutSplinePathTool, doc);
if (parse == Document::FullParse)
{