57 #include <QPlainTextEdit>
60 #include <QPushButton>
61 #include <QSharedPointer>
63 #include <QToolButton>
66 #include "../vgeometry/vpointf.h"
67 #include "../vpatterndb/vcontainer.h"
68 #include "../vpatterndb/vtranslatevars.h"
69 #include "../vwidgets/vmaingraphicsscene.h"
70 #include "../vwidgets/vabstractmainwindow.h"
71 #include "../../tools/vabstracttool.h"
72 #include "../../visualization/line/vistoolendline.h"
73 #include "../../visualization/visualization.h"
74 #include "../ifc/xml/vabstractpattern.h"
75 #include "../ifc/xml/vdomdocument.h"
76 #include "../support/edit_formula_dialog.h"
77 #include "../vmisc/vabstractapplication.h"
78 #include "../vmisc/vcommonsettings.h"
79 #include "ui_dialogendline.h"
93 formulaBaseHeightAngle(0),
97 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
98 setWindowIcon(QIcon(
":/toolicon/32x32/segment.png"));
100 ui->lineEditNamePoint->setClearButtonEnabled(
true);
108 ui->plainTextEditFormula->installEventFilter(
this);
109 ui->plainTextEditAngle->installEventFilter(
this);
117 int index =
ui->lineColor_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineColor());
120 ui->lineColor_ComboBox->setCurrentIndex(index);
123 index =
ui->lineWeight_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineWeight());
126 ui->lineWeight_ComboBox->setCurrentIndex(index);
129 index =
ui->lineType_ComboBox->findData(
qApp->getCurrentDocument()->getDefaultLineType());
132 ui->lineType_ComboBox->setCurrentIndex(index);
192 dialog->setWindowTitle(tr(
"Edit angle"));
195 if (dialog->exec() == QDialog::Accepted)
206 dialog->setWindowTitle(tr(
"Edit length"));
209 if (dialog->exec() == QDialog::Accepted)
280 vis->setLineWeight(value);
387 QLineF line = QLineF(
static_cast<QPointF
>(*point), scene->
getScenePos());
395 this->setModal(
true);
411 AddVisualization<VisToolEndLine>();
439 ui->plainTextEditFormula->blockSignals(
true);
440 ui->plainTextEditAngle->blockSignals(
true);
The DialogEndLine class dialog for ToolEndLine. Help create point and edit option.
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
void FormulaTextChanged()
FormulaTextChanged when formula text changes for validation and calc.
void EvalAngle()
EvalAngle calculate value of angle.
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 DeployFormulaTextEdit()
DeployFormulaTextEdit grow or shrink formula input.
void SetPointName(const QString &value)
SetPointName set name of point.
void SetAngle(const QString &value)
SetAngle set angle of line.
QString formulaAngle
angle angle of line
virtual ~DialogEndLine() Q_DECL_OVERRIDE
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
void setLineType(const QString &value)
setLineType set type of line
DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
DialogEndLine create dialog.
void SetFormula(const QString &value)
SetFormula set string of formula.
void SetBasePointId(const quint32 &value)
SetBasePointId set id base point of line.
void DeployAngleTextEdit()
int formulaBaseHeight
formulaBaseHeight base height defined by dialogui
quint32 GetBasePointId() const
GetBasePointId return id base point of line.
void setLineColor(const QString &value)
setLineColor set color of the line
QString getLineWeight() const
getLineWeight return weight of the lines
QString getLineColor() const
getLineColor get the color of line
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
virtual void ShowVisualization() Q_DECL_OVERRIDE
QString formulaLength
formula formula
QString GetFormula() const
GetFormula return string of formula.
Ui::DialogEndLine * ui
ui keeps information about user interface
int formulaBaseHeightAngle
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE
DialogEndLine::ShowDialog show dialog after finish working with visual part.
QString GetAngle() const
GetAngle return formula angle of line.
QString getLineType() const
getLineType return type of line
virtual void ShowToolTip(const QString &toolTip)=0
The VContainer class container of all variables.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
The VMainGraphicsScene class main scene.
QPointF getScenePos() const
The VPointF class keep data of point.
void ToolTip(const QString &toolTip)
void setLineWeight(const QString &value)
void setObject1Id(const quint32 &value)
void setLineStyle(const Qt::PenStyle &value)
const QString degreeSymbol
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.
const qreal defPointRadiusPixel
const QString LineTypeSolidLine
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.