Keine Beschreibung

bird.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef BIRD_H
  2. #define BIRD_H
  3. #include <QWidget>
  4. #include <QPainter>
  5. /// A class to represent birds.
  6. ///
  7. /// Bird is a subclass of QWidget. This means that the following QWidget functions
  8. /// are also available for objects of the class Bird:
  9. /// * move(int x, int y): to move the bird to position (x,y)
  10. /// * x(), y(): get the x position, get the y() position
  11. /// * hide(): to hide a bird that has been painted
  12. class Bird : public QWidget
  13. {
  14. Q_OBJECT
  15. public:
  16. ///
  17. /// Enum type for the EyeBrow
  18. ///
  19. enum EyeBrowType {
  20. UNI, /**< enum value 0 */
  21. ANGRY, /**< enum value 1 */
  22. UPSET, /**< enum value 2 */
  23. BUSHY /**< enum value 3 */
  24. };
  25. explicit Bird(QWidget *parent = 0);
  26. Bird(int , EyeBrowType , QString , QString, QWidget *parent = 0) ;
  27. QString getEyeColor() ;
  28. QString getFaceColor() ;
  29. void setEyeColor(QString) ;
  30. void setFaceColor(QString) ;
  31. int getSize() ;
  32. EyeBrowType getEyebrow() ;
  33. void setSize(int) ;
  34. void setEyebrow(EyeBrowType) ;
  35. Qt::GlobalColor getColor(QString) ;
  36. Bird & operator=(Bird &b);
  37. signals:
  38. public slots:
  39. protected:
  40. void paintEvent(QPaintEvent *event);
  41. private:
  42. int size ;
  43. EyeBrowType eyeBrow ;
  44. QString color ;
  45. QString eColor ;
  46. int randInt(int min, int max) ;
  47. };
  48. #endif // BIRD_H