Refactoring. Always use AddTool method.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-02-10 12:13:34 +02:00
parent 1f15722417
commit 9eac04654c
3 changed files with 3 additions and 7 deletions

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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;