Qt-Gebouw/hallsensor.cpp

24 lines
522 B
C++
Raw Normal View History

2022-02-10 16:44:22 +00:00
#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);
}