My Project
bird.h
1 #ifndef BIRD_H
2 #define BIRD_H
3 
4 #include <QWidget>
5 #include <QPainter>
6 
7 
15 
16 class Bird : public QWidget
17 {
18  Q_OBJECT
19 public:
23  enum EyeBrowType {
24  UNI,
28  };
29 
43  explicit Bird(QWidget *parent = 0);
44 
58  Bird(int , EyeBrowType , QString , QString, QWidget *parent = 0) ;
59 
65  QString getEyeColor() const;
66 
72  QString getFaceColor() const;
73 
82  void setEyeColor(QString) ;
83 
91  void setFaceColor(QString) ;
92 
98  int getSize() const ;
99 
105  EyeBrowType getEyebrow() const;
106 
114  void setSize(int) ;
115 
123  void setEyebrow(EyeBrowType) ;
124 
132  Qt::GlobalColor getColor(QString) const;
133 
134 signals:
135 
136 public slots:
137 
138 protected:
146  void paintEvent(QPaintEvent *);
147 
148 private:
149  int size ;
151  QString color ;
152  QString eColor ;
154  int randInt(int min, int max) ;
165 };
166 
167 #endif // BIRD_H
Bird(QWidget *parent=0)
Default constructor. The properties of the bird are set as follows: size: set to random value of eith...
Definition: bird.cpp:24
QString getEyeColor() const
Getter for the eyeColor.
Definition: bird.cpp:66
QString color
Definition: bird.h:151
void setFaceColor(QString)
Setter for the face color.
Definition: bird.cpp:97
void setEyeColor(QString)
Setter for the eyeColor.
Definition: bird.cpp:86
int getSize() const
Getter for the bird size.
Definition: bird.cpp:106
void paintEvent(QPaintEvent *)
This function is automatically invoked each time the widget or its parent receives a repaint signal...
Definition: bird.cpp:191
Definition: bird.h:26
QString eColor
Definition: bird.h:152
QString getFaceColor() const
Getter for the faceColor.
Definition: bird.cpp:75
void setEyebrow(EyeBrowType)
Setter for the eyebrow type.
Definition: bird.cpp:140
Definition: bird.h:27
int size
Definition: bird.h:149
EyeBrowType
Definition: bird.h:23
Definition: bird.h:24
int randInt(int min, int max)
Generates a random integer in the range [min, max].
Definition: bird.cpp:178
void setSize(int)
Setter for the bird size.
Definition: bird.cpp:126
Qt::GlobalColor getColor(QString) const
Converts a color specified as string to a Qt::GlobalColor.
Definition: bird.cpp:153
Definition: bird.h:16
Definition: bird.h:25
EyeBrowType eyeBrow
Definition: bird.h:150