-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRacquet.cpp
More file actions
36 lines (28 loc) · 706 Bytes
/
Racquet.cpp
File metadata and controls
36 lines (28 loc) · 706 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
33
34
35
36
#include "Racquet.h"
#include <QtGui/QPainter>
Racquet::Racquet(QGraphicsItem *parent) :
QGraphicsRectItem(parent)
{
}
Racquet::Racquet(const QRectF &rect, QGraphicsItem *parent) :
QGraphicsRectItem(rect, parent)
{
}
Racquet::Racquet(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent) :
QGraphicsRectItem(x, y, w, h, parent)
{
}
void Racquet::setSettng(const Setting &setting)
{
_setting = setting;
}
Setting Racquet::setting() const
{
return _setting;
}
void Racquet::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
painter->setPen(QPen(Qt::black, 1));
painter->setBrush(QBrush(_setting.color()));
painter->drawRect(this->rect());
}