bird.h
#ifndef BIRD_H
#define BIRD_H
#include <QWidget>
#include <QPainter>
class Bird : public QWidget
{
Q_OBJECT
public:
enum EyeBrowType {
UNI,
ANGRY,
UPSET,
BUSHY
};
explicit Bird(QWidget *parent = 0);
Bird(int , EyeBrowType , QString , QString, QWidget *parent = 0) ;
QString getEyeColor() const;
QString getFaceColor() const;
void setEyeColor(QString) ;
void setFaceColor(QString) ;
int getSize() const;
EyeBrowType getEyebrow() const ;
void setSize(int) ;
void setEyebrow(EyeBrowType) ;
Qt::GlobalColor getColor(QString) const;
signals:
public slots:
protected:
void paintEvent(QPaintEvent *event);
private:
int size ;
EyeBrowType eyeBrow ;
QString color ;
QString eColor ;
int randInt(int min, int max) ;
};
#endif // BIRD_H
Bird::Bird
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
Bird::getEyeColor
QString getEyeColor() const
Getter for the eyeColor.
Definition: bird.cpp:67
Bird::color
QString color
Definition: bird.h:150
Bird::setFaceColor
void setFaceColor(QString)
Setter for the face color.
Definition: bird.cpp:98
Bird::setEyeColor
void setEyeColor(QString)
Setter for the eyeColor.
Definition: bird.cpp:87
Bird::getSize
int getSize() const
Getter for the bird size.
Definition: bird.cpp:107
Bird::UPSET
Definition: bird.h:26
Bird::eColor
QString eColor
Definition: bird.h:151
Bird::getFaceColor
QString getFaceColor() const
Getter for the faceColor.
Definition: bird.cpp:76
Bird::setEyebrow
void setEyebrow(EyeBrowType)
Setter for the eyebrow type.
Definition: bird.cpp:143
Bird::BUSHY
Definition: bird.h:27
Bird::size
int size
Definition: bird.h:148
Bird::paintEvent
void paintEvent(QPaintEvent *event)
This function is automatically invoked each time the widget or its parent receives a repaint signal...
Definition: bird.cpp:193
Bird::EyeBrowType
EyeBrowType
Definition: bird.h:23
Bird::UNI
Definition: bird.h:24
Bird::randInt
int randInt(int min, int max)
Generates a random integer in the range [min, max].
Definition: bird.cpp:180
Bird::setSize
void setSize(int)
Setter for the bird size.
Definition: bird.cpp:127
Bird::getColor
Qt::GlobalColor getColor(QString) const
Converts a color specified as string to a Qt::GlobalColor.
Definition: bird.cpp:156
Bird
Definition: bird.h:16
Bird::ANGRY
Definition: bird.h:25
Bird::eyeBrow
EyeBrowType eyeBrow
Definition: bird.h:149