24 lines
522 B
C++
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);
|
||
|
}
|