Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Canvas Class Reference

#include <canvas.h>

List of all members.

Public Types

enum  Shape { LINE, CIRCLE, TEXT }

Public Slots

void draw (Shape, const QColor &, const QPoint &, const QPoint &, int width=3, const QString &text=QString::null)

Signals

void drawing (QString &str)

Public Member Functions

 Canvas (QWidget *parent=0, const char *name=0)
void setPenColor (const QColor &c)
void setPenWidth (int w)
void setDrawingShape (Shape s)
QColor penColor ()
int penWidth ()
int drawingShape ()
void save (const QString &filename, const QString &format)
void clearScreen ()

Protected Member Functions

void mousePressEvent (QMouseEvent *e)
void mouseReleaseEvent (QMouseEvent *e)
void mouseMoveEvent (QMouseEvent *e)
void resizeEvent (QResizeEvent *e)
void paintEvent (QPaintEvent *e)

Protected Attributes

QPen pen
QPen eraser
Shape shape
QPoint start
QPoint tmp
bool mousePressed
QPixmap buffer
QPixmap over

Private Slots

void draw (const QPoint &, const QPoint &, bool definitive=true, bool erase=false)


Member Enumeration Documentation

enum Canvas::Shape
 

Enumeration values:
LINE 
CIRCLE 
TEXT 

Definition at line 31 of file canvas.h.

Referenced by Painter::slotShape().


Constructor & Destructor Documentation

Canvas::Canvas QWidget *  parent = 0,
const char *  name = 0
 

Definition at line 33 of file canvas.cpp.

References clearScreen(), LINE, and shape.


Member Function Documentation

void Canvas::clearScreen  ) 
 

Definition at line 51 of file canvas.cpp.

References buffer.

Referenced by Canvas().

void Canvas::draw const QPoint &  ,
const QPoint &  ,
bool  definitive = true,
bool  erase = false
[private, slot]
 

Definition at line 67 of file canvas.cpp.

References abs, buffer, CIRCLE, drawing(), LINE, min, over, penColor(), penWidth(), and TEXT.

void Canvas::draw Shape  ,
const QColor &  ,
const QPoint &  ,
const QPoint &  ,
int  width = 3,
const QString &  text = QString::null
[slot]
 

Definition at line 135 of file canvas.cpp.

References abs, buffer, CIRCLE, LINE, max, min, TEXT, and tmp.

Referenced by Painter::append(), mouseMoveEvent(), and mouseReleaseEvent().

void Canvas::drawing QString &  str  )  [signal]
 

Referenced by draw().

int Canvas::drawingShape  )  [inline]
 

Definition at line 60 of file canvas.h.

References shape.

void Canvas::mouseMoveEvent QMouseEvent *  e  )  [protected]
 

Definition at line 188 of file canvas.cpp.

References draw(), start, and tmp.

void Canvas::mousePressEvent QMouseEvent *  e  )  [protected]
 

Definition at line 56 of file canvas.cpp.

References mousePressed, and start.

void Canvas::mouseReleaseEvent QMouseEvent *  e  )  [protected]
 

Definition at line 61 of file canvas.cpp.

References draw(), mousePressed, and start.

void Canvas::paintEvent QPaintEvent *  e  )  [protected]
 

Definition at line 210 of file canvas.cpp.

References buffer.

QColor Canvas::penColor  )  [inline]
 

Definition at line 52 of file canvas.h.

References pen.

Referenced by draw(), and Painter::slotColor().

int Canvas::penWidth  )  [inline]
 

Definition at line 56 of file canvas.h.

References pen.

Referenced by draw().

void Canvas::resizeEvent QResizeEvent *  e  )  [protected]
 

Definition at line 196 of file canvas.cpp.

References buffer, and tmp.

void Canvas::save const QString &  filename,
const QString &  format
 

Definition at line 46 of file canvas.cpp.

References buffer, and no_writing.

void Canvas::setDrawingShape Shape  s  )  [inline]
 

Definition at line 48 of file canvas.h.

References shape.

Referenced by Painter::slotShape().

void Canvas::setPenColor const QColor &  c  )  [inline]
 

Definition at line 39 of file canvas.h.

References pen.

Referenced by Painter::slotColor().

void Canvas::setPenWidth int  w  )  [inline]
 

Definition at line 43 of file canvas.h.

References eraser, and pen.

Referenced by Painter::slotWidth().


Member Data Documentation

QPixmap Canvas::buffer [protected]
 

Definition at line 81 of file canvas.h.

Referenced by clearScreen(), draw(), paintEvent(), resizeEvent(), and save().

QPen Canvas::eraser [protected]
 

Definition at line 75 of file canvas.h.

Referenced by setPenWidth().

bool Canvas::mousePressed [protected]
 

Definition at line 79 of file canvas.h.

Referenced by mousePressEvent(), and mouseReleaseEvent().

QPixmap Canvas::over [protected]
 

Definition at line 81 of file canvas.h.

Referenced by draw().

QPen Canvas::pen [protected]
 

Definition at line 75 of file canvas.h.

Referenced by penColor(), penWidth(), setPenColor(), and setPenWidth().

Shape Canvas::shape [protected]
 

Definition at line 76 of file canvas.h.

Referenced by Canvas(), drawingShape(), and setDrawingShape().

QPoint Canvas::start [protected]
 

Definition at line 77 of file canvas.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

QPoint Canvas::tmp [protected]
 

Definition at line 77 of file canvas.h.

Referenced by draw(), mouseMoveEvent(), and resizeEvent().


The documentation for this class was generated from the following files:
Generated on Sat May 10 15:09:57 2003 for qnet by doxygen1.3