My Project
|
#include <line.h>
Public Member Functions | |
Line (QWidget *parent=0) | |
Constructor. More... | |
Line (int fromX, int fromY, int toX, int toY, int w, QColor c, QWidget *parent=0) | |
Constructor for a line, specifying the (fromX,fromY) and (toX,toY) More... | |
Line (int fromX, int fromY, int length, double angle, int w, QColor c, QWidget *parent=0) | |
Constructor for a line, specifying the (fromX,fromY) and (toX,toY) More... | |
void | setCoords (int fromX, int fromY, int toX, int toY) |
Setter for the line coordinates. More... | |
void | setpenColor (QColor c) |
Setter for the pen color. More... | |
void | setPenWidth (int w) |
Setter for the pen width. More... | |
int | getX0 () |
Getter for the starting coordinate x. More... | |
int | getY0 () |
Getter for the starting coordinate y. More... | |
int | getX1 () |
Getter for the ending coordinate x. More... | |
int | getY1 () |
Getter for the ending coordinate y. More... | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *) |
The paint event function is automatically invoked whenever a resize or repaint happens. | |
Private Attributes | |
int | x0 |
int | y0 |
int | x1 |
int | y1 |
int | penWidth |
QColor | penColor |
A class to describe lines.
|
explicit |
Constructor.
Constructor sets coordinates to 0, pen color to black and pen width to 1.
Line::Line | ( | int | fromX, |
int | fromY, | ||
int | toX, | ||
int | toY, | ||
int | w, | ||
QColor | c, | ||
QWidget * | parent = 0 |
||
) |
Constructor for a line, specifying the (fromX,fromY) and (toX,toY)
fromX | starting x coordinate |
fromY | starting y coordinate |
toX | end x coordinate |
toY | end y coordinate |
w | pen width |
c | line color |
parent | parent of this line |
Line::Line | ( | int | fromX, |
int | fromY, | ||
int | length, | ||
double | angle, | ||
int | w, | ||
QColor | c, | ||
QWidget * | parent = 0 |
||
) |
Constructor for a line, specifying the (fromX,fromY) and (toX,toY)
Constructor for a line, specifying (fromX, fromY) and the length and angle.
fromX | starting x coordinate |
fromY | starting y coordinate |
length | length of the line |
angle | angle |
w | pen width |
c | line color |
parent | parent of this line |
int Line::getX0 | ( | ) |
Getter for the starting coordinate x.
int Line::getX1 | ( | ) |
Getter for the ending coordinate x.
int Line::getY0 | ( | ) |
Getter for the starting coordinate y.
int Line::getY1 | ( | ) |
Getter for the ending coordinate y.
void Line::setCoords | ( | int | fromX, |
int | fromY, | ||
int | toX, | ||
int | toY | ||
) |
Setter for the line coordinates.
fromX | starting x coordinate |
fromY | starting y coordinate |
toX | end x coordinate |
toY | end y coordinate |
void Line::setpenColor | ( | QColor | c | ) |
Setter for the pen color.
c | line color |
void Line::setPenWidth | ( | int | w | ) |
Setter for the pen width.
w | pen width |
|
private |
pen color / color del boligrafo
|
private |
pen width / ancho del boligrafo
|
private |
initial coord x / coordenada inicial x
|
private |
ending coord x / coordenada final x
|
private |
initial coord y / coordenada inicial y
|
private |
ending coord y / coordenada final y