-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdrawable.cpp
More file actions
32 lines (24 loc) · 712 Bytes
/
Copy pathdrawable.cpp
File metadata and controls
32 lines (24 loc) · 712 Bytes
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
#include "drawable.h"
#include "renderarea.h"
#include <assert.h>
Drawable::Drawable(RenderArea *renderArea) : QObject(NULL), renderArea(renderArea)
{
}
Drawable::~Drawable()
{
}
PointDrawable::~PointDrawable()
{
disconnect(renderArea, SIGNAL(painting()), this, SLOT(draw()));
disconnect(this, SIGNAL(drawPoint(QPointF)), renderArea, SLOT(drawPoint(QPointF)));
}
PointDrawable::PointDrawable(QPointF p, RenderArea *renderArea):Drawable(renderArea), pt(p)
{
assert(renderArea != NULL);
connect(renderArea, SIGNAL(painting()), this, SLOT(draw()));
connect(this, SIGNAL(drawPoint(QPointF)), renderArea, SLOT(drawPoint(QPointF)));
}
void PointDrawable::draw()
{
emit drawPoint(pt);
}