2022-02-10 16:44:22 +00:00
|
|
|
#include "draaideur.h"
|
|
|
|
#include <QPaintDevice>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QPen>
|
|
|
|
|
2022-02-17 23:51:34 +00:00
|
|
|
draaideur::draaideur(int x, int y, int lengte, bool liggend): Deur(x,y,lengte), liggend(liggend){
|
2022-02-10 16:44:22 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-02-17 23:51:34 +00:00
|
|
|
void draaideur::teken(QPaintDevice *tp){
|
2022-02-10 16:44:22 +00:00
|
|
|
QPainter p(tp);
|
2022-02-17 23:51:34 +00:00
|
|
|
QColor kleur=Qt::black;
|
2022-02-10 16:44:22 +00:00
|
|
|
p.setBrush(Qt::SolidPattern);
|
2022-02-17 23:51:34 +00:00
|
|
|
p.setBrush(kleur);
|
|
|
|
QPen pen(kleur,2,Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
|
|
|
|
p.setPen(pen);
|
|
|
|
if(!isDeurOpen() && !liggend)
|
|
|
|
p.drawLine(coordinaten().first, coordinaten().second, coordinaten().first, coordinaten().second - deurLengte());
|
|
|
|
else if(!isDeurOpen() && liggend)
|
|
|
|
p.drawLine(coordinaten().first, coordinaten().second, coordinaten().first - deurLengte(), coordinaten().second);
|
|
|
|
else if(isDeurOpen() && !liggend)
|
|
|
|
p.drawLine(coordinaten().first, coordinaten().second, coordinaten().first + deurLengte(), coordinaten().second);
|
|
|
|
else if(isDeurOpen() && liggend)
|
|
|
|
p.drawLine(coordinaten().first, coordinaten().second, coordinaten().first, coordinaten().second - deurLengte());
|
2022-02-10 16:44:22 +00:00
|
|
|
}
|