line.h
#ifndef LINE_H
#define LINE_H
#include <QWidget>
#include <QPainter>
class Line : public QWidget
{
Q_OBJECT
public:
explicit Line(QWidget *parent = 0);
Line(int fromX, int fromY, int toX, int toY, int w, QColor c, QWidget *parent = 0);
Line(int fromX, int fromY, int length, double angle, int w, QColor c, QWidget *parent = 0);
void setCoords(int fromX, int fromY, int toX, int toY);
void setpenColor(QColor c);
void setPenWidth(int w);
int getX0();
int getY0();
int getX1();
int getY1();
signals:
public slots:
protected:
void paintEvent(QPaintEvent *);
private:
int x0,
y0,
x1,
y1;
int penWidth;
QColor penColor;
};
#endif // LINE_H
Line::Line
Line(QWidget *parent=0)
Constructor.
Definition: line.cpp:12
Line::x1
int x1
Definition: line.h:154
Line::penColor
QColor penColor
Definition: line.h:159
Line::y0
int y0
Definition: line.h:154
Line::y1
int y1
Definition: line.h:154
Line::setCoords
void setCoords(int fromX, int fromY, int toX, int toY)
Ajustador de las coordenadas de la linea.
Definition: line.cpp:87
Line::getX1
int getX1()
Devuelve la coordenada final x.
Definition: line.cpp:138
Line::setPenWidth
void setPenWidth(int w)
Ajustador del ancho del boligrafo.
Definition: line.cpp:111
Line::getY1
int getY1()
Devuelve la coordenada final y.
Definition: line.cpp:147
Line
Definition: line.h:11
Line::x0
int x0
Definition: line.h:154
Line::penWidth
int penWidth
Definition: line.h:158
Line::getY0
int getY0()
Devuelve la coordenada inicial y.
Definition: line.cpp:129
Line::getX0
int getX0()
Devuelve la coordenada inicial x.
Definition: line.cpp:120
Line::paintEvent
void paintEvent(QPaintEvent *)
La funcion para el evento de pintar es invocada automaticamente cada ves que evento de repintar ocurr...
Definition: line.cpp:156
Line::setpenColor
void setpenColor(QColor c)
Ajustador del color del boligrafo.
Definition: line.cpp:102