src/tools/selecttool.cpp

changeset 143
7b62c52835a1
parent 126
a7c720aff97c
child 152
03f8e6d42e13
--- a/src/tools/selecttool.cpp	Tue Sep 28 00:21:09 2021 +0300
+++ b/src/tools/selecttool.cpp	Tue Sep 28 22:14:00 2021 +0300
@@ -1,8 +1,8 @@
 #include "selecttool.h"
 
-SelectTool::SelectTool(Model* model, QObject* parent) :
+SelectTool::SelectTool(Model* model, QWidget* parent) :
 	BaseTool{model, parent},
-	objectEditor{model, ldraw::NULL_ID, nullptr} {}
+	objectEditor{new ObjectEditor{model, ldraw::NULL_ID, parent}} {}
 
 QString SelectTool::name() const
 {
@@ -37,17 +37,17 @@
 
 QWidget* SelectTool::toolWidget()
 {
-	return &this->objectEditor;
+	return this->objectEditor;
 }
 
 void SelectTool::selectionChanged(const QSet<ldraw::id_t>& newSelection)
 {
 	if (newSelection.size() == 1)
 	{
-		this->objectEditor.setObjectId(*newSelection.begin());
+		this->objectEditor->setObjectId(*newSelection.begin());
 	}
 	else
 	{
-		this->objectEditor.setObjectId(ldraw::NULL_ID);
+		this->objectEditor->setObjectId(ldraw::NULL_ID);
 	}
 }

mercurial