Thu, 06 Feb 2020 23:41:20 +0200
picking works now
47 | 1 | #include <QMouseEvent> |
2 | #include "canvas.h" | |
3 | ||
4 | Canvas::Canvas( | |
5 | Model* model, | |
6 | DocumentManager* documents, | |
7 | const ldraw::ColorTable& colorTable, | |
8 | QWidget* parent) : | |
9 | PartRenderer{model, documents, colorTable, parent} | |
10 | { | |
11 | this->setMouseTracking(true); | |
12 | } | |
13 | ||
14 | void Canvas::mouseMoveEvent(QMouseEvent* event) | |
15 | { | |
16 | const ldraw::Id id = this->pick(event->pos()); | |
17 | this->newStatusText("Selected: %1"_q.arg(id.value)); | |
18 | PartRenderer::mouseMoveEvent(event); | |
19 | } |