diff -r e085f36e4d9f -r 7b62c52835a1 src/tools/transformtool.cpp --- a/src/tools/transformtool.cpp Tue Sep 28 00:21:09 2021 +0300 +++ b/src/tools/transformtool.cpp Tue Sep 28 22:14:00 2021 +0300 @@ -4,24 +4,19 @@ #include "linetypes/object.h" #include "transformtool.h" -TransformTool::TransformTool(Model* model, QObject* parent) : +TransformTool::TransformTool(Model* model, QWidget* parent) : BaseTool{model, parent}, model{model}, - button{new QPushButton{"Apply"}}, - widget{new QWidget} + matrixEditor{new MatrixEditor{parent}}, + button{new QPushButton{"Apply", parent}}, + widget{new QWidget{parent}} { widget->setLayout(new QHBoxLayout{widget}); - widget->layout()->addWidget(&this->matrixEditor); + widget->layout()->addWidget(this->matrixEditor); widget->layout()->addWidget(button); connect(button, &QPushButton::clicked, this, &TransformTool::applyButtonClicked); } -TransformTool::~TransformTool() -{ - delete this->widget; - delete this->button; -} - QString TransformTool::name() const { return "Transform"; @@ -45,7 +40,7 @@ void TransformTool::applyButtonClicked() { Model::EditContext editcontext = this->model->edit(); - const glm::mat4 matrix = this->matrixEditor.value(); + const glm::mat4 matrix = this->matrixEditor->value(); for (ldraw::id_t id : this->selection) { const ldraw::Object* object = model->get(id);