src/ui/canvas.cpp

Thu, 06 Feb 2020 23:41:20 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 06 Feb 2020 23:41:20 +0200
changeset 47
cd6704009eb9
child 48
3c10f0e2fbe0
permissions
-rw-r--r--

picking works now

#include <QMouseEvent>
#include "canvas.h"

Canvas::Canvas(
	Model* model,
	DocumentManager* documents,
	const ldraw::ColorTable& colorTable,
	QWidget* parent) :
	PartRenderer{model, documents, colorTable, parent}
{
	this->setMouseTracking(true);
}

void Canvas::mouseMoveEvent(QMouseEvent* event)
{
	const ldraw::Id id = this->pick(event->pos());
	this->newStatusText("Selected: %1"_q.arg(id.value));
	PartRenderer::mouseMoveEvent(event);
}

mercurial