From ffd898be7d58df20974e9547513e3f0536e7ff7a Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 19 Jun 2014 15:01:38 +0300 Subject: [PATCH] Formula height cannot be initialized in initialization list. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 3 ++- src/app/dialogs/tools/dialogarc.cpp | 6 ++++-- src/app/dialogs/tools/dialogbisector.cpp | 3 ++- src/app/dialogs/tools/dialogcutarc.cpp | 3 ++- src/app/dialogs/tools/dialogcutspline.cpp | 3 ++- src/app/dialogs/tools/dialogcutsplinepath.cpp | 3 ++- src/app/dialogs/tools/dialogeditwrongformula.cpp | 4 ++-- src/app/dialogs/tools/dialogendline.cpp | 3 ++- src/app/dialogs/tools/dialognormal.cpp | 4 ++-- src/app/dialogs/tools/dialogpointofcontact.cpp | 3 ++- src/app/dialogs/tools/dialogshoulderpoint.cpp | 4 ++-- src/app/dialogs/tools/dialogsinglepoint.cpp | 3 +-- src/app/dialogs/tools/dialogspline.cpp | 4 ++-- 13 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 4907d9ea8..b7dad8c54 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -39,12 +39,13 @@ */ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()), typeLine(QString()), - formula(QString()), firstPointId(0), secondPointId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) + formula(QString()), firstPointId(0), secondPointId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index e992c745f..77cc8b597 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -44,14 +44,16 @@ 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(ui->plainTextEditFormula->height()), - formulaBaseHeightF1(ui->plainTextEditF1->height()), formulaBaseHeightF2(ui->plainTextEditF2->height()) + f2(QString()), formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0) { ui->setupUi(this); InitVariables(ui); plainTextEditFormula = ui->plainTextEditFormula; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); + this->formulaBaseHeightF1 = ui->plainTextEditF1->height(); + this->formulaBaseHeightF2 = ui->plainTextEditF2->height(); timerRadius = new QTimer(this); connect(timerRadius, &QTimer::timeout, this, &DialogArc::EvalRadius); diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index bf07c35d7..3610409fd 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -41,12 +41,13 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()), typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 2f618fcba..b80da3206 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -40,12 +40,13 @@ */ DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) : DialogTool(data, parent), ui(new Ui::DialogCutArc), pointName(QString()), formula(QString()), arcId(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 110d99cb9..bfb5e1fb7 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -40,12 +40,13 @@ */ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancel(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index bcebf1611..769fffe8b 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -40,12 +40,13 @@ */ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()), - splinePathId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) + splinePathId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancel(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index ef0d5702e..28fe4afe6 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -31,12 +31,12 @@ //--------------------------------------------------------------------------------------------------------------------- DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), - formulaBaseHeight(ui->plainTextEditFormula->height()) + :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancel(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 70a016fd5..5b7770a1c 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -40,12 +40,13 @@ */ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()), formula(QString()), - angle(0), basePointId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) + angle(0), basePointId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index f425a283a..b306c45a1 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -37,13 +37,13 @@ */ DialogNormal::DialogNormal(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()), typeLine(QString()), - formula(QString()), angle(0), firstPointId(0), secondPointId(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + formula(QString()), angle(0), firstPointId(0), secondPointId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 0b2293fd3..322471c8f 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -39,12 +39,13 @@ */ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogPointOfContact), number(0), pointName(QString()), radius(QString()), - center(0), firstPoint(0), secondPoint(0), formulaBaseHeight(ui->plainTextEditFormula->height()) + center(0), firstPoint(0), secondPoint(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 63a08c8b5..d88e15e1a 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -40,13 +40,13 @@ */ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()), - typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogsinglepoint.cpp b/src/app/dialogs/tools/dialogsinglepoint.cpp index e7caa1d34..596a8a17a 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.cpp +++ b/src/app/dialogs/tools/dialogsinglepoint.cpp @@ -36,8 +36,7 @@ * @param parent parent widget */ DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()), - point(QPointF()) + :DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()), point(QPointF()) { ui->setupUi(this); ui->doubleSpinBoxX->setRange(0, qApp->fromPixel(SceneSize)); diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index bf5a8df41..4640380cb 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -39,8 +39,8 @@ * @param parent parent widget */ DialogSpline::DialogSpline(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0), - kAsm1(1), kAsm2(1), kCurve(1) + :DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0), kAsm1(1), + kAsm2(1), kCurve(1) { ui->setupUi(this); InitOkCancel(ui);