24 lines
531 B
C++
24 lines
531 B
C++
|
#include "draaideur.h"
|
||
|
#include <QPaintDevice>
|
||
|
#include <QPainter>
|
||
|
#include <QPen>
|
||
|
|
||
|
Draaideur::Draaideur(int x, int y, int lengte): Deur(x,y,lengte){
|
||
|
|
||
|
}
|
||
|
|
||
|
void Draaideur::teken(QPaintDevice* tp){
|
||
|
QPainter p(tp);
|
||
|
QColor kleur;
|
||
|
p.setBrush(Qt::SolidPattern);
|
||
|
if(isDeurOpen())
|
||
|
kleur=Qt::blue;
|
||
|
else
|
||
|
kleur=Qt::yellow;
|
||
|
|
||
|
p.setBrush(kleur);
|
||
|
QPen pen(kleur,2,Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
|
||
|
p.setPen(pen);
|
||
|
p.drawEllipse(coordinaten().first,coordinaten().second,20,20);
|
||
|
}
|