My Project

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:

- move(int x, int y): to move the bird to position (x,y)
- x(), y(): get the x position, get the y() position
- hide(): to hide a bird that has been painted

## Member Enumeration Documentation

enum Bird::EyeBrowType

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

  s | size
  eb | eyeBrow
  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

  color | string with a color

int Bird::randInt | ( | int | min,
|  | int | max
| ) |  |
| private

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

Parameters

  min | minimum random value
  max | maximum random value

void Bird::setEyebrow | ( | EyeBrowType | eb | ) |

Setter for the eyebrow type.

Parameters

  eb | eyebrow type

void Bird::setEyeColor | ( | QString | eye | ) |

Setter for the eyeColor.

Parameters

  eye | eyeColor

void Bird::setFaceColor | ( | QString | col | ) |

Setter for the face color.

Parameters

  col | face Color

void Bird::setSize | ( | int | s | ) |

Setter for the bird size.

Parameters

  s | bird 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:

- bird.h
- bird.cpp