59 #include <QPlainTextEdit>
61 #include <QPushButton>
63 #include <QToolButton>
65 #include "../vpatterndb/vtranslatevars.h"
66 #include "../../tools/vabstracttool.h"
67 #include "../../visualization/visualization.h"
68 #include "../../visualization/line/vistoolshoulderpoint.h"
69 #include "../ifc/xml/vabstractpattern.h"
70 #include "../ifc/xml/vdomdocument.h"
71 #include "../support/edit_formula_dialog.h"
72 #include "../vmisc/vabstractapplication.h"
73 #include "../vmisc/vcommonsettings.h"
74 #include "ui_dialogshoulderpoint.h"
87 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
88 setWindowIcon(QIcon(
":/toolicon/32x32/shoulder.png"));
90 ui->lineEditNamePoint->setClearButtonEnabled(
true);
96 ui->plainTextEditFormula->installEventFilter(
this);
106 int index =
ui->lineColor_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineColor());
109 ui->lineColor_ComboBox->setCurrentIndex(index);
112 index =
ui->lineWeight_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineWeight());
115 ui->lineWeight_ComboBox->setCurrentIndex(index);
118 index =
ui->lineType_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineType());
121 ui->lineType_ComboBox->setCurrentIndex(index);
174 dialog->setWindowTitle(tr(
"Edit length"));
177 if (dialog->exec() == QDialog::Accepted)
187 AddVisualization<VisToolShoulderPoint>();
220 if (
SetObject(
id,
ui->comboBoxP3, tr(
"Select first point of line")))
229 if (
SetObject(
id,
ui->comboBoxP1Line, tr(
"Select second point of line")))
251 this->setModal(
true);
268 formula =
ui->plainTextEditFormula->toPlainText();
286 ui->plainTextEditFormula->blockSignals(
true);
351 formula =
qApp->TrVars()->FormulaToUser(value,
qApp->Settings()->GetOsSeparator());
357 ui->plainTextEditFormula->setPlainText(
formula);
404 vis->setLineWeight(value);
425 return qApp->TrVars()->TryFormulaFromUser(
formula,
qApp->Settings()->GetOsSeparator());
The DialogShoulderPoint class dialog for ToolShoulderPoint. Help create point and edit option.
quint32 GetP3() const
getPShoulder return id shoulder point
void FormulaTextChanged()
FormulaTextChanged when formula text changes for validation and calc.
virtual ~DialogShoulderPoint() Q_DECL_OVERRIDE
virtual void PointNameChanged() Q_DECL_OVERRIDE
QString GetFormula() const
GetFormula return string of formula.
void SetFormula(const QString &value)
SetFormula set string of formula.
int formulaBaseHeight
formulaBaseHeight base height defined by dialogui
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
QString getLineColor() const
quint32 GetP2Line() const
GetP2Line return id second point of line.
void SetP1Line(const quint32 &value)
SetP1Line set id first point of line.
quint32 GetP1Line() const
GetP1Line return id first point of line.
void setLineType(const QString &value)
setLineType set type of line
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
void SetP2Line(const quint32 &value)
SetP2Line set id second point of line.
QString getLineWeight() const
getLineWeight return weight of the lines
void SetP3(const quint32 &value)
setPShoulder set id shoulder point
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
QString getLineType() const
getLineType return type of line
void SetPointName(const QString &value)
SetPointName set name of point.
void DeployFormulaTextEdit()
DeployFormulaTextEdit grow or shrink formula input.
void setLineColor(const QString &value)
Ui::DialogShoulderPoint * ui
ui keeps information about user interface
QString formula
formula formula
virtual void ShowVisualization() Q_DECL_OVERRIDE
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
DialogShoulderPoint create dialog.
The VContainer class container of all variables.
void setLineWeight(const QString &value)
virtual void VisualMode(const quint32 &pointId)
void setObject1Id(const quint32 &value)
void setLineStyle(const Qt::PenStyle &value)
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.
const QString LineTypeSolidLine
const QString LineTypeDashLine
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.