Merge with feature.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-04-30 14:09:34 +03:00
commit fc6e65e601
84 changed files with 1915 additions and 4009 deletions

View file

@ -1803,6 +1803,10 @@ QString VApplication::PostfixOperator(const QString &name) const
*/
QString VApplication::FormulaFromUser(const QString &formula)
{
if (formula.isEmpty())
{
return formula;
}
QString newFormula = formula;// Local copy for making changes
Calculator *cal = new Calculator(formula);// Eval formula
@ -1901,6 +1905,11 @@ QString VApplication::FormulaFromUser(const QString &formula)
*/
QString VApplication::FormulaToUser(const QString &formula)
{
if (formula.isEmpty())
{
return formula;
}
QString newFormula = formula;// Local copy for making changes
QMap<int, QString> tokens;

View file

@ -31,6 +31,7 @@
#include "../../visualization/vistoolalongline.h"
#include "../../tools/vabstracttool.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "dialogeditwrongformula.h"
#include <QPushButton>
@ -45,7 +46,6 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId,
formula(QString()), formulaBaseHeight(0), line(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -62,11 +62,10 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId,
FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics());
FillComboBoxLineColors(ui->comboBoxLineColor);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogAlongLine::PutHere);
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogAlongLine::FXLength);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogAlongLine::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogAlongLine::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogAlongLine::DeployFormulaTextEdit);
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal);
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
this, &DialogAlongLine::PointChanged);
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
@ -100,6 +99,19 @@ void DialogAlongLine::PointChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogAlongLine::FXLength()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit length"));
dialog->SetFormula(GetFormula());
if (dialog->exec() == QDialog::Accepted)
{
SetFormula(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogAlongLine::ShowVisualization()
{

View file

@ -75,6 +75,8 @@ public slots:
*/
void FormulaTextChanged();
void PointChanged();
void FXLength();
protected:
virtual void ShowVisualization();
/**

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>428</width>
<height>532</height>
<width>412</width>
<height>284</height>
</rect>
</property>
<property name="windowTitle">
@ -87,16 +87,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHere">
<property name="toolTip">
<string>Insert variable into the formula</string>
</property>
<widget class="QToolButton" name="toolButtonExprLength">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -165,6 +162,9 @@
<property name="tabChangesFocus">
<bool>true</bool>
</property>
<property name="plainText">
<string notr="true"/>
</property>
</widget>
</item>
<item>
@ -206,251 +206,98 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="text">
<string>First point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxFirstPoint">
<property name="toolTip">
<string>First point of line</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="text">
<string>Second point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSecondPoint">
<property name="toolTip">
<string>Second point of line</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables - Click twice to insert into formula</string>
</property>
</widget>
</item>
</layout>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="text">
<string>First point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxFirstPoint">
<property name="toolTip">
<string>First point of line</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="text">
<string>Second point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSecondPoint">
<property name="toolTip">
<string>Second point of line</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -465,21 +312,11 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxFirstPoint</tabstop>
<tabstop>comboBoxSecondPoint</tabstop>
<tabstop>comboBoxLineType</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -36,6 +36,7 @@
#include "../../container/vcontainer.h"
#include "../../libs/ifc/xml/vdomdocument.h"
#include "../../visualization/vistoolarc.h"
#include "dialogeditwrongformula.h"
//---------------------------------------------------------------------------------------------------------------------
/**
@ -51,8 +52,6 @@ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *par
{
ui->setupUi(this);
InitVariables(ui);
plainTextEditFormula = ui->plainTextEditFormula;
this->formulaBaseHeight = ui->plainTextEditFormula->height();
this->formulaBaseHeightF1 = ui->plainTextEditF1->height();
@ -78,9 +77,9 @@ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *par
CheckState();
connect(ui->toolButtonPutHereRadius, &QPushButton::clicked, this, &DialogArc::PutRadius);
connect(ui->toolButtonPutHereF1, &QPushButton::clicked, this, &DialogArc::PutF1);
connect(ui->toolButtonPutHereF2, &QPushButton::clicked, this, &DialogArc::PutF2);
connect(ui->toolButtonExprRadius, &QPushButton::clicked, this, &DialogArc::FXRadius);
connect(ui->toolButtonExprF1, &QPushButton::clicked, this, &DialogArc::FXF1);
connect(ui->toolButtonExprF2, &QPushButton::clicked, this, &DialogArc::FXF2);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogArc::RadiusChanged);
connect(ui->plainTextEditF1, &QPlainTextEdit::textChanged, this, &DialogArc::F1Changed);
@ -259,43 +258,6 @@ void DialogArc::closeEvent(QCloseEvent *event)
DialogTool::closeEvent(event);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutRadius put variable into formula of radius
*/
void DialogArc::PutRadius()
{
PutValHere(ui->plainTextEditFormula, ui->listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutF1 put variable into formula of first angle
*/
void DialogArc::PutF1()
{
PutValHere(ui->plainTextEditF1, ui->listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutF2 put variable into formula of second angle
*/
void DialogArc::PutF2()
{
PutValHere(ui->plainTextEditF2, ui->listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief LineAngles show variable angles of lines
*/
// cppcheck-suppress unusedFunction
void DialogArc::LineAngles()
{
ShowLineAngles();
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief RadiusChanged after change formula of radius calculate value and show result
@ -329,6 +291,45 @@ void DialogArc::F2Changed()
ValFormulaChanged(flagF2, ui->plainTextEditF2, timerF2);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogArc::FXRadius()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit radius"));
dialog->SetFormula(GetRadius());
if (dialog->exec() == QDialog::Accepted)
{
SetRadius(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogArc::FXF1()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit first angle"));
dialog->SetFormula(GetF1());
if (dialog->exec() == QDialog::Accepted)
{
SetF1(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogArc::FXF2()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit second angle"));
dialog->SetFormula(GetF2());
if (dialog->exec() == QDialog::Accepted)
{
SetF2(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief CheckState if all is right enable button ok
@ -377,27 +378,6 @@ void DialogArc::EvalF()
CheckAngles();
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ShowLineAngles show varibles angles of lines
*/
void DialogArc::ShowLineAngles()
{
ui->listWidget->blockSignals(true);
ui->listWidget->clear();
ui->listWidget->blockSignals(false);
const QMap<QString, QSharedPointer<VLineAngle> > lineAnglesTable = data->DataAngleLines();
QMap<QString, QSharedPointer<VLineAngle> >::const_iterator i;
for (i = lineAnglesTable.constBegin(); i != lineAnglesTable.constEnd(); ++i)
{
QListWidgetItem *item = new QListWidgetItem(i.key());
item->setFont(QFont("Times", 12, QFont::Bold));
ui->listWidget->addItem(item);
}
ui->listWidget->setCurrentRow (0);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogArc::CheckAngles()
{

View file

@ -70,14 +70,13 @@ public slots:
void DeployFormulaTextEdit();
void DeployF1TextEdit();
void DeployF2TextEdit();
void PutRadius();
void PutF1();
void PutF2();
// cppcheck-suppress unusedFunction
void LineAngles();
void RadiusChanged();
void F1Changed();
void F2Changed();
void FXRadius();
void FXF1();
void FXF2();
protected:
virtual void CheckState();
virtual void ShowVisualization();
@ -131,7 +130,6 @@ private:
void EvalRadius();
void EvalF();
void ShowLineAngles();
void CheckAngles();
};

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>425</width>
<height>577</height>
<height>329</height>
</rect>
</property>
<property name="windowTitle">
@ -87,16 +87,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHereRadius">
<property name="toolTip">
<string>Insert variable into the formula</string>
</property>
<widget class="QToolButton" name="toolButtonExprRadius">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -265,16 +262,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHereF1">
<property name="toolTip">
<string>Insert variable into formula</string>
</property>
<widget class="QToolButton" name="toolButtonExprF1">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -443,16 +437,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHereF2">
<property name="toolTip">
<string>Insert marked variable into formula</string>
</property>
<widget class="QToolButton" name="toolButtonExprF2">
<property name="text">
<string notr="true">...</string>
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -556,195 +547,39 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Center point</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxBasePoint">
<property name="toolTip">
<string>Select point of center of arc</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxColor"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Center point</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxBasePoint">
<property name="toolTip">
<string>Select point of center of arc</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxColor"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -759,23 +594,11 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHereRadius</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>plainTextEditF1</tabstop>
<tabstop>toolButtonPutHereF1</tabstop>
<tabstop>pushButtonGrowLengthF1</tabstop>
<tabstop>plainTextEditF2</tabstop>
<tabstop>toolButtonPutHereF2</tabstop>
<tabstop>pushButtonGrowLengthF2</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>comboBoxBasePoint</tabstop>
<tabstop>comboBoxColor</tabstop>
</tabstops>

View file

@ -34,6 +34,7 @@
#include "../../visualization/vistoolbisector.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
#include "dialogeditwrongformula.h"
//---------------------------------------------------------------------------------------------------------------------
/**
@ -46,7 +47,6 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW
line(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -63,9 +63,7 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW
FillComboBoxPoints(ui->comboBoxThirdPoint);
FillComboBoxLineColors(ui->comboBoxLineColor);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogBisector::PutHere);
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogBisector::PutVal);
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogBisector::FXLength);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogBisector::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogBisector::DeployFormulaTextEdit);
@ -110,6 +108,19 @@ void DialogBisector::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogBisector::FXLength()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit length"));
dialog->SetFormula(GetFormula());
if (dialog->exec() == QDialog::Accepted)
{
SetFormula(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogBisector::ShowVisualization()
{

View file

@ -79,6 +79,7 @@ public slots:
*/
void FormulaTextChanged();
virtual void PointNameChanged();
void FXLength();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>428</width>
<height>565</height>
<height>317</height>
</rect>
</property>
<property name="windowTitle">
@ -84,16 +84,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHere">
<property name="toolTip">
<string>Insert marked variable into the formula</string>
</property>
<widget class="QToolButton" name="toolButtonExprLength">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -200,283 +197,127 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>First point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxFirstPoint">
<property name="toolTip">
<string>First point of angle</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Second point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSecondPoint">
<property name="toolTip">
<string>Second point of angle</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelThirdPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Third point</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxThirdPoint">
<property name="toolTip">
<string>Third point of angle</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from second point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables - Click twice to insert into formula</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>First point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxFirstPoint">
<property name="toolTip">
<string>First point of angle</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Second point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSecondPoint">
<property name="toolTip">
<string>Second point of angle</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelThirdPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Third point</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxThirdPoint">
<property name="toolTip">
<string>Third point of angle</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from second point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="locale">
@ -494,22 +335,12 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxFirstPoint</tabstop>
<tabstop>comboBoxSecondPoint</tabstop>
<tabstop>comboBoxThirdPoint</tabstop>
<tabstop>comboBoxLineType</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -34,6 +34,8 @@
#include "../../visualization/vistoolcurveintersectaxis.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
#include "dialogeditwrongformula.h"
#include <QTimer>
//---------------------------------------------------------------------------------------------------------------------
@ -43,7 +45,6 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -59,8 +60,7 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const
FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics());
FillComboBoxLineColors(ui->comboBoxLineColor);
connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::PutAngle);
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogCurveIntersectAxis::PutVal);
connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::FXAngle);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCurveIntersectAxis::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCurveIntersectAxis::AngleTextChanged);
connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::DeployAngleTextEdit);
@ -221,12 +221,6 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCurveIntersectAxis::PutAngle()
{
PutValHere(ui->plainTextEditFormula, ui->listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCurveIntersectAxis::EvalAngle()
{
@ -245,6 +239,19 @@ void DialogCurveIntersectAxis::DeployAngleTextEdit()
DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLengthAngle, formulaBaseHeightAngle);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCurveIntersectAxis::FXAngle()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit angle"));
dialog->SetFormula(GetAngle());
if (dialog->exec() == QDialog::Accepted)
{
SetAngle(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCurveIntersectAxis::ShowVisualization()
{

View file

@ -66,10 +66,10 @@ public:
virtual void ShowDialog(bool click);
public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type);
void PutAngle();
void EvalAngle();
void AngleTextChanged();
void DeployAngleTextEdit();
void FXAngle();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>419</width>
<height>532</height>
<height>284</height>
</rect>
</property>
<property name="windowTitle">
@ -84,13 +84,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHereAngle">
<widget class="QToolButton" name="toolButtonExprAngle">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -197,279 +197,117 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Axis point</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxAxisPoint">
<property name="toolTip">
<string>Axis Point</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Curve</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxCurve">
<property name="toolTip">
<string>Curve</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Axis point</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxAxisPoint">
<property name="toolTip">
<string>Axis Point</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Curve</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxCurve">
<property name="toolTip">
<string>Curve</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -484,21 +322,11 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHereAngle</tabstop>
<tabstop>pushButtonGrowLengthAngle</tabstop>
<tabstop>comboBoxAxisPoint</tabstop>
<tabstop>comboBoxCurve</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxLineType</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -34,6 +34,7 @@
#include "../../visualization/vistoolcutarc.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../xml/vpattern.h"
#include "dialogeditwrongformula.h"
//---------------------------------------------------------------------------------------------------------------------
/**
@ -46,7 +47,6 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge
path(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -60,9 +60,7 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge
FillComboBoxArcs(ui->comboBoxArc);
FillComboBoxLineColors(ui->comboBoxColor);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutArc::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutArc::PutVal);
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogCutArc::FXLength);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutArc::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutArc::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit);
@ -76,6 +74,19 @@ void DialogCutArc::FormulaTextChanged()
this->FormulaChangedPlainText();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCutArc::FXLength()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit length"));
dialog->SetFormula(GetFormula());
if (dialog->exec() == QDialog::Accepted)
{
SetFormula(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCutArc::ShowVisualization()
{

View file

@ -69,6 +69,7 @@ public slots:
* @brief FormulaTextChanged when formula text changes for validation and calc
*/
void FormulaTextChanged();
void FXLength();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>412</width>
<height>466</height>
<height>218</height>
</rect>
</property>
<property name="windowTitle">
@ -84,13 +84,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHere">
<widget class="QToolButton" name="toolButtonExprLength">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -197,211 +197,55 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Arc</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxArc">
<property name="toolTip">
<string>Selected arc</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Arc</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables - Click twice to insert into formula</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxArc">
<property name="toolTip">
<string>Selected arc</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -416,19 +260,9 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>comboBoxArc</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -33,6 +33,7 @@
#include "../../container/vcontainer.h"
#include "../../xml/vpattern.h"
#include "../../visualization/vistoolcutspline.h"
#include "dialogeditwrongformula.h"
//---------------------------------------------------------------------------------------------------------------------
/**
@ -45,7 +46,6 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId,
path(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -59,8 +59,7 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId,
FillComboBoxSplines(ui->comboBoxSpline);
FillComboBoxLineColors(ui->comboBoxColor);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSpline::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSpline::PutVal);
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogCutSpline::FXLength);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSpline::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSpline::FormulaChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSpline::DeployFormulaTextEdit);
@ -179,6 +178,19 @@ void DialogCutSpline::DeployFormulaTextEdit()
DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCutSpline::FXLength()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit length"));
dialog->SetFormula(GetFormula());
if (dialog->exec() == QDialog::Accepted)
{
SetFormula(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCutSpline::ShowVisualization()
{

View file

@ -64,6 +64,7 @@ public slots:
* @brief DeployFormulaTextEdit grow or shrink formula input
*/
void DeployFormulaTextEdit();
void FXLength();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>412</width>
<height>466</height>
<height>218</height>
</rect>
</property>
<property name="windowTitle">
@ -84,13 +84,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHere">
<widget class="QToolButton" name="toolButtonExprLength">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -197,211 +197,55 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Curve</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxSpline">
<property name="toolTip">
<string>Selected curve</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Curve</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables - Click twice to insert into formula</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxSpline">
<property name="toolTip">
<string>Selected curve</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -416,19 +260,9 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>comboBoxSpline</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -33,6 +33,7 @@
#include "../../container/vcontainer.h"
#include "../../xml/vpattern.h"
#include "../../visualization/vistoolcutsplinepath.h"
#include "dialogeditwrongformula.h"
//---------------------------------------------------------------------------------------------------------------------
/**
@ -45,7 +46,6 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 &
path(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -59,8 +59,7 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 &
FillComboBoxSplinesPath(ui->comboBoxSplinePath);
FillComboBoxLineColors(ui->comboBoxColor);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSplinePath::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSplinePath::PutVal);
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogCutSplinePath::FXLength);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSplinePath::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit);
@ -179,6 +178,19 @@ void DialogCutSplinePath::DeployFormulaTextEdit()
DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCutSplinePath::FXLength()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit length"));
dialog->SetFormula(GetFormula());
if (dialog->exec() == QDialog::Accepted)
{
SetFormula(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogCutSplinePath::ShowVisualization()
{

View file

@ -64,6 +64,7 @@ public slots:
* @brief DeployFormulaTextEdit grow or shrink formula input
*/
void DeployFormulaTextEdit();
void FXLength();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>412</width>
<height>466</height>
<height>218</height>
</rect>
</property>
<property name="windowTitle">
@ -84,13 +84,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHere">
<widget class="QToolButton" name="toolButtonExprLength">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -197,217 +197,61 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Curve</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxSplinePath">
<property name="toolTip">
<string>Selected curve path</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Curve</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables - Click twice to insert into formula</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxSplinePath">
<property name="toolTip">
<string>Selected curve path</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -422,19 +266,9 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>comboBoxSplinePath</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -423,13 +423,3 @@ void DialogDetail::DeleteItem()
ValidObjects(false);
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogDetail::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}

View file

@ -54,7 +54,6 @@ public slots:
void ClickedReverse(bool checked);
void ObjectChanged(int row);
void DeleteItem();
virtual void UpdateList();
protected:
/**
* @brief SaveData Put dialog data in local variables

View file

@ -28,6 +28,7 @@
#include "dialogeditwrongformula.h"
#include "ui_dialogeditwrongformula.h"
#include "../../container/vcontainer.h"
//---------------------------------------------------------------------------------------------------------------------
DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent)
@ -35,7 +36,7 @@ DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const qui
checkZero(false), postfix(QString()), restoreCursor(false)
{
ui->setupUi(this);
InitVariables(ui);
InitVariables();
InitFormulaUI(ui);
this->formulaBaseHeight = ui->plainTextEditFormula->height();
ui->plainTextEditFormula->installEventFilter(this);
@ -105,6 +106,195 @@ void DialogEditWrongFormula::EvalFormula()
Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, checkZero);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ValChenged show description when current variable changed
* @param row number of row
*/
void DialogEditWrongFormula::ValChenged(int row)
{
if (ui->listWidget->count() == 0)
{
ui->labelDescription->setText("");
return;
}
QListWidgetItem *item = ui->listWidget->item( row );
if (ui->radioButtonSizeGrowth->isChecked())
{
if (item->text()==data->HeightName())
{
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->height()).arg(tr("Height"));
ui->labelDescription->setText(desc);
}
if (item->text()==data->SizeName())
{
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->size()).arg(tr("Size"));
ui->labelDescription->setText(desc);
}
return;
}
if (ui->radioButtonStandardTable->isChecked())
{
QString name = qApp->VarFromUser(item->text());
QSharedPointer<VMeasurement> stable = data->GetVariable<VMeasurement>(name);
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(name))
.arg(stable->GetGuiText());
ui->labelDescription->setText(desc);
return;
}
if (ui->radioButtonIncrements->isChecked())
{
QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(item->text());
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(item->text()))
.arg(incr->GetDescription());
ui->labelDescription->setText(desc);
return;
}
if (ui->radioButtonLengthLine->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VLengthLine>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Line length"));
ui->labelDescription->setText(desc);
return;
}
if (ui->radioButtonLengthArc->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VArcLength>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Arc length"));
ui->labelDescription->setText(desc);
return;
}
if (ui->radioButtonLengthSpline->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VSplineLength>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Curve length"));
ui->labelDescription->setText(desc);
return;
}
if (ui->radioButtonAngleLine->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VLineAngle>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Line Angle"));
ui->labelDescription->setText(desc);
return;
}
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief SizeHeight show in list base variables
*/
void DialogEditWrongFormula::SizeHeight()
{
ui->checkBoxHideEmpty->setEnabled(false);
ui->listWidget->blockSignals(true);
ui->listWidget->clear();
{
QListWidgetItem *item = new QListWidgetItem(data->HeightName());
item->setFont(QFont("Times", 12, QFont::Bold));
ui->listWidget->addItem(item);
}
QListWidgetItem *item = new QListWidgetItem(data->SizeName());
item->setFont(QFont("Times", 12, QFont::Bold));
ui->listWidget->addItem(item);
ui->listWidget->blockSignals(false);
ui->listWidget->setCurrentRow (0);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutHere put variable into edit
*/
void DialogEditWrongFormula::PutHere()
{
const QListWidgetItem *item = ui->listWidget->currentItem();
if (item != nullptr)
{
QTextCursor cursor = ui->plainTextEditFormula->textCursor();
cursor.insertText(item->text());
ui->plainTextEditFormula->setTextCursor(cursor);
ui->plainTextEditFormula->setFocus();
}
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutVal put variable into edit
* @param item chosen item of list widget
*/
void DialogEditWrongFormula::PutVal(QListWidgetItem *item)
{
SCASSERT(item != nullptr);
QTextCursor cursor = ui->plainTextEditFormula->textCursor();
cursor.insertText(item->text());
ui->plainTextEditFormula->setTextCursor(cursor);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Measurements show in list measurements
*/
void DialogEditWrongFormula::Measurements()
{
ui->checkBoxHideEmpty->setEnabled(true);
ShowVariable(data->DataMeasurements());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief LengthLines show in list lengths of lines variables
*/
void DialogEditWrongFormula::LengthLines()
{
ui->checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataLengthLines());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief LengthArcs show in list lengths of arcs variables
*/
void DialogEditWrongFormula::LengthArcs()
{
ui->checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataLengthArcs());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief LengthCurves show in list lengths of curves variables
*/
void DialogEditWrongFormula::LengthCurves()
{
ui->checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataLengthSplines());
}
//---------------------------------------------------------------------------------------------------------------------
void DialogEditWrongFormula::AngleLines()
{
ui->checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataAngleLines());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Increments show in list increment variables
*/
void DialogEditWrongFormula::Increments()
{
ui->checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataIncrements());
}
//---------------------------------------------------------------------------------------------------------------------
void DialogEditWrongFormula::CheckState()
{
@ -150,3 +340,59 @@ QString DialogEditWrongFormula::GetFormula() const
{
return qApp->FormulaFromUser(formula);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogEditWrongFormula::InitVariables()
{
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogEditWrongFormula::ValChenged);
if (qApp->patternType() == MeasurementsType::Standard)
{
SizeHeight();
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogEditWrongFormula::SizeHeight);
}
else
{
ui->radioButtonSizeGrowth->setEnabled(false);
ui->radioButtonStandardTable->setChecked(true);
Measurements();
}
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogEditWrongFormula::Measurements);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogEditWrongFormula::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthCurves);
connect(ui->radioButtonAngleLine, &QRadioButton::clicked, this, &DialogEditWrongFormula::AngleLines);
connect(ui->checkBoxHideEmpty, &QCheckBox::stateChanged, this, &DialogEditWrongFormula::Measurements);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ShowVariable show variables in list
* @param var container with variables
*/
template <class key, class val>
void DialogEditWrongFormula::ShowVariable(const QMap<key, val> var)
{
ui->listWidget->blockSignals(true);
ui->listWidget->clear();
ui->labelDescription->setText("");
QMapIterator<key, val> iMap(var);
while (iMap.hasNext())
{
iMap.next();
if (ui->checkBoxHideEmpty->isEnabled() && ui->checkBoxHideEmpty->isChecked() && iMap.value()->IsNotUsed())
{
continue; //skip this measurement
}
if (iMap.value()->Filter(toolId) == false)
{// If we create this variable don't show
QListWidgetItem *item = new QListWidgetItem(iMap.key());
item->setFont(QFont("Times", 12, QFont::Bold));
ui->listWidget->addItem(item);
}
}
ui->listWidget->blockSignals(false);
ui->listWidget->setCurrentRow (0);
}

View file

@ -63,6 +63,17 @@ public slots:
*/
void DeployFormulaTextEdit();
virtual void EvalFormula();
void ValChenged(int row);
void SizeHeight();
void PutHere();
void PutVal(QListWidgetItem * item);
void Measurements();
void LengthLines();
void LengthArcs();
void LengthCurves();
void AngleLines();
void Increments();
protected:
virtual void CheckState();
virtual void closeEvent(QCloseEvent *event);
@ -79,6 +90,11 @@ private:
bool checkZero;
QString postfix;
bool restoreCursor;
void InitVariables();
template <class key, class val>
void ShowVariable(const QMap<key, val> var);
};

View file

@ -349,7 +349,7 @@
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables</string>
<string>Double click for add to formula</string>
</property>
</widget>
</item>

View file

@ -34,6 +34,7 @@
#include "../../visualization/vistoolendline.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
#include "dialogeditwrongformula.h"
#include <QTimer>
//---------------------------------------------------------------------------------------------------------------------
@ -47,7 +48,6 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid
formulaLength(QString()), formulaAngle(QString()), formulaBaseHeight(0), formulaBaseHeightAngle(0), line(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -65,8 +65,8 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid
FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics());
FillComboBoxLineColors(ui->comboBoxLineColor);
connect(ui->toolButtonPutHereLength, &QPushButton::clicked, this, &DialogEndLine::PutHere);
connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogEndLine::PutAngle);
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogEndLine::FXLength);
connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogEndLine::FXAngle);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged);
@ -81,15 +81,6 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid
line = new VisToolEndLine(data);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutAngle put variable into formula of angle
*/
void DialogEndLine::PutAngle()
{
PutValHere(ui->plainTextEditAngle, ui->listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief EvalAngle calculate value of angle
@ -127,6 +118,32 @@ void DialogEndLine::DeployAngleTextEdit()
DeployFormula(ui->plainTextEditAngle, ui->pushButtonGrowLengthAngle, formulaBaseHeightAngle);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogEndLine::FXAngle()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit angle"));
dialog->SetFormula(GetAngle());
if (dialog->exec() == QDialog::Accepted)
{
SetAngle(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogEndLine::FXLength()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit length"));
dialog->SetFormula(GetFormula());
if (dialog->exec() == QDialog::Accepted)
{
SetFormula(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.

View file

@ -76,10 +76,13 @@ public slots:
* @brief FormulaTextChanged when formula text changes for validation and calc
*/
void FormulaTextChanged();
void PutAngle();
void EvalAngle();
void AngleTextChanged();
void DeployAngleTextEdit();
void FXAngle();
void FXLength();
protected:
virtual void ShowVisualization();
/**

View file

@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>417</width>
<height>571</height>
<width>358</width>
<height>323</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -32,7 +32,7 @@
<item>
<widget class="QLabel" name="labelEditFormula">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -84,6 +84,9 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
@ -93,13 +96,19 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHereLength">
<widget class="QToolButton" name="toolButtonExprLength">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -111,6 +120,12 @@
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
@ -122,14 +137,14 @@
<item>
<widget class="QLabel" name="labelResultCalculation">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>87</width>
<width>60</width>
<height>0</height>
</size>
</property>
@ -210,7 +225,7 @@
<item>
<widget class="QLabel" name="labelEditAngle">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -271,13 +286,19 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHereAngle">
<widget class="QToolButton" name="toolButtonExprAngle">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -289,6 +310,12 @@
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
@ -300,14 +327,14 @@
<item>
<widget class="QLabel" name="labelResultCalculationAngle">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>87</width>
<width>60</width>
<height>0</height>
</size>
</property>
@ -384,252 +411,102 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Base point</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxBasePoint">
<property name="toolTip">
<string>First point of line</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Base point</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxBasePoint">
<property name="toolTip">
<string>First point of line</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -644,23 +521,12 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHereLength</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>plainTextEditAngle</tabstop>
<tabstop>toolButtonPutHereAngle</tabstop>
<tabstop>pushButtonGrowLengthAngle</tabstop>
<tabstop>comboBoxBasePoint</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxLineType</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -249,15 +249,6 @@ void DialogHeight::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogHeight::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
void DialogHeight::ShowVisualization()
{

View file

@ -67,7 +67,6 @@ public:
public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type);
virtual void PointNameChanged();
virtual void UpdateList();
protected:
virtual void ShowVisualization();
/**

View file

@ -140,15 +140,6 @@ void DialogLine::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLine::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variables.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLine::ShowVisualization()
{

View file

@ -62,7 +62,6 @@ public:
public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type);
virtual void PointNameChanged();
virtual void UpdateList();
protected:
virtual void ShowVisualization();
/**

View file

@ -224,15 +224,6 @@ void DialogLineIntersect::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLineIntersect::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLineIntersect::ShowVisualization()
{

View file

@ -65,7 +65,6 @@ public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type);
void PointChanged();
virtual void PointNameChanged();
virtual void UpdateList();
protected:
virtual void ShowVisualization();
/**

View file

@ -34,6 +34,8 @@
#include "../../visualization/vistoollineintersectaxis.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
#include "dialogeditwrongformula.h"
#include <QTimer>
//---------------------------------------------------------------------------------------------------------------------
@ -42,7 +44,6 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q
formulaBaseHeightAngle(0), line(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -59,8 +60,7 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q
FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics());
FillComboBoxLineColors(ui->comboBoxLineColor);
connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::PutAngle);
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogLineIntersectAxis::PutVal);
connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::FXAngle);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersectAxis::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogLineIntersectAxis::AngleTextChanged);
connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::DeployAngleTextEdit);
@ -260,12 +260,6 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLineIntersectAxis::PutAngle()
{
PutValHere(ui->plainTextEditFormula, ui->listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLineIntersectAxis::EvalAngle()
{
@ -309,6 +303,19 @@ void DialogLineIntersectAxis::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLineIntersectAxis::FXAngle()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit angle"));
dialog->SetFormula(GetAngle());
if (dialog->exec() == QDialog::Accepted)
{
SetAngle(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLineIntersectAxis::ShowVisualization()
{

View file

@ -69,11 +69,11 @@ public:
virtual void ShowDialog(bool click);
public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type);
void PutAngle();
void EvalAngle();
void AngleTextChanged();
void DeployAngleTextEdit();
virtual void PointNameChanged();
void FXAngle();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>457</width>
<height>565</height>
<height>317</height>
</rect>
</property>
<property name="windowTitle">
@ -84,13 +84,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHereAngle">
<widget class="QToolButton" name="toolButtonExprAngle">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -197,296 +197,134 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelAxisPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Axis point</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxAxisPoint">
<property name="toolTip">
<string>Axis Point</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstLinePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>First line point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxFirstLinePoint">
<property name="toolTip">
<string>First point of line</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondLinePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Second line point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSecondLinePoint">
<property name="toolTip">
<string>Second point of line</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelAxisPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Axis point</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxAxisPoint">
<property name="toolTip">
<string>Axis Point</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstLinePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>First line point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxFirstLinePoint">
<property name="toolTip">
<string>First point of line</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondLinePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Second line point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSecondLinePoint">
<property name="toolTip">
<string>Second point of line</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -501,22 +339,12 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHereAngle</tabstop>
<tabstop>pushButtonGrowLengthAngle</tabstop>
<tabstop>comboBoxAxisPoint</tabstop>
<tabstop>comboBoxFirstLinePoint</tabstop>
<tabstop>comboBoxSecondLinePoint</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxLineType</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -31,6 +31,7 @@
#include "../visualization/vistoolnormal.h"
#include "../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
#include "dialogeditwrongformula.h"
//---------------------------------------------------------------------------------------------------------------------
/**
@ -43,7 +44,6 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge
line(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -61,8 +61,7 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge
InitArrow(ui);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogNormal::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogNormal::PutVal);
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogNormal::FXLength);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogNormal::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogNormal::DeployFormulaTextEdit);
@ -99,6 +98,19 @@ void DialogNormal::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogNormal::FXLength()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit length"));
dialog->SetFormula(GetFormula());
if (dialog->exec() == QDialog::Accepted)
{
SetFormula(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogNormal::ShowVisualization()
{

View file

@ -78,6 +78,7 @@ public slots:
*/
void FormulaTextChanged();
virtual void PointNameChanged();
void FXLength();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>517</width>
<height>678</height>
<height>428</height>
</rect>
</property>
<property name="windowTitle">
@ -87,16 +87,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHere">
<property name="toolTip">
<string>Insert variable into formula</string>
</property>
<widget class="QToolButton" name="toolButtonExprLength">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -200,457 +197,261 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>First point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxFirstPoint">
<property name="toolTip">
<string>First point of line</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Second point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSecondPoint">
<property name="toolTip">
<string>Second point of line</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>First point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxFirstPoint">
<property name="toolTip">
<string>First point of line</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Second point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSecondPoint">
<property name="toolTip">
<string>Second point of line</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Additional angle degrees</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<property name="horizontalSpacing">
<number>29</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="2">
<widget class="QToolButton" name="toolButtonArrowRightUp">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowRightUp.png</normaloff>:/icon/32x32/arrowRightUp.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QToolButton" name="toolButtonArrowLeftUp">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowLeftUp.png</normaloff>:/icon/32x32/arrowLeftUp.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="toolButtonArrowLeft">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowLeft.png</normaloff>:/icon/32x32/arrowLeft.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="toolButtonArrowRight">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowRight.png</normaloff>:/icon/32x32/arrowRight.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="toolButtonArrowUp">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowUp.png</normaloff>:/icon/32x32/arrowUp.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QToolButton" name="toolButtonArrowDown">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowDown.png</normaloff>:/icon/32x32/arrowDown.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QToolButton" name="toolButtonArrowLeftDown">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowLeftDown.png</normaloff>:/icon/32x32/arrowLeftDown.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="toolButtonArrowRightDown">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowRightDown.png</normaloff>:/icon/32x32/arrowRightDown.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxAngle">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Additional angle degrees</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<layout class="QGridLayout" name="gridLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<property name="horizontalSpacing">
<number>29</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="1" column="2">
<widget class="QToolButton" name="toolButtonArrowRight">
<property name="text">
<string>Hide empty measurements</string>
<string notr="true">...</string>
</property>
<property name="checked">
<bool>true</bool>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowRight.png</normaloff>:/icon/32x32/arrowRight.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables - Click twice to insert into formula</string>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxAngle">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QToolButton" name="toolButtonArrowLeftUp">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowLeftUp.png</normaloff>:/icon/32x32/arrowLeftUp.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="toolButtonArrowRightUp">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowRightUp.png</normaloff>:/icon/32x32/arrowRightUp.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="toolButtonArrowUp">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowUp.png</normaloff>:/icon/32x32/arrowUp.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="toolButtonArrowLeft">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowLeft.png</normaloff>:/icon/32x32/arrowLeft.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QToolButton" name="toolButtonArrowLeftDown">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowLeftDown.png</normaloff>:/icon/32x32/arrowLeftDown.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QToolButton" name="toolButtonArrowDown">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowDown.png</normaloff>:/icon/32x32/arrowDown.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="toolButtonArrowRightDown">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/32x32/arrowRightDown.png</normaloff>:/icon/32x32/arrowRightDown.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
@ -659,14 +460,50 @@
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to this point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
@ -682,7 +519,6 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxFirstPoint</tabstop>
@ -696,15 +532,6 @@
<tabstop>toolButtonArrowLeftDown</tabstop>
<tabstop>toolButtonArrowLeft</tabstop>
<tabstop>toolButtonArrowLeftUp</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -33,6 +33,7 @@
#include "../../visualization/vistoolpointofcontact.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../xml/vpattern.h"
#include "dialogeditwrongformula.h"
//---------------------------------------------------------------------------------------------------------------------
/**
@ -45,7 +46,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32
radius(QString()), formulaBaseHeight(0), line(nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -60,24 +60,7 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32
FillComboBoxPoints(ui->comboBoxSecondPoint);
FillComboBoxPoints(ui->comboBoxCenter);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogPointOfContact::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal);
if (qApp->patternType() == MeasurementsType::Standard)
{
SizeHeight();
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
}
else
{
radioButtonSizeGrowth->setVisible(false);
Measurements();
}
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogPointOfContact::Measurements);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogPointOfContact::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogPointOfContact::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogPointOfContact::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogPointOfContact::LengthCurves);
connect(ui->toolButtonExprRadius, &QPushButton::clicked, this, &DialogPointOfContact::FXRadius);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfContact::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogPointOfContact::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogPointOfContact::DeployFormulaTextEdit);
@ -132,6 +115,19 @@ void DialogPointOfContact::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogPointOfContact::FXRadius()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit radius"));
dialog->SetFormula(getRadius());
if (dialog->exec() == QDialog::Accepted)
{
setRadius(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogPointOfContact::ShowVisualization()
{

View file

@ -73,6 +73,7 @@ public slots:
*/
void FormulaTextChanged();
virtual void PointNameChanged();
void FXRadius();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>498</width>
<height>499</height>
<height>251</height>
</rect>
</property>
<property name="windowTitle">
@ -87,16 +87,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHere">
<property name="toolTip">
<string>Insert variable into formula</string>
</property>
<widget class="QToolButton" name="toolButtonExprRadius">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -200,283 +197,127 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelArcCenter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Center of arc</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxCenter">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Select point of center of arc</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Top of the line</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>143</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>End of the line</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables - Click twice to insert into formula.</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelArcCenter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Center of arc</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxCenter">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Select point of center of arc</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Top of the line</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>143</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>End of the line</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -491,21 +332,11 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxCenter</tabstop>
<tabstop>comboBoxFirstPoint</tabstop>
<tabstop>comboBoxSecondPoint</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -156,15 +156,6 @@ void DialogPointOfIntersection::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogPointOfIntersection::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
void DialogPointOfIntersection::ShowVisualization()
{

View file

@ -58,7 +58,6 @@ public:
public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type);
virtual void PointNameChanged();
virtual void UpdateList();
protected:
virtual void ShowVisualization();
/**

View file

@ -34,6 +34,7 @@
#include "../../visualization/vistoolshoulderpoint.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h"
#include "dialogeditwrongformula.h"
//---------------------------------------------------------------------------------------------------------------------
/**
@ -46,7 +47,6 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 &
formulaBaseHeight(0), line (nullptr)
{
ui->setupUi(this);
InitVariables(ui);
InitFormulaUI(ui);
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
labelEditNamePoint = ui->labelEditNamePoint;
@ -63,8 +63,7 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 &
FillComboBoxPoints(ui->comboBoxP3);
FillComboBoxLineColors(ui->comboBoxLineColor);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogShoulderPoint::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogShoulderPoint::PutVal);
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogShoulderPoint::FXLength);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged);
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit);
@ -109,6 +108,19 @@ void DialogShoulderPoint::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogShoulderPoint::FXLength()
{
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, this);
dialog->setWindowTitle(tr("Edit length"));
dialog->SetFormula(GetFormula());
if (dialog->exec() == QDialog::Accepted)
{
SetFormula(dialog->GetFormula());
}
delete dialog;
}
//---------------------------------------------------------------------------------------------------------------------
void DialogShoulderPoint::ShowVisualization()
{

View file

@ -78,6 +78,7 @@ public slots:
*/
void FormulaTextChanged();
virtual void PointNameChanged();
void FXLength();
protected:
virtual void ShowVisualization();
/**

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>488</width>
<height>565</height>
<height>317</height>
</rect>
</property>
<property name="windowTitle">
@ -87,16 +87,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonPutHere">
<property name="toolTip">
<string>Insert variable into formula</string>
</property>
<widget class="QToolButton" name="toolButtonExprLength">
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/24x24/putHere.png</normaloff>:/icon/24x24/putHere.png</iconset>
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
@ -200,322 +197,166 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>First point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxP1Line">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Second point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxP2Line">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>143</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelThirdPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Third point</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxP3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to our point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Input data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Measurements</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonIncrements">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Increments</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of lines</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of arcs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Length of curves</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonAngleLine">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Angle of lines</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Point label</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text">
<string>Hide empty measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="toolTip">
<string>Variables - Click twice to insert into formula</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditNamePoint"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>First point</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxP1Line">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelSecondPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Second point</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxP2Line">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>143</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelThirdPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Third point</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxP3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Type of line</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxLineType">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Show line from first point to our point</string>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>14</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxLineColor"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@ -530,22 +371,12 @@
</widget>
<tabstops>
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxP1Line</tabstop>
<tabstop>comboBoxP2Line</tabstop>
<tabstop>comboBoxP3</tabstop>
<tabstop>comboBoxLineType</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>
<tabstop>radioButtonLengthArc</tabstop>
<tabstop>radioButtonLengthSpline</tabstop>
<tabstop>radioButtonAngleLine</tabstop>
<tabstop>checkBoxHideEmpty</tabstop>
<tabstop>listWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>

View file

@ -77,15 +77,6 @@ void DialogSinglePoint::SaveData()
pointName = ui->lineEditName->text();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogSinglePoint::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief setData set name and point

View file

@ -51,7 +51,6 @@ public:
public slots:
void mousePress(const QPointF &scenePos);
virtual void UpdateList();
protected:
/**
* @brief SaveData Put dialog data in local variables

View file

@ -180,15 +180,6 @@ void DialogSpline::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogSpline::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
void DialogSpline::ShowVisualization()
{

View file

@ -74,7 +74,6 @@ public:
public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type);
virtual void PointNameChanged();
virtual void UpdateList();
protected:
virtual void ShowVisualization();
/**

View file

@ -243,15 +243,6 @@ void DialogSplinePath::KAsm2Changed(qreal d)
item->setData(Qt::UserRole, QVariant::fromValue(p));
}
//---------------------------------------------------------------------------------------------------------------------
void DialogSplinePath::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
void DialogSplinePath::ShowDialog(bool click)
{

View file

@ -62,7 +62,6 @@ public slots:
void Angle2Changed( qreal index );
void KAsm1Changed(qreal d);
void KAsm2Changed(qreal d);
virtual void UpdateList();
virtual void ShowDialog(bool click);
void PathUpdated(const VSplinePath &path);
protected:

View file

@ -60,10 +60,7 @@ Q_LOGGING_CATEGORY(vDialog, "v.dialog")
DialogTool::DialogTool(const VContainer *data, const quint32 &toolId, QWidget *parent)
:QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), flagError(true),
timerFormula(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),
radioButtonLengthCurve(nullptr), radioButtonAngleLine(nullptr), checkBoxHideEmpty(nullptr),
labelResultCalculation(nullptr), labelEditNamePoint(nullptr), labelEditFormula(nullptr),
okColor(QColor(76, 76, 76)), errorColor(Qt::red), associatedTool(nullptr),
toolId(toolId), prepare(false), pointName(QString()), number(0)
{
@ -348,41 +345,6 @@ void DialogTool::ChangeCurrentData(QComboBox *box, const QVariant &value) const
}
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutValHere put variable into line edit from list
* @param lineEdit lineEdit
* @param listWidget listWidget
*/
void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
{
SCASSERT(lineEdit != nullptr);
SCASSERT(listWidget != nullptr);
QListWidgetItem *item = listWidget->currentItem();
if (item != nullptr)
{
int pos = lineEdit->cursorPosition();
lineEdit->setText(lineEdit->text().insert(lineEdit->cursorPosition(), item->text()));
lineEdit->setFocus();
lineEdit->setCursorPosition(pos + item->text().size());
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidget)
{
SCASSERT(plainTextEdit != nullptr);
SCASSERT(listWidget != nullptr);
QListWidgetItem *item = listWidget->currentItem();
if (item != nullptr)
{
QTextCursor cursor = plainTextEdit->textCursor();
cursor.insertText(item->text());
plainTextEdit->setTextCursor(cursor);
plainTextEdit->setFocus();
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::MoveCursorToEnd(QPlainTextEdit *plainTextEdit)
{
@ -884,244 +846,6 @@ void DialogTool::EvalFormula()
Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, false);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief SizeHeight show in list base variables
*/
void DialogTool::SizeHeight()
{
SCASSERT(checkBoxHideEmpty != nullptr);
checkBoxHideEmpty->setEnabled(false);
SCASSERT(listWidget != nullptr);
listWidget->blockSignals(true);
listWidget->clear();
{
QListWidgetItem *item = new QListWidgetItem(data->HeightName());
item->setFont(QFont("Times", 12, QFont::Bold));
listWidget->addItem(item);
}
QListWidgetItem *item = new QListWidgetItem(data->SizeName());
item->setFont(QFont("Times", 12, QFont::Bold));
listWidget->addItem(item);
listWidget->blockSignals(false);
listWidget->setCurrentRow (0);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Measurements show in list measurements
*/
void DialogTool::Measurements()
{
SCASSERT(checkBoxHideEmpty != nullptr);
checkBoxHideEmpty->setEnabled(true);
ShowVariable(data->DataMeasurements());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief LengthLines show in list lengths of lines variables
*/
void DialogTool::LengthLines()
{
SCASSERT(checkBoxHideEmpty != nullptr);
checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataLengthLines());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief LengthArcs show in list lengths of arcs variables
*/
void DialogTool::LengthArcs()
{
SCASSERT(checkBoxHideEmpty != nullptr);
checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataLengthArcs());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief LengthCurves show in list lengths of curves variables
*/
void DialogTool::LengthCurves()
{
SCASSERT(checkBoxHideEmpty != nullptr);
checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataLengthSplines());
}
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::AngleLines()
{
SCASSERT(checkBoxHideEmpty != nullptr);
checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataAngleLines());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Increments show in list increment variables
*/
void DialogTool::Increments()
{
SCASSERT(checkBoxHideEmpty != nullptr);
checkBoxHideEmpty->setEnabled(false);
ShowVariable(data->DataIncrements());
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutHere put variable into edit
*/
void DialogTool::PutHere()
{
PutValHere(plainTextEditFormula, listWidget);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutVal put variable into edit
* @param item chosen item of list widget
*/
void DialogTool::PutVal(QListWidgetItem *item)
{
SCASSERT(plainTextEditFormula != nullptr);
SCASSERT(item != nullptr);
QTextCursor cursor = plainTextEditFormula->textCursor();
cursor.insertText(item->text());
plainTextEditFormula->setTextCursor(cursor);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ValChenged show description when current variable changed
* @param row number of row
*/
void DialogTool::ValChenged(int row)
{
SCASSERT(listWidget != nullptr);
SCASSERT(labelDescription != nullptr);
SCASSERT(radioButtonSizeGrowth != nullptr);
SCASSERT(radioButtonStandardTable != nullptr);
SCASSERT(radioButtonIncrements != nullptr);
SCASSERT(radioButtonLengthLine != nullptr);
SCASSERT(radioButtonLengthArc != nullptr);
SCASSERT(radioButtonLengthCurve != nullptr);
if (listWidget->count() == 0)
{
labelDescription->setText("");
return;
}
QListWidgetItem *item = listWidget->item( row );
if (radioButtonSizeGrowth->isChecked())
{
if (item->text()==data->HeightName())
{
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->height()).arg(tr("Height"));
labelDescription->setText(desc);
}
if (item->text()==data->SizeName())
{
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->size()).arg(tr("Size"));
labelDescription->setText(desc);
}
return;
}
if (radioButtonStandardTable->isChecked())
{
QString name = qApp->VarFromUser(item->text());
QSharedPointer<VMeasurement> stable = data->GetVariable<VMeasurement>(name);
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(name))
.arg(stable->GetGuiText());
labelDescription->setText(desc);
return;
}
if (radioButtonIncrements->isChecked())
{
QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(item->text());
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(item->text()))
.arg(incr->GetDescription());
labelDescription->setText(desc);
return;
}
if (radioButtonLengthLine->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VLengthLine>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Line length"));
labelDescription->setText(desc);
return;
}
if (radioButtonLengthArc->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VArcLength>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Arc length"));
labelDescription->setText(desc);
return;
}
if (radioButtonLengthCurve->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VSplineLength>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Curve length"));
labelDescription->setText(desc);
return;
}
if (radioButtonAngleLine->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VLineAngle>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Line Angle"));
labelDescription->setText(desc);
return;
}
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief UpdateList update lists of variables
*/
void DialogTool::UpdateList()
{
SCASSERT(radioButtonSizeGrowth != nullptr);
SCASSERT(radioButtonStandardTable != nullptr);
SCASSERT(radioButtonIncrements != nullptr);
SCASSERT(radioButtonLengthLine != nullptr);
SCASSERT(radioButtonLengthArc != nullptr);
SCASSERT(radioButtonLengthCurve != nullptr);
if (radioButtonSizeGrowth->isChecked())
{
SizeHeight();
}
if (radioButtonStandardTable->isChecked())
{
ShowVariable(data->DataMeasurements());
}
if (radioButtonIncrements->isChecked())
{
ShowVariable(data->DataIncrements());
}
if (radioButtonLengthLine->isChecked())
{
ShowVariable(data->DataLengthLines());
}
if (radioButtonLengthArc->isChecked())
{
ShowVariable(data->DataLengthArcs());
}
if (radioButtonLengthCurve->isChecked())
{
ShowVariable(data->DataLengthSplines());
}
}
//---------------------------------------------------------------------------------------------------------------------
// cppcheck-suppress unusedFunction
quint32 DialogTool::GetToolId() const
@ -1141,39 +865,6 @@ QString DialogTool::getPointName() const
return pointName;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ShowVariable show variables in list
* @param var container with variables
*/
template <class key, class val>
void DialogTool::ShowVariable(const QMap<key, val> var)
{
SCASSERT(listWidget != nullptr);
SCASSERT(checkBoxHideEmpty != nullptr);
listWidget->blockSignals(true);
listWidget->clear();
labelDescription->setText("");
QMapIterator<key, val> iMap(var);
while (iMap.hasNext())
{
iMap.next();
if (checkBoxHideEmpty->isEnabled() && checkBoxHideEmpty->isChecked() && iMap.value()->IsNotUsed())
{
continue; //skip this measurement
}
if (iMap.value()->Filter(toolId) == false)
{// If we create this variable don't show
QListWidgetItem *item = new QListWidgetItem(iMap.key());
item->setFont(QFont("Times", 12, QFont::Bold));
listWidget->addItem(item);
}
}
listWidget->blockSignals(false);
listWidget->setCurrentRow (0);
}
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::ShowVisToolTip(const QString &toolTip)
{

View file

@ -111,17 +111,7 @@ public slots:
void ArrowRightUp();
void ArrowRightDown();
virtual void EvalFormula();
void SizeHeight();
void Measurements();
void LengthLines();
void LengthArcs();
void LengthCurves();
void AngleLines();
void Increments();
void PutHere();
void PutVal(QListWidgetItem * item);
virtual void ValChenged(int row);
virtual void UpdateList();
virtual void PointNameChanged(){}
protected:
Q_DISABLE_COPY(DialogTool)
@ -160,43 +150,16 @@ protected:
/** @brief plainTextEditFormula formula */
QPlainTextEdit *plainTextEditFormula;
/** @brief listWidget listWidget with variables */
QListWidget *listWidget;
/** @brief labelResultCalculation label with result of calculation */
QLabel *labelResultCalculation;
/** @brief labelDescription description of variable */
QLabel *labelDescription;
/** @brief labelEditNamePoint label used when need show wrong name of point */
QLabel *labelEditNamePoint;
/** @brief labelEditFormula label used when need show wrong formula */
QLabel *labelEditFormula;
/** @brief radioButtonSizeGrowth radio button for base variables */
QRadioButton *radioButtonSizeGrowth;
/** @brief radioButtonStandardTable radio button for standard table variables */
QRadioButton *radioButtonStandardTable;
/** @brief radioButtonIncrements radio button for increments variables */
QRadioButton *radioButtonIncrements;
/** @brief radioButtonLengthLine radio button for lengths od lines variables */
QRadioButton *radioButtonLengthLine;
/** @brief radioButtonLengthArc radio button for lengths of arcs variables */
QRadioButton *radioButtonLengthArc;
/** @brief radioButtonLengthCurve radio button for lengths of curves variables */
QRadioButton *radioButtonLengthCurve;
QRadioButton *radioButtonAngleLine;
QCheckBox *checkBoxHideEmpty;
const QColor okColor;
const QColor errorColor;
/**
@ -228,11 +191,7 @@ protected:
virtual void CheckState();
QString GetComboBoxCurrentData(const QComboBox *box)const;
template <class key, class val>
void ShowVariable(const QMap<key, val> var);
void ChangeCurrentData(QComboBox *box, const QVariant &value) const;
void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget);
void PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidget);
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer);
void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer);
qreal Eval(const QString &text, bool &flag, QLabel *label, const QString &postfix,
@ -263,41 +222,6 @@ protected:
connect(ui->toolButtonArrowRightDown, &QPushButton::clicked, this, &DialogTool::ArrowRightDown);
}
template <typename T>
void InitVariables(T *ui)
{
listWidget = ui->listWidget;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
radioButtonAngleLine = ui->radioButtonAngleLine;
checkBoxHideEmpty = ui->checkBoxHideEmpty;
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
if (qApp->patternType() == MeasurementsType::Standard)
{
SizeHeight();
connect(radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
}
else
{
radioButtonSizeGrowth->setEnabled(false);
radioButtonStandardTable->setChecked(true);
Measurements();
}
connect(radioButtonStandardTable, &QRadioButton::clicked, this, &DialogTool::Measurements);
connect(radioButtonIncrements, &QRadioButton::clicked, this, &DialogTool::Increments);
connect(radioButtonLengthLine, &QRadioButton::clicked, this, &DialogTool::LengthLines);
connect(radioButtonLengthArc, &QRadioButton::clicked, this, &DialogTool::LengthArcs);
connect(radioButtonLengthCurve, &QRadioButton::clicked, this, &DialogTool::LengthCurves);
connect(radioButtonAngleLine, &QRadioButton::clicked, this, &DialogTool::AngleLines);
connect(checkBoxHideEmpty, &QCheckBox::stateChanged, this, &DialogTool::Measurements);
}
template <typename T>
/**
* @brief InitOkCancelApply initialise OK / Cancel and Apply buttons
* @param ui Dialog container

View file

@ -195,15 +195,6 @@ void DialogTriangle::PointNameChanged()
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogTriangle::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
void DialogTriangle::ShowVisualization()
{

View file

@ -64,7 +64,6 @@ public:
public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type);
virtual void PointNameChanged();
virtual void UpdateList();
protected:
virtual void ShowVisualization();
/**

View file

@ -69,15 +69,6 @@ void DialogUnionDetails::ChosenObject(quint32 id, const SceneObject &type)
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogUnionDetails::UpdateList()
{
/*
* Does nothing. We redefine this slot because it is only one now way block update list of variable.
* This dialog doesn't work with formula. Don't delete. Help avoid crash.
*/
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief CheckObject check if detail contain this id

View file

@ -52,7 +52,6 @@ public:
int getIndexD2() const;
public slots:
void ChosenObject(quint32 id, const SceneObject &type);
virtual void UpdateList();
private:
Q_DISABLE_COPY(DialogUnionDetails)

View file

@ -318,7 +318,6 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons
connect(currentScene, &VMainGraphicsScene::ChoosedObject, dialogTool, &DialogTool::ChosenObject);
connect(dialogTool, &DialogTool::DialogClosed, this, closeDialogSlot);
connect(dialogTool, &DialogTool::ToolTip, this, &MainWindow::ShowToolTip);
connect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogTool::UpdateList);
ui->view->itemClicked(nullptr);
}
else
@ -360,7 +359,6 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur
connect(dialogTool, &DialogTool::DialogClosed, this, closeDialogSlot);
connect(dialogTool, &DialogTool::DialogApplied, this, applyDialogSlot);
connect(dialogTool, &DialogTool::ToolTip, this, &MainWindow::ShowToolTip);
connect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogTool::UpdateList);
connect(ui->view, &VMainGraphicsView::MouseRelease, this, &MainWindow::ClickEndVisualization);
ui->view->itemClicked(nullptr);
}
@ -685,8 +683,6 @@ void MainWindow::ToolUnionDetails(bool checked)
{
SetToolButton<DialogUnionDetails>(checked, Tool::UnionDetails, ":/cursor/union_cursor.png",
tr("Select detail"), &MainWindow::ClosedDialogUnionDetails);
//Must disconnect this signal here.
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogTool::UpdateList);
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -56,5 +56,7 @@
<file>icon/16x16/portrait.png</file>
<file>icon/16x16/template.png</file>
<file>icon/32x32/pdf.png</file>
<file>icon/24x24/fx.png</file>
<file>icon/16x16/fx.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

View file

@ -35,9 +35,7 @@ const QString VAbstractSpline::TagName = QStringLiteral("spline");
VAbstractSpline::VAbstractSpline(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent)
:VDrawTool(doc, data, id), QGraphicsPathItem(parent), controlPoints(QVector<VControlPointSpline *>()),
sceneType(SceneObject::Unknown), isHovered(false), detailsMode(false)
{
ignoreFullUpdate = true;
}
{}
//---------------------------------------------------------------------------------------------------------------------
VAbstractSpline::~VAbstractSpline()

View file

@ -46,7 +46,7 @@ qreal VDrawTool::factor = 1;
* @param id object id in container.
*/
VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent)
:VAbstractTool(doc, data, id, parent), ignoreFullUpdate(false), nameActivDraw(doc->GetNameActivPP()),
:VAbstractTool(doc, data, id, parent), nameActivDraw(doc->GetNameActivPP()),
dialog(nullptr), typeLine(TypeLineLine), lineColor(ColorBlack), enabled(true)
{
connect(this->doc, &VPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw);

View file

@ -72,9 +72,6 @@ public slots:
virtual void EnableToolMove(bool move);
protected:
/** @brief ignoreFullUpdate ignore or not full updates. */
bool ignoreFullUpdate;
/** @brief nameActivDraw name of tool's pattern peace. */
QString nameActivDraw;
@ -142,10 +139,6 @@ protected:
connect(dialog, &DialogTool::DialogClosed, tool, &Tool::FullUpdateFromGuiOk);
connect(dialog, &DialogTool::DialogApplied, tool, &Tool::FullUpdateFromGuiApply);
if (ignoreFullUpdate == false)
{
connect(doc, &VPattern::FullUpdateFromFile, dialog, &DialogTool::UpdateList);
}
tool->setDialog();

View file

@ -52,7 +52,6 @@ VToolHeight::VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, con
:VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), p1LineId(p1LineId),
p2LineId(p2LineId)
{
ignoreFullUpdate = true;
if (typeCreation == Source::FromGui)
{
AddToFile();
@ -95,7 +94,6 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene,
SCASSERT(dialog != nullptr);
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
SCASSERT(dialogTool != nullptr);
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogHeight::UpdateList);
const QString pointName = dialogTool->getPointName();
const QString typeLine = dialogTool->GetTypeLine();
const QString lineColor = dialogTool->GetLineColor();

View file

@ -54,7 +54,6 @@ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstP
{
this->typeLine = typeLine;
this->lineColor = lineColor;
ignoreFullUpdate = true;
//Line
const QSharedPointer<VPointF> first = data->GeometricObject<VPointF>(firstPoint);
const QSharedPointer<VPointF> second = data->GeometricObject<VPointF>(secondPoint);

View file

@ -53,7 +53,6 @@ VToolLineIntersect::VToolLineIntersect(VPattern *doc, VContainer *data, const qu
:VToolPoint(doc, data, id, parent), p1Line1(p1Line1), p2Line1(p2Line1), p1Line2(p1Line2),
p2Line2(p2Line2)
{
ignoreFullUpdate = true;
if (typeCreation == Source::FromGui)
{
AddToFile();

View file

@ -49,7 +49,6 @@ VToolPointOfIntersection::VToolPointOfIntersection(VPattern *doc, VContainer *da
const Source &typeCreation, QGraphicsItem *parent)
:VToolPoint(doc, data, id, parent), firstPointId(firstPointId), secondPointId(secondPointId)
{
ignoreFullUpdate = true;
if (typeCreation == Source::FromGui)
{
AddToFile();

View file

@ -54,7 +54,6 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id,
{
baseColor = Qt::red;
this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine())/factor));
ignoreFullUpdate = true;
this->setFlag(QGraphicsItem::ItemIsMovable, true);
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
this->setFlag(QGraphicsItem::ItemIsFocusable, false);
@ -69,6 +68,13 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id,
}
}
//---------------------------------------------------------------------------------------------------------------------
VToolSinglePoint::~VToolSinglePoint()
{
//Disable cursor-arrow-openhand
VApplication::restoreOverrideCursor(cursorArrowOpenHand);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief setDialog set dialog when user want change tool option.

View file

@ -41,6 +41,7 @@ class VToolSinglePoint : public VToolPoint
public:
VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation,
const QString &namePP, const QString &mPath, QGraphicsItem * parent = nullptr );
virtual ~VToolSinglePoint();
virtual void setDialog();
static const QString ToolType;
virtual int type() const {return Type;}

View file

@ -97,7 +97,10 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr
//---------------------------------------------------------------------------------------------------------------------
VToolSpline::~VToolSpline()
{}
{
//Disable cursor-arrow-openhand
VApplication::restoreOverrideCursor(cursorArrowOpenHand);
}
//---------------------------------------------------------------------------------------------------------------------
/**

View file

@ -97,6 +97,13 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co
}
}
//---------------------------------------------------------------------------------------------------------------------
VToolSplinePath::~VToolSplinePath()
{
//Disable cursor-arrow-openhand
VApplication::restoreOverrideCursor(cursorArrowOpenHand);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief setDialog set dialog when user want change tool option.

View file

@ -40,20 +40,21 @@ class VToolSplinePath:public VAbstractSpline
public:
VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation,
QGraphicsItem * parent = nullptr);
virtual void setDialog();
static VToolSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data);
static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, const QString &color,
VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse,
const Source &typeCreation);
static const QString ToolType;
static void UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path);
virtual int type() const {return Type;}
enum { Type = UserType + static_cast<int>(Tool::SplinePath)};
virtual ~VToolSplinePath();
virtual void setDialog();
static VToolSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data);
static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, const QString &color,
VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse,
const Source &typeCreation);
static const QString ToolType;
static void UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path);
virtual int type() const {return Type;}
enum { Type = UserType + static_cast<int>(Tool::SplinePath)};
VSplinePath getSplinePath()const;
void setSplinePath(const VSplinePath &splPath);
VSplinePath getSplinePath()const;
void setSplinePath(const VSplinePath &splPath);
virtual void ShowVisualization(bool show);
virtual void ShowVisualization(bool show);
signals:
/**
* @brief RefreshLine refresh control line.

View file

@ -53,7 +53,6 @@ VToolTriangle::VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id,
:VToolPoint(doc, data, id, parent), axisP1Id(axisP1Id), axisP2Id(axisP2Id), firstPointId(firstPointId),
secondPointId(secondPointId)
{
ignoreFullUpdate = true;
if (typeCreation == Source::FromGui)
{
AddToFile();

View file

@ -69,6 +69,13 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePointP
controlLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
}
//---------------------------------------------------------------------------------------------------------------------
VControlPointSpline::~VControlPointSpline()
{
//Disable cursor-arrow-openhand
VApplication::restoreOverrideCursor(cursorArrowOpenHand);
}
//---------------------------------------------------------------------------------------------------------------------
void VControlPointSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{

View file

@ -42,6 +42,7 @@ class VControlPointSpline : public QObject, public QGraphicsEllipseItem
public:
VControlPointSpline(const qint32 &indexSpline, SplinePointPosition position, const QPointF &controlPoint,
const QPointF &splinePoint, QGraphicsItem * parent = nullptr);
virtual ~VControlPointSpline();
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
virtual int type() const {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ControlPointSpline)};

View file

@ -70,6 +70,13 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem( const QString & text, QGraphic
this->setAcceptHoverEvents(true);
}
//---------------------------------------------------------------------------------------------------------------------
VGraphicsSimpleTextItem::~VGraphicsSimpleTextItem()
{
//Disable cursor-arrow-openhand
VApplication::restoreOverrideCursor(cursorArrowOpenHand);
}
//---------------------------------------------------------------------------------------------------------------------
void VGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{

View file

@ -42,6 +42,7 @@ class VGraphicsSimpleTextItem : public QObject, public QGraphicsSimpleTextItem
public:
VGraphicsSimpleTextItem(QGraphicsItem *parent = nullptr);
VGraphicsSimpleTextItem( const QString & text, QGraphicsItem *parent = nullptr );
virtual ~VGraphicsSimpleTextItem();
qint32 FontSize()const;
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);

View file

@ -50,6 +50,7 @@ VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent)
ToolButton = new QToolButton(this);
ToolButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
ToolButton->setText("...");
ToolButton->setIcon(QIcon("://icon/16x16/fx.png"));
ToolButton->setFixedWidth(20);
ToolButton->installEventFilter(this);
setFocusProxy(ToolButton); // Make the ToolButton the focus proxy