Refactoring. Always use AddTool method.
--HG-- branch : develop
This commit is contained in:
parent
1f15722417
commit
9eac04654c
|
@ -244,9 +244,7 @@ void MainWindow::AddPP(const QString &PPName)
|
|||
connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolBasePoint::SetFactor);
|
||||
connect(sceneDraw, &VMainGraphicsScene::EnableToolMove, spoint, &VToolBasePoint::EnableToolMove);
|
||||
|
||||
QHash<quint32, VDataTool*>* tools = doc->getTools();
|
||||
SCASSERT(tools != nullptr);
|
||||
tools->insert(id, spoint);
|
||||
doc->AddTool(id, spoint);
|
||||
VDrawTool::AddRecord(id, Tool::BasePoint, doc);
|
||||
SetEnableTool(true);
|
||||
SetEnableWidgets(true);
|
||||
|
|
|
@ -235,8 +235,7 @@ void VToolDetail::Create(const quint32 &_id, const VDetail &newDetail, VMainGrap
|
|||
VToolDetail *detail = new VToolDetail(doc, data, id, typeCreation, scene, drawName);
|
||||
scene->addItem(detail);
|
||||
connect(detail, &VToolDetail::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
QHash<quint32, VDataTool*>* tools = doc->getTools();
|
||||
tools->insert(id, detail);
|
||||
doc->AddTool(id, detail);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -551,8 +551,7 @@ VToolUnionDetails* VToolUnionDetails::Create(const quint32 _id, const VDetail &d
|
|||
{
|
||||
//Scene doesn't show this tool, so doc will destroy this object.
|
||||
unionDetails = new VToolUnionDetails(doc, data, id, d1, d2, indexD1, indexD2, typeCreation, drawName, doc);
|
||||
QHash<quint32, VDataTool*>* tools = doc->getTools();
|
||||
tools->insert(id, unionDetails);
|
||||
doc->AddTool(id, unionDetails);
|
||||
}
|
||||
//Then create new details
|
||||
VNodeDetail det1p1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user