Dimension plugins - basic tools

This commit is contained in:
Jakub Melka
2020-11-21 16:56:10 +01:00
parent 3b2d3877f7
commit ae970640bb
15 changed files with 989 additions and 19 deletions

View File

@ -730,14 +730,19 @@ PDFToolManager::PDFToolManager(PDFDrawWidgetProxy* proxy, Actions actions, QObje
for (PDFWidgetTool* tool : m_predefinedTools)
{
m_tools.insert(tool);
connect(tool, &PDFWidgetTool::messageDisplayRequest, this, &PDFToolManager::messageDisplayRequest);
addTool(tool);
}
}
if (QAction* action = tool->getAction())
{
m_actionsToTools[action] = tool;
connect(action, &QAction::triggered, this, &PDFToolManager::onToolActionTriggered);
}
void PDFToolManager::addTool(PDFWidgetTool* tool)
{
m_tools.insert(tool);
connect(tool, &PDFWidgetTool::messageDisplayRequest, this, &PDFToolManager::messageDisplayRequest);
if (QAction* action = tool->getAction())
{
m_actionsToTools[action] = tool;
connect(action, &QAction::triggered, this, &PDFToolManager::onToolActionTriggered);
}
}
@ -1142,6 +1147,11 @@ void PDFPickTool::mouseMoveEvent(QWidget* widget, QMouseEvent* event)
}
}
QPointF PDFPickTool::getSnappedPoint() const
{
return m_snapper.getSnappedPoint();
}
void PDFPickTool::setActiveImpl(bool active)
{
BaseClass::setActiveImpl(active);