TrafficLightWidget.h 886 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright (c) 2012 committers of YAKINDU and others.
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. * Contributors:
  8. * m.muehlbrandt - initial API and implementation
  9. *
  10. */
  11. #ifndef TRAFFICLIGHTWIDGET_H_
  12. #define TRAFFICLIGHTWIDGET_H_
  13. #include <QWidget>
  14. #include <QPaintEvent>
  15. #include <QPainter>
  16. class TrafficLightWidget: public QWidget {
  17. Q_OBJECT
  18. public:
  19. TrafficLightWidget(QWidget *parent = 0);
  20. virtual ~TrafficLightWidget();
  21. public slots:
  22. void setSignals(bool red, bool yellow, bool green);
  23. protected:
  24. void paintEvent(QPaintEvent *event);
  25. private:
  26. bool red;
  27. bool yellow;
  28. bool green;
  29. };
  30. #endif /* TRAFFICLIGHTWIDGET_H_ */