My Project
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Bird Class Reference

#include <bird.h>

Inheritance diagram for Bird:

Public Types

enum  EyeBrowType { UNI, ANGRY, UPSET, BUSHY }
 

Public Member Functions

 Bird (QWidget *parent=0)
 Default constructor. The properties of the bird are set as follows: size: set to random value of either 50, 100, 150 or 200. More...
 
 Bird (int, EyeBrowType, QString, QString, QWidget *parent=0)
 Constructor which accepts specification of the attributes of the bird. More...
 
QString getEyeColor () const
 Getter for the eyeColor.
 
QString getFaceColor () const
 Getter for the faceColor.
 
void setEyeColor (QString)
 Setter for the eyeColor. More...
 
void setFaceColor (QString)
 Setter for the face color. More...
 
int getSize () const
 Getter for the bird size.
 
EyeBrowType getEyebrow () const
 
void setSize (int)
 Setter for the bird size. More...
 
void setEyebrow (EyeBrowType)
 Setter for the eyebrow type. More...
 
Qt::GlobalColor getColor (QString) const
 Converts a color specified as string to a Qt::GlobalColor. More...
 

Protected Member Functions

void paintEvent (QPaintEvent *)
 This function is automatically invoked each time the widget or its parent receives a repaint signal.
 

Private Member Functions

int randInt (int min, int max)
 Generates a random integer in the range [min, max]. More...
 

Private Attributes

int size
 
EyeBrowType eyeBrow
 
QString color
 
QString eColor
 

Detailed Description

A class to represent birds.

Bird is a subclass of QWidget. This means that the following QWidget functions are also available for objects of the class Bird:

Member Enumeration Documentation

Enum type for the EyeBrow

Enumerator
UNI 

enum value 0

ANGRY 

enum value 1

UPSET 

enum value 2

BUSHY 

enum value 3

Constructor & Destructor Documentation

Bird::Bird ( QWidget *  parent = 0)
explicit

Default constructor. The properties of the bird are set as follows: size: set to random value of either 50, 100, 150 or 200.

  • eyeBrow: set randomly to one of the five possible values
  • color and eColor: set randomly to one of the five possible colors: "green", "blue", "red", "yellow", "white"
Bird::Bird ( int  s,
EyeBrowType  eb,
QString  col,
QString  eye,
QWidget *  parent = 0 
)

Constructor which accepts specification of the attributes of the bird.

Parameters
ssize
ebeyeBrow
col(faceColor)
eye(eyeColor)

Member Function Documentation

Qt::GlobalColor Bird::getColor ( QString  color) const

Converts a color specified as string to a Qt::GlobalColor.

Parameters
colorstring with a color
int Bird::randInt ( int  min,
int  max 
)
private

Generates a random integer in the range [min, max].

Parameters
minminimum random value
maxmaximum random value
void Bird::setEyebrow ( EyeBrowType  eb)

Setter for the eyebrow type.

Parameters
ebeyebrow type
void Bird::setEyeColor ( QString  eye)

Setter for the eyeColor.

Parameters
eyeeyeColor
void Bird::setFaceColor ( QString  col)

Setter for the face color.

Parameters
colface Color
void Bird::setSize ( int  s)

Setter for the bird size.

Parameters
sbird size

Member Data Documentation

QString Bird::color
private

face color (cara)

QString Bird::eColor
private

eye color (ojos)

EyeBrowType Bird::eyeBrow
private

eyebrow type (ceja)

int Bird::size
private

size of the bird


The documentation for this class was generated from the following files: