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 signals:
134 
135 public slots:
136 
137 protected:
145  void paintEvent(QPaintEvent *event);
146 
147 private:
148  int size ;
150  QString color ;
151  QString eColor ;
153  int randInt(int min, int max) ;
164 };
165 
166 #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:25
QString getEyeColor() const
Getter for the eyeColor.
Definition: bird.cpp:67
QString color
Definition: bird.h:150
void setFaceColor(QString)
Setter for the face color.
Definition: bird.cpp:98
void setEyeColor(QString)
Setter for the eyeColor.
Definition: bird.cpp:87
int getSize() const
Getter for the bird size.
Definition: bird.cpp:107
Definition: bird.h:26
QString eColor
Definition: bird.h:151
QString getFaceColor() const
Getter for the faceColor.
Definition: bird.cpp:76
void setEyebrow(EyeBrowType)
Setter for the eyebrow type.
Definition: bird.cpp:143
Definition: bird.h:27
int size
Definition: bird.h:148
void paintEvent(QPaintEvent *event)
This function is automatically invoked each time the widget or its parent receives a repaint signal...
Definition: bird.cpp:193
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:180
void setSize(int)
Setter for the bird size.
Definition: bird.cpp:127
Qt::GlobalColor getColor(QString) const
Converts a color specified as string to a Qt::GlobalColor.
Definition: bird.cpp:156
Definition: bird.h:16
Definition: bird.h:25
EyeBrowType eyeBrow
Definition: bird.h:149