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

QSDrvQt Class Reference

Implementation of QSDrv for Qt. More...

#include <qsdrvqt.h>

Inheritance diagram for QSDrvQt:

Inheritance graph
[legend]
List of all members.

Public Methods

 QSDrvQt ()
virtual ~QSDrvQt ()
virtual QSDrvQt * copy ()
void copySettingsFrom (const QSDrvQt *drv)
virtual void setDC (QPainter *p, double dpi=72.0, bool deletePainter=false)
QPainter * painter () const
bool deletePainter () const
void startDrawing ()
void stopDrawing ()
void clearCanvas (const QSGFill &f, const QSPt2f &pos, const QSPt2f &size)
void drawLine (const QSPt2f &one, const QSPt2f &two)
void beginPolyline (const QSPt2f &pos)
void drawPolylineTo (const QSPt2f &pos)
void endPolyline ()
QSPt2f currPolylinePos ()
void drawRect (const QSPt2f &p1, const QSPt2f &p2)
void drawPoly (const QSPt2f pts[], int npoints, const bool edges[]=NULL, int edgeAutoColor=0)
void drawEllipse (const QSPt2f &p1, const QSPt2f &p2)
void drawText (const QSPt2f &pos, const QString &text, int align=AlignLeft|AlignBottom)
QSPt2f textSize (const QString &text)
void drawRText (const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)
void getRTextBoundingPoly (QSPt2f outPts[4], const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)
void getPixmapBuffer (PixmapBuffer *buff, int pwidth, int pheight)
void drawPixmap (const QSPt2f &pos, PixmapBuffer *data)
void setFill (const QSGFill &f)
void setFont (const QSGFont &f)
void setLine (const QSGLine &l)
QSGFont currentFont ()
QSGFill currentFill ()
QSGLine currentLine ()

Static Public Methods

QPainter * copyPainter (const QPainter *painter)
QSGFont toQSGFont (const QFont &f, const QColor &c, double dpi=72.0)
QFont toQFont (const QSGFont &f, double dpi=72.0)
QSGColor toQSGColor (const QColor &c)
QColor toQColor (const QSGColor &c)
QSGFill toQSGFill (const QBrush &b)
QBrush toQBrush (const QSGFill &f)
QSGLine toQSGLine (const QPen &p)
QPen toQPen (const QSGLine &p)

Protected Methods

QPoint align_rect (const QRect &r, int align)
int toInt (double value)
void set_auto_pen (int autoColor)

Protected Attributes

QPainter * m_paint
QPointArray m_vert_array
QPointArray m_edge_array
QImage * m_pixmap
QSGLine m_line
QSGFill m_cfill
QSGFont m_curr_font
bool m_delete_painter
QPen m_curr_pen
QSPt2f m_curr_polyline_pos
int m_curr_polyline_style
double m_curr_polyline_t
double m_curr_polyline_pattern_length
double m_curr_polyline_pattern [6]

Static Protected Attributes

const int defpatterns [4][6]

Detailed Description

Implementation of QSDrv for Qt.

Author:
Kamil Dobkowski


Constructor & Destructor Documentation

QSDrvQt::QSDrvQt  
 

Constructor.

virtual QSDrvQt::~QSDrvQt   [virtual]
 

Destructor.


Member Function Documentation

void QSDrvQt::beginPolyline const QSPt2f   pos [virtual]
 

Starts to draw a polyline.

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::clearCanvas const QSGFill   f,
const QSPt2f   pos,
const QSPt2f   size
[virtual]
 

Clear the canvas.

Reimplemented from QSDrv.

Reimplemented in QSDrvHitTest.

virtual QSDrvQt* QSDrvQt::copy   [virtual]
 

Returns a copy of this object.

Implements QSDrv.

Reimplemented in QSDrvHitTest.

QPainter* QSDrvQt::copyPainter const QPainter *    painter [static]
 

Creates and returns a copy of painter.

void QSDrvQt::copySettingsFrom const QSDrvQt *    drv
 

Copies painter, dpi settings.

QSGFill QSDrvQt::currentFill   [virtual]
 

This function should return the current fill.

Reimplemented from QSCanvasDrv.

QSGFont QSDrvQt::currentFont   [virtual]
 

This function should return the current font.

Reimplemented from QSCanvasDrv.

QSGLine QSDrvQt::currentLine   [virtual]
 

This function should return the current line.

Reimplemented from QSCanvasDrv.

QSPt2f QSDrvQt::currPolylinePos   [inline, virtual]
 

Returns the current pen position.

Reimplemented from QSCanvasDrv.

Reimplemented in QSDrvHitTest.

bool QSDrvQt::deletePainter   const [inline]
 

Returns 'delete' painter setting

void QSDrvQt::drawEllipse const QSPt2f   p1,
const QSPt2f   p2
[virtual]
 

Draws a circle.

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::drawLine const QSPt2f   one,
const QSPt2f   two
[virtual]
 

Draw a line.

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::drawPixmap const QSPt2f   pos,
PixmapBuffer *    data
[virtual]
 

Draw a pixmap. Notice that the pixmap buffer will be always the last requested one.'getPixmapBuffer' / 'drawPixmap' pair is always called together.

Reimplemented from QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::drawPoly const QSPt2f    pts[],
int    npoints,
const bool    edges[] = NULL,
int    edgeAutoColor = 0
[virtual]
 

Draw a polygon defined by 'npoints' points in 'pts'. Can change the current line ( if edgeAuto color != 0 )

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::drawPolylineTo const QSPt2f   pos [virtual]
 

Draw the next line segment. Wach out for setLine() call during drawPolyline2()

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::drawRect const QSPt2f   p1,
const QSPt2f   p2
[virtual]
 

Draw a rectangle.

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::drawRText const QSPt2f   pos,
int    angle,
const QString &    text,
int    align = AlignLeft|AlignBottom
[virtual]
 

Draw a rotated text. This must be reimplemented.

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::drawText const QSPt2f   pos,
const QString &    text,
int    align = AlignLeft|AlignBottom
[virtual]
 

Draw a text.

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::endPolyline   [virtual]
 

Ends polyline.

Reimplemented from QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::getPixmapBuffer PixmapBuffer *    buff,
int    pwidth,
int    pheight
[virtual]
 

This method is always called before QSDrv::drawPixmap. The struct 'PixmapBuffer' must be filled with correct values. Pixmap width is requested to be equal to 'pwidth', pixmap height must be lower or equal to pheight ( see field 'lines' in 'PixmapBuffer' ).

Reimplemented from QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::getRTextBoundingPoly QSPt2f    outPts[4],
const QSPt2f   pos,
int    angle,
const QString &    text,
int    align = AlignLeft|AlignBottom
[virtual]
 

Return size of a rotated text. This must be reimplemented.

Implements QSCanvasDrv.

QPainter* QSDrvQt::painter   const [inline]
 

Returns painter

virtual void QSDrvQt::setDC QPainter *    p,
double    dpi = 72.0,
bool    deletePainter = false
[virtual]
 

Sets a painter. If deletePainter is true, painter is deleted in destructor. This driver calls neither p->start(), nor p->stop()

Reimplemented in QSDrvOpenGL.

void QSDrvQt::setFill const QSGFill   f [virtual]
 

Set the current fill .

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::setFont const QSGFont   f [virtual]
 

Set the current font.

Implements QSCanvasDrv.

void QSDrvQt::setLine const QSGLine   l [virtual]
 

Set the current line style.

Implements QSCanvasDrv.

Reimplemented in QSDrvHitTest.

void QSDrvQt::startDrawing   [virtual]
 

Reimplemented from QSDrv::startDraw .

Reimplemented from QSDrv.

Reimplemented in QSDrvOpenGL.

void QSDrvQt::stopDrawing   [virtual]
 

Reimplemented from QSDrv::stopDraw . Doesn,t call paint->end().

Reimplemented from QSDrv.

Reimplemented in QSDrvOpenGL.

QSPt2f QSDrvQt::textSize const QString &    text [virtual]
 

Return the size of the text that will be printed by the corresponding QSDrv::drawText function.

Implements QSCanvasDrv.

QBrush QSDrvQt::toQBrush const QSGFill   f [static]
 

Converts 'QSGFill' to 'QBrush' .

QColor QSDrvQt::toQColor const QSGColor   c [static]
 

Converts 'QSGColor' to 'QColor' .

QFont QSDrvQt::toQFont const QSGFont   f,
double    dpi = 72.0
[static]
 

Converts 'QSGFont' to 'QFont' .

QPen QSDrvQt::toQPen const QSGLine   p [static]
 

Converts 'QSGLine' to 'QPen' .

QSGColor QSDrvQt::toQSGColor const QColor &    c [static]
 

Converts 'QColor' to 'QSGColor' .

QSGFill QSDrvQt::toQSGFill const QBrush &    b [static]
 

Converts 'QBrush' to 'QSGFill' .

QSGFont QSDrvQt::toQSGFont const QFont &    f,
const QColor &    c,
double    dpi = 72.0
[static]
 

Converts 'QFont' to 'QSGFont' .

QSGLine QSDrvQt::toQSGLine const QPen &    p [static]
 

Converts 'QPen' to 'QSGLine' .


The documentation for this class was generated from the following file:
Generated on Mon Mar 18 19:16:44 2002 for KMatplot library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002