Qt-Gebouw/hallsensor.cpp
Hello-User b9f62b20e5 init
2022-02-10 17:44:22 +01:00

24 lines
522 B
C++

#include "hallsensor.h"
#include <QPaintDevice>
#include <QPainter>
#include <QPen>
Hallsensor::Hallsensor(int x, int y): Sensor(x, y){
}
void Hallsensor::teken(QPaintDevice *tp){
QPainter p(tp);
QColor kleur;
p.setBrush(Qt::SolidPattern);
if(isGeactiveerd())
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);
}