F(x) button for tool "Point at distance and angle".

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-04-29 17:57:02 +03:00
parent 75dd335cca
commit 7baefba769
37 changed files with 168 additions and 442 deletions

View file

@ -423,13 +423,3 @@ void DialogDetail::DeleteItem()
ValidObjects(false); 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 ClickedReverse(bool checked);
void ObjectChanged(int row); void ObjectChanged(int row);
void DeleteItem(); void DeleteItem();
virtual void UpdateList();
protected: protected:
/** /**
* @brief SaveData Put dialog data in local variables * @brief SaveData Put dialog data in local variables

View file

@ -34,6 +34,7 @@
#include "../../visualization/vistoolendline.h" #include "../../visualization/vistoolendline.h"
#include "../../widgets/vmaingraphicsscene.h" #include "../../widgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h" #include "../../tools/vabstracttool.h"
#include "dialogeditwrongformula.h"
#include <QTimer> #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) formulaLength(QString()), formulaAngle(QString()), formulaBaseHeight(0), formulaBaseHeightAngle(0), line(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;
@ -65,8 +65,8 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid
FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics());
FillComboBoxLineColors(ui->comboBoxLineColor); FillComboBoxLineColors(ui->comboBoxLineColor);
connect(ui->toolButtonPutHereLength, &QPushButton::clicked, this, &DialogEndLine::PutHere); connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogEndLine::FXLength);
connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogEndLine::PutAngle); connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogEndLine::FXAngle);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged); 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); 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 * @brief EvalAngle calculate value of angle
@ -127,6 +118,32 @@ void DialogEndLine::DeployAngleTextEdit()
DeployFormula(ui->plainTextEditAngle, ui->pushButtonGrowLengthAngle, formulaBaseHeightAngle); 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. * @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 * @brief FormulaTextChanged when formula text changes for validation and calc
*/ */
void FormulaTextChanged(); void FormulaTextChanged();
void PutAngle();
void EvalAngle(); void EvalAngle();
void AngleTextChanged(); void AngleTextChanged();
void DeployAngleTextEdit(); void DeployAngleTextEdit();
void FXAngle();
void FXLength();
protected: protected:
virtual void ShowVisualization(); virtual void ShowVisualization();
/** /**

View file

@ -6,12 +6,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>417</width> <width>358</width>
<height>571</height> <height>323</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -32,7 +32,7 @@
<item> <item>
<widget class="QLabel" name="labelEditFormula"> <widget class="QLabel" name="labelEditFormula">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -84,6 +84,9 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
@ -93,13 +96,19 @@
</spacer> </spacer>
</item> </item>
<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"> <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>
@ -111,6 +120,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="label_4"> <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"> <property name="text">
<string/> <string/>
</property> </property>
@ -122,14 +137,14 @@
<item> <item>
<widget class="QLabel" name="labelResultCalculation"> <widget class="QLabel" name="labelResultCalculation">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>87</width> <width>60</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -210,7 +225,7 @@
<item> <item>
<widget class="QLabel" name="labelEditAngle"> <widget class="QLabel" name="labelEditAngle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -271,13 +286,19 @@
</spacer> </spacer>
</item> </item>
<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"> <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>
@ -289,6 +310,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="label_5"> <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"> <property name="text">
<string/> <string/>
</property> </property>
@ -300,14 +327,14 @@
<item> <item>
<widget class="QLabel" name="labelResultCalculationAngle"> <widget class="QLabel" name="labelResultCalculationAngle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>87</width> <width>60</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -384,252 +411,102 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QFormLayout" name="formLayout">
<item> <property name="fieldGrowthPolicy">
<layout class="QVBoxLayout" name="verticalLayout_2"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
<item> </property>
<layout class="QFormLayout" name="formLayout"> <item row="0" column="0">
<property name="fieldGrowthPolicy"> <widget class="QLabel" name="label_3">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<item row="0" column="0"> <horstretch>0</horstretch>
<widget class="QLabel" name="label_3"> <verstretch>0</verstretch>
<property name="sizePolicy"> </sizepolicy>
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> </property>
<horstretch>0</horstretch> <property name="text">
<verstretch>0</verstretch> <string>Base point</string>
</sizepolicy> </property>
</property> </widget>
<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>
</item> </item>
<item> <item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout"> <widget class="QComboBox" name="comboBoxBasePoint">
<item> <property name="toolTip">
<widget class="QCheckBox" name="checkBoxHideEmpty"> <string>First point of line</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="Expanding" vsizetype="Preferred">
</item> <horstretch>0</horstretch>
<item> <verstretch>0</verstretch>
<widget class="QListWidget" name="listWidget"> </sizepolicy>
<property name="toolTip"> </property>
<string>Variables</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_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> </item>
</layout> </layout>
</item> </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> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">
@ -644,23 +521,12 @@
</widget> </widget>
<tabstops> <tabstops>
<tabstop>plainTextEditFormula</tabstop> <tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHereLength</tabstop>
<tabstop>pushButtonGrowLength</tabstop> <tabstop>pushButtonGrowLength</tabstop>
<tabstop>plainTextEditAngle</tabstop> <tabstop>plainTextEditAngle</tabstop>
<tabstop>toolButtonPutHereAngle</tabstop>
<tabstop>pushButtonGrowLengthAngle</tabstop> <tabstop>pushButtonGrowLengthAngle</tabstop>
<tabstop>comboBoxBasePoint</tabstop> <tabstop>comboBoxBasePoint</tabstop>
<tabstop>lineEditNamePoint</tabstop> <tabstop>lineEditNamePoint</tabstop>
<tabstop>comboBoxLineType</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> <tabstop>buttonBox</tabstop>
</tabstops> </tabstops>
<resources> <resources>

View file

@ -249,15 +249,6 @@ void DialogHeight::PointNameChanged()
CheckState(); 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() void DialogHeight::ShowVisualization()
{ {

View file

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

View file

@ -140,15 +140,6 @@ void DialogLine::PointNameChanged()
CheckState(); 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() void DialogLine::ShowVisualization()
{ {

View file

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

View file

@ -224,15 +224,6 @@ void DialogLineIntersect::PointNameChanged()
CheckState(); 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() void DialogLineIntersect::ShowVisualization()
{ {

View file

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

View file

@ -156,15 +156,6 @@ void DialogPointOfIntersection::PointNameChanged()
CheckState(); 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() void DialogPointOfIntersection::ShowVisualization()
{ {

View file

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

View file

@ -77,15 +77,6 @@ void DialogSinglePoint::SaveData()
pointName = ui->lineEditName->text(); 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 * @brief setData set name and point

View file

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

View file

@ -180,15 +180,6 @@ void DialogSpline::PointNameChanged()
CheckState(); 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() void DialogSpline::ShowVisualization()
{ {

View file

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

View file

@ -243,15 +243,6 @@ void DialogSplinePath::KAsm2Changed(qreal d)
item->setData(Qt::UserRole, QVariant::fromValue(p)); 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) void DialogSplinePath::ShowDialog(bool click)
{ {

View file

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

View file

@ -1083,45 +1083,6 @@ void DialogTool::ValChenged(int row)
} }
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @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 // cppcheck-suppress unusedFunction
quint32 DialogTool::GetToolId() const quint32 DialogTool::GetToolId() const

View file

@ -121,7 +121,6 @@ public slots:
void PutHere(); void PutHere();
void PutVal(QListWidgetItem * item); void PutVal(QListWidgetItem * item);
virtual void ValChenged(int row); virtual void ValChenged(int row);
virtual void UpdateList();
virtual void PointNameChanged(){} virtual void PointNameChanged(){}
protected: protected:
Q_DISABLE_COPY(DialogTool) Q_DISABLE_COPY(DialogTool)

View file

@ -195,15 +195,6 @@ void DialogTriangle::PointNameChanged()
CheckState(); 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() void DialogTriangle::ShowVisualization()
{ {

View file

@ -64,7 +64,6 @@ public:
public slots: public slots:
virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void ChosenObject(quint32 id, const SceneObject &type);
virtual void PointNameChanged(); virtual void PointNameChanged();
virtual void UpdateList();
protected: protected:
virtual void ShowVisualization(); 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 * @brief CheckObject check if detail contain this id

View file

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

View file

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

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) VAbstractSpline::VAbstractSpline(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent)
:VDrawTool(doc, data, id), QGraphicsPathItem(parent), controlPoints(QVector<VControlPointSpline *>()), :VDrawTool(doc, data, id), QGraphicsPathItem(parent), controlPoints(QVector<VControlPointSpline *>()),
sceneType(SceneObject::Unknown), isHovered(false), detailsMode(false) sceneType(SceneObject::Unknown), isHovered(false), detailsMode(false)
{ {}
ignoreFullUpdate = true;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VAbstractSpline::~VAbstractSpline() VAbstractSpline::~VAbstractSpline()

View file

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

View file

@ -72,9 +72,6 @@ public slots:
virtual void EnableToolMove(bool move); virtual void EnableToolMove(bool move);
protected: protected:
/** @brief ignoreFullUpdate ignore or not full updates. */
bool ignoreFullUpdate;
/** @brief nameActivDraw name of tool's pattern peace. */ /** @brief nameActivDraw name of tool's pattern peace. */
QString nameActivDraw; QString nameActivDraw;
@ -142,10 +139,6 @@ protected:
connect(dialog, &DialogTool::DialogClosed, tool, &Tool::FullUpdateFromGuiOk); connect(dialog, &DialogTool::DialogClosed, tool, &Tool::FullUpdateFromGuiOk);
connect(dialog, &DialogTool::DialogApplied, tool, &Tool::FullUpdateFromGuiApply); connect(dialog, &DialogTool::DialogApplied, tool, &Tool::FullUpdateFromGuiApply);
if (ignoreFullUpdate == false)
{
connect(doc, &VPattern::FullUpdateFromFile, dialog, &DialogTool::UpdateList);
}
tool->setDialog(); 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), :VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), p1LineId(p1LineId),
p2LineId(p2LineId) p2LineId(p2LineId)
{ {
ignoreFullUpdate = true;
if (typeCreation == Source::FromGui) if (typeCreation == Source::FromGui)
{ {
AddToFile(); AddToFile();
@ -95,7 +94,6 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene,
SCASSERT(dialog != nullptr); SCASSERT(dialog != nullptr);
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog); DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
SCASSERT(dialogTool != nullptr); SCASSERT(dialogTool != nullptr);
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogHeight::UpdateList);
const QString pointName = dialogTool->getPointName(); const QString pointName = dialogTool->getPointName();
const QString typeLine = dialogTool->GetTypeLine(); const QString typeLine = dialogTool->GetTypeLine();
const QString lineColor = dialogTool->GetLineColor(); 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->typeLine = typeLine;
this->lineColor = lineColor; this->lineColor = lineColor;
ignoreFullUpdate = true;
//Line //Line
const QSharedPointer<VPointF> first = data->GeometricObject<VPointF>(firstPoint); const QSharedPointer<VPointF> first = data->GeometricObject<VPointF>(firstPoint);
const QSharedPointer<VPointF> second = data->GeometricObject<VPointF>(secondPoint); 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), :VToolPoint(doc, data, id, parent), p1Line1(p1Line1), p2Line1(p2Line1), p1Line2(p1Line2),
p2Line2(p2Line2) p2Line2(p2Line2)
{ {
ignoreFullUpdate = true;
if (typeCreation == Source::FromGui) if (typeCreation == Source::FromGui)
{ {
AddToFile(); AddToFile();

View file

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

View file

@ -54,7 +54,6 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id,
{ {
baseColor = Qt::red; baseColor = Qt::red;
this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine())/factor)); this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine())/factor));
ignoreFullUpdate = true;
this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true);
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
this->setFlag(QGraphicsItem::ItemIsFocusable, false); this->setFlag(QGraphicsItem::ItemIsFocusable, false);

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), :VToolPoint(doc, data, id, parent), axisP1Id(axisP1Id), axisP2Id(axisP2Id), firstPointId(firstPointId),
secondPointId(secondPointId) secondPointId(secondPointId)
{ {
ignoreFullUpdate = true;
if (typeCreation == Source::FromGui) if (typeCreation == Source::FromGui)
{ {
AddToFile(); AddToFile();