Fri, 07 Feb 2020 01:58:34 +0200
added selection highlighting
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)); | |
48
3c10f0e2fbe0
added selection highlighting
Teemu Piippo <teemu@hecknology.net>
parents:
47
diff
changeset
|
18 | this->setHighlight(id); |
47 | 19 | PartRenderer::mouseMoveEvent(event); |
20 | } |