src/tools/selecttool.cpp

changeset 191
d355d4c52d51
parent 190
3dbdc243f053
child 192
e6faeffed1d1
--- a/src/tools/selecttool.cpp	Wed May 25 13:49:45 2022 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-#include "selecttool.h"
-
-SelectTool::SelectTool(Document* document) :
-	BaseTool{document},
-	objectEditor{new ObjectEditor{document, ldraw::NULL_ID}}
-{
-}
-
-QString SelectTool::name() const
-{
-	static const QString result = tr("Select");
-	return result;
-}
-
-QString SelectTool::toolTip() const
-{
-	static const QString result = tr("Select elements from the model.");
-	return result;
-}
-
-bool SelectTool::mouseClick(Canvas* canvas, QMouseEvent* event)
-{
-	if (event->button() == Qt::LeftButton)
-	{
-		const ldraw::id_t highlighted = canvas->getHighlightedObject();
-		canvas->clearSelection();
-		if (highlighted != ldraw::NULL_ID)
-		{
-			canvas->addToSelection(highlighted);
-		}
-		return true;
-	}
-	else
-	{
-		return false;
-	}
-}
-
-QWidget* SelectTool::toolWidget()
-{
-	return this->objectEditor;
-}
-
-void SelectTool::selectionChanged(const QSet<ldraw::id_t>& newSelection)
-{
-	if (newSelection.size() == 1)
-	{
-		this->objectEditor->setObjectId(*newSelection.begin());
-	}
-	else
-	{
-		this->objectEditor->setObjectId(ldraw::NULL_ID);
-	}
-}
-
-QString SelectTool::iconName() const
-{
-	return ":/icons/navigate-outline.png";
-}

mercurial