Fixed issue #662. Valentina closes when creating details on 64 bit systems.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2017-04-15 13:25:07 +03:00
parent 73c035ecc9
commit e8917bd10d
4 changed files with 19 additions and 9 deletions

View file

@ -643,6 +643,7 @@ void MainWindow::ClosedDialog(int result)
SCASSERT(scene != nullptr)
QGraphicsItem *tool = dynamic_cast<QGraphicsItem *>(DrawTool::Create(dialogTool, scene, doc, pattern));
SCASSERT(tool != nullptr)
ui->view->itemClicked(tool);
}
ArrowTool();
@ -664,23 +665,25 @@ void MainWindow::ClosedDialogWithApply(int result, VMainGraphicsScene *scene)
{
SCASSERT(scene != nullptr)
dialogTool->SetAssociatedTool(
dynamic_cast<VAbstractTool * > (DrawTool::Create(dialogTool, scene, doc, pattern)));
dialogTool->SetAssociatedTool(DrawTool::Create(dialogTool, scene, doc, pattern));
}
else
{ // Or update associated tool with data
VDrawTool * vtool= static_cast<VDrawTool *>(dialogTool->GetAssociatedTool());
DrawTool * vtool= qobject_cast<DrawTool *>(dialogTool->GetAssociatedTool());
SCASSERT(vtool != nullptr)
vtool->FullUpdateFromGuiApply();
}
}
SCASSERT(not dialogTool.isNull())
QGraphicsItem *tool = dynamic_cast<QGraphicsItem *>(dialogTool->GetAssociatedTool());
SCASSERT(tool != nullptr)
ui->view->itemClicked(tool);
if (dialogTool->GetAssociatedTool() != nullptr)
{
VDrawTool *vtool= static_cast<VDrawTool *>(dialogTool->GetAssociatedTool());
DrawTool *vtool= qobject_cast<DrawTool *>(dialogTool->GetAssociatedTool());
SCASSERT(vtool != nullptr)
vtool->DialogLinkDestroy();
connect(vtool, &VDrawTool::ToolTip, this, &MainWindow::ShowToolTip);
connect(vtool, &DrawTool::ToolTip, this, &MainWindow::ShowToolTip);
}
ArrowTool();
// If insert not to the end of file call lite parse
@ -708,12 +711,11 @@ void MainWindow::ApplyDialog(VMainGraphicsScene *scene)
{
SCASSERT(scene != nullptr)
dialogTool->SetAssociatedTool(
static_cast<VAbstractTool * > (DrawTool::Create(dialogTool, scene, doc, pattern)));
dialogTool->SetAssociatedTool(DrawTool::Create(dialogTool, scene, doc, pattern));
}
else
{ // Or update associated tool with data
VDrawTool * vtool= static_cast<VDrawTool *>(dialogTool->GetAssociatedTool());
DrawTool * vtool= qobject_cast<DrawTool *>(dialogTool->GetAssociatedTool());
SCASSERT(vtool != nullptr)
vtool->FullUpdateFromGuiApply();
}

View file

@ -69,7 +69,8 @@ public:
/** @brief setDialog set dialog when user want change tool option. */
virtual void setDialog() {}
virtual void DialogLinkDestroy();
void DialogLinkDestroy();
QString getLineType() const;
virtual void SetTypeLine(const QString &value);

View file

@ -167,6 +167,12 @@ void VToolSeamAllowance::Remove(bool ask)
}
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::DialogLinkDestroy()
{
m_dialog=nullptr;
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::InsertNode(VPieceNode node, quint32 pieceId, VMainGraphicsScene *scene,
VContainer *data, VAbstractPattern *doc)

View file

@ -74,6 +74,7 @@ public:
static const QString AttrBottomPin;
void Remove(bool ask);
void DialogLinkDestroy();
static void InsertNode(VPieceNode node, quint32 pieceId, VMainGraphicsScene *scene, VContainer *data,
VAbstractPattern *doc);