2018-09-27 00:30:05 +01:00
|
|
|
#include "graphicsview.h"
|
|
|
|
#include "editor.h"
|
|
|
|
|
|
|
|
void GraphicsView::mousePressEvent(QMouseEvent *event) {
|
|
|
|
QGraphicsView::mousePressEvent(event);
|
|
|
|
if (editor) {
|
|
|
|
editor->objectsView_onMousePress(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void GraphicsView::mouseMoveEvent(QMouseEvent *event) {
|
|
|
|
QGraphicsView::mouseMoveEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GraphicsView::mouseReleaseEvent(QMouseEvent *event) {
|
|
|
|
QGraphicsView::mouseReleaseEvent(event);
|
|
|
|
}
|
2020-05-02 22:25:35 +01:00
|
|
|
|
2020-08-27 01:42:42 +01:00
|
|
|
void GraphicsView::drawForeground(QPainter *painter, const QRectF&) {
|
2020-05-02 22:25:35 +01:00
|
|
|
for (auto item : this->overlay.getItems()) {
|
|
|
|
item->render(painter);
|
|
|
|
}
|
|
|
|
}
|
2020-10-26 03:49:00 +00:00
|
|
|
|
|
|
|
void GraphicsView::moveEvent(QMoveEvent *event) {
|
|
|
|
QGraphicsView::moveEvent(event);
|
|
|
|
QLabel *label_MapRulerStatus = findChild<QLabel *>("label_MapRulerStatus", Qt::FindDirectChildrenOnly);
|
|
|
|
if (label_MapRulerStatus && label_MapRulerStatus->isVisible())
|
|
|
|
label_MapRulerStatus->move(mapToGlobal(QPoint(6, 6)));
|
|
|
|
}
|