Fix bug with "internal variable" in localized form.

Some tools have internal variables, if click button Apply a dialog lost
information about such a variable.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-02-06 13:38:47 +02:00
parent 685f8a7d70
commit 8a19d8a0b1
5 changed files with 20 additions and 6 deletions

View File

@ -161,9 +161,6 @@ void DialogAlongLine::DeployFormulaTextEdit()
//---------------------------------------------------------------------------------------------------------------------
DialogAlongLine::~DialogAlongLine()
{
VContainer *locData = const_cast<VContainer *> (data);
locData->RemoveVariable(currentLength);
delete ui;
}

View File

@ -92,9 +92,6 @@ DialogSeamAllowance::DialogSeamAllowance(const VContainer *data, const quint32 &
//---------------------------------------------------------------------------------------------------------------------
DialogSeamAllowance::~DialogSeamAllowance()
{
VContainer *locData = const_cast<VContainer *> (data);
locData->RemoveVariable(currentSeamAllowance);
delete ui;
}

View File

@ -1108,6 +1108,11 @@ void DialogTool::SetAssociatedTool(VAbstractTool *tool)
{
associatedTool = tool;
SetToolId(tool->getId());
data = tool->getData();
if (not vis.isNull())
{
vis->SetData(data);
}
}
else
{

View File

@ -120,6 +120,18 @@ void Visualization::setMainColor(const QColor &value)
InitPen();
}
//---------------------------------------------------------------------------------------------------------------------
const VContainer *Visualization::GetData() const
{
return data;
}
//---------------------------------------------------------------------------------------------------------------------
void Visualization::SetData(const VContainer *data)
{
this->data = data;
}
//---------------------------------------------------------------------------------------------------------------------
void Visualization::SetFactor(qreal factor)
{

View File

@ -59,6 +59,9 @@ public:
virtual void VisualMode(const quint32 &pointId);
void setMainColor(const QColor &value);
const VContainer *GetData() const;
void SetData(const VContainer *data);
Mode GetMode() const;
void SetMode(const Mode &value);