My Project
|
#include <bird.h>
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 |
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:
enum Bird::EyeBrowType |
|
explicit |
Default constructor. The properties of the bird are set as follows: size: set to random value of either 50, 100, 150 or 200.
Bird::Bird | ( | int | s, |
EyeBrowType | eb, | ||
QString | col, | ||
QString | eye, | ||
QWidget * | parent = 0 |
||
) |
Constructor which accepts specification of the attributes of the bird.
s | size |
eb | eyeBrow |
col | (faceColor) |
eye | (eyeColor) |
Qt::GlobalColor Bird::getColor | ( | QString | color | ) | const |
Converts a color specified as string to a Qt::GlobalColor.
color | string with a color |
|
private |
Generates a random integer in the range [min, max].
min | minimum random value |
max | maximum random value |
void Bird::setEyebrow | ( | EyeBrowType | eb | ) |
Setter for the eyebrow type.
eb | eyebrow type |
void Bird::setEyeColor | ( | QString | eye | ) |
Setter for the eyeColor.
eye | eyeColor |
void Bird::setFaceColor | ( | QString | col | ) |
Setter for the face color.
col | face Color |
void Bird::setSize | ( | int | s | ) |
Setter for the bird size.
s | bird size |
|
private |
face color (cara)
|
private |
eye color (ojos)
|
private |
eyebrow type (ceja)
|
private |
size of the bird