F(x) button for tool Segment an arc.
--HG-- branch : feature
This commit is contained in:
parent
d4403c1714
commit
3af87c2260
|
@ -34,6 +34,7 @@
|
||||||
#include "../../visualization/vistoolcutarc.h"
|
#include "../../visualization/vistoolcutarc.h"
|
||||||
#include "../../widgets/vmaingraphicsscene.h"
|
#include "../../widgets/vmaingraphicsscene.h"
|
||||||
#include "../../xml/vpattern.h"
|
#include "../../xml/vpattern.h"
|
||||||
|
#include "dialogeditwrongformula.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +47,6 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge
|
||||||
path(nullptr)
|
path(nullptr)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
InitVariables(ui);
|
|
||||||
InitFormulaUI(ui);
|
InitFormulaUI(ui);
|
||||||
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
|
ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel));
|
||||||
labelEditNamePoint = ui->labelEditNamePoint;
|
labelEditNamePoint = ui->labelEditNamePoint;
|
||||||
|
@ -60,9 +60,7 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge
|
||||||
FillComboBoxArcs(ui->comboBoxArc);
|
FillComboBoxArcs(ui->comboBoxArc);
|
||||||
FillComboBoxLineColors(ui->comboBoxColor);
|
FillComboBoxLineColors(ui->comboBoxColor);
|
||||||
|
|
||||||
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutArc::PutHere);
|
connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogCutArc::FXLength);
|
||||||
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutArc::PutVal);
|
|
||||||
|
|
||||||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutArc::NamePointChanged);
|
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutArc::NamePointChanged);
|
||||||
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutArc::FormulaTextChanged);
|
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutArc::FormulaTextChanged);
|
||||||
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit);
|
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit);
|
||||||
|
@ -76,6 +74,19 @@ void DialogCutArc::FormulaTextChanged()
|
||||||
this->FormulaChangedPlainText();
|
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()
|
void DialogCutArc::ShowVisualization()
|
||||||
{
|
{
|
||||||
|
|
|
@ -69,6 +69,7 @@ public slots:
|
||||||
* @brief FormulaTextChanged when formula text changes for validation and calc
|
* @brief FormulaTextChanged when formula text changes for validation and calc
|
||||||
*/
|
*/
|
||||||
void FormulaTextChanged();
|
void FormulaTextChanged();
|
||||||
|
void FXLength();
|
||||||
protected:
|
protected:
|
||||||
virtual void ShowVisualization();
|
virtual void ShowVisualization();
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>412</width>
|
<width>412</width>
|
||||||
<height>466</height>
|
<height>218</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -84,13 +84,13 @@
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="toolButtonPutHere">
|
<widget class="QToolButton" name="toolButtonExprLength">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">...</string>
|
<string notr="true">...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../share/resources/icon.qrc">
|
<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>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -197,211 +197,55 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<widget class="QLabel" name="label_3">
|
||||||
<item>
|
<property name="sizePolicy">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<item>
|
<horstretch>0</horstretch>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<verstretch>0</verstretch>
|
||||||
<item row="0" column="0">
|
</sizepolicy>
|
||||||
<widget class="QLabel" name="label_3">
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="text">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<string>Arc</string>
|
||||||
<horstretch>0</horstretch>
|
</property>
|
||||||
<verstretch>0</verstretch>
|
</widget>
|
||||||
</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>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="1">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<widget class="QComboBox" name="comboBoxArc">
|
||||||
<item>
|
<property name="toolTip">
|
||||||
<widget class="QCheckBox" name="checkBoxHideEmpty">
|
<string>Selected arc</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Hide empty measurements</string>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
<property name="checked">
|
<item row="1" column="0">
|
||||||
<bool>true</bool>
|
<widget class="QLabel" name="labelEditNamePoint">
|
||||||
</property>
|
<property name="sizePolicy">
|
||||||
</widget>
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
</item>
|
<horstretch>0</horstretch>
|
||||||
<item>
|
<verstretch>0</verstretch>
|
||||||
<widget class="QListWidget" name="listWidget">
|
</sizepolicy>
|
||||||
<property name="toolTip">
|
</property>
|
||||||
<string>Variables - Click twice to insert into formula</string>
|
<property name="text">
|
||||||
</property>
|
<string>Point label</string>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
</widget>
|
||||||
</layout>
|
</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>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="labelDescription">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -416,19 +260,9 @@
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>plainTextEditFormula</tabstop>
|
<tabstop>plainTextEditFormula</tabstop>
|
||||||
<tabstop>toolButtonPutHere</tabstop>
|
|
||||||
<tabstop>pushButtonGrowLength</tabstop>
|
<tabstop>pushButtonGrowLength</tabstop>
|
||||||
<tabstop>comboBoxArc</tabstop>
|
<tabstop>comboBoxArc</tabstop>
|
||||||
<tabstop>lineEditNamePoint</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>
|
<tabstop>buttonBox</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user