-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatternView.cpp
More file actions
47 lines (40 loc) · 1.32 KB
/
Copy pathPatternView.cpp
File metadata and controls
47 lines (40 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "PatternView.h"
PatternView::PatternView(QWidget* a_parent)
: sgv::SignalerGraphicsView(a_parent)
, m_background_painter(*this)
, m_foreground_painter(*this)
, m_selection_handler (*this)
, m_paste_handler (*this)
{
connect(this, &PatternView::selectionChanged, &m_foreground_painter, &PatternViewForegroundPainter::onSelectionChanged);
}
void PatternView::resetSelection()
{
m_selection_handler.reset();
}
void PatternView::drawBackground(QPainter* a_painter, const QRectF& a_rect)
{
SignalerGraphicsView::drawBackground(a_painter, a_rect);
m_background_painter .drawBackground(a_painter, a_rect);
}
void PatternView::drawForeground(QPainter* a_painter, const QRectF& a_rect)
{
SignalerGraphicsView::drawForeground(a_painter, a_rect);
m_foreground_painter .drawForeground(a_painter, a_rect);
}
void PatternView::mousePressEvent(QMouseEvent* a_event)
{
m_selection_handler .mousePressEvent(a_event);
SignalerGraphicsView::mousePressEvent(a_event);
}
void PatternView::mouseMoveEvent(QMouseEvent* a_event)
{
m_selection_handler .mouseMoveEvent(a_event);
SignalerGraphicsView::mouseMoveEvent(a_event);
}
void PatternView::mouseReleaseEvent(QMouseEvent* a_event)
{
m_selection_handler .mouseReleaseEvent(a_event);
m_paste_handler .mouseReleaseEvent(a_event);
SignalerGraphicsView::mouseReleaseEvent(a_event);
}