Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

QwtPainter Class Reference

List of all members.

Detailed Description

A collection of QPainter workarounds.

1) Clipping to coordinate system limits

On X11 pixel coordinates are stored in shorts. Qt produces overruns when mapping QCOORDS to shorts.

2) Scaling to device metrics

QPainter scales fonts, line and fill patterns to the metrics of the paint device. Other values like the geometries of rects, points remain device independend. To enable a device independent widget implementation, QwtPainter adds scaling of these geometries. (Unfortunately QPainter::scale scales both types of paintings, so the objects of the first type would be scaled twice).

3) Hide some Qt2/3 incompatibilities

Definition at line 50 of file qwt_painter.h.

Public Types

enum  TextXorRopMode {
  XorRopTextNormal = 0,
  XorRopTextKeepFont = 1,
  XorRopTextKeepColor = 2
}

Static Public Member Functions

void setMetricsMap (const QPaintDevice *layout, const QPaintDevice *device)
void setMetricsMap (const QwtMetricsMap &)
void resetMetricsMap ()
const QwtMetricsMap & metricsMap ()
void setDeviceClipping (bool)
bool deviceClipping ()
void setClipRect (QPainter *, const QRect &)
void drawText (QPainter *, int x, int y, const QString &, int len=-1)
void drawText (QPainter *, const QPoint &, const QString &, int len=-1)
void drawText (QPainter *, int x, int y, int w, int h, int flags, const QString &, int len=-1)
void drawText (QPainter *, const QRect &, int flags, const QString &, int len=-1)
void drawSimpleRichText (QPainter *, const QRect &, int flags, QSimpleRichText &)
void drawRect (QPainter *, int x, int y, int w, int h)
void drawRect (QPainter *, const QRect &rect)
void fillRect (QPainter *, const QRect &, const QBrush &)
void drawEllipse (QPainter *, const QRect &)
void drawLine (QPainter *, int x1, int y1, int x2, int y2)
void drawLine (QPainter *, const QPoint &p1, const QPoint &p2)
void drawPolygon (QPainter *, const QPointArray &pa)
void drawPolyline (QPainter *, const QPointArray &pa)
void drawPoint (QPainter *, int x, int y)
void drawRoundFrame (QPainter *, const QRect &, int width, const QColorGroup &cg, bool sunken)
QPointArray clip (const QPointArray &)
int textXorRopMode ()
int setTextXorRopMode (TextXorRopMode mode)


Member Enumeration Documentation

enum QwtPainter::TextXorRopMode
 

Indicates a method to work around a bug in the drawing of text using the XorROP raster operator on the X Window system. Has no effect on other platforms.

See also:
QwtPainter::setTextXorRopMode

Definition at line 60 of file qwt_painter.h.


Member Function Documentation

QPointArray QwtPainter::clip const QPointArray &   )  [static]
 

Clip a point array.

Definition at line 524 of file qwt_painter.cpp.

References QwtRect::clip().

Referenced by drawPolygon(), and drawPolyline().

bool QwtPainter::deviceClipping  )  [static]
 

Returns whether device clipping is enabled. On X11 the default is enabled, otherwise it is disabled.

See also:
QwtPainter::setDeviceClipping()

Definition at line 88 of file qwt_painter.cpp.

void QwtPainter::drawEllipse QPainter *  painter,
const QRect &  rect
[static]
 

Wrapper for QPainter::drawEllipse()

Definition at line 195 of file qwt_painter.cpp.

Referenced by QwtSymbol::draw(), and QwtPicker::drawRubberBand().

void QwtPainter::drawLine QPainter *  painter,
const QPoint &  p1,
const QPoint &  p2
[static]
 

Wrapper for QPainter::drawLine()

Definition at line 443 of file qwt_painter.cpp.

References drawPolyline().

void QwtPainter::drawLine QPainter *  painter,
int  x1,
int  y1,
int  x2,
int  y2
[static]
 

Wrapper for QPainter::drawLine()

Definition at line 481 of file qwt_painter.cpp.

Referenced by QwtSymbol::draw(), QwtMarker::draw(), QwtGrid::draw(), QwtScaleDraw::drawBackbone(), QwtLegendItem::drawIdentifier(), QwtPicker::drawRubberBand(), QwtCurve::drawSticks(), and QwtScaleDraw::drawTick().

void QwtPainter::drawPoint QPainter *  painter,
int  x,
int  y
[static]
 

Wrapper for QPainter::drawPoint()

Definition at line 513 of file qwt_painter.cpp.

Referenced by QwtCurve::drawDots().

void QwtPainter::drawPolygon QPainter *  painter,
const QPointArray &  pa
[static]
 

Wrapper for QPainter::drawPolygon()

Definition at line 490 of file qwt_painter.cpp.

References clip().

Referenced by QwtSymbol::draw(), QwtCurve::drawDots(), QwtCurve::drawLines(), QwtCurve::drawSpline(), and QwtCurve::drawSteps().

void QwtPainter::drawPolyline QPainter *  painter,
const QPointArray &  pa
[static]
 

Wrapper for QPainter::drawPolyline()

Definition at line 501 of file qwt_painter.cpp.

References clip().

Referenced by drawLine(), QwtCurve::drawLines(), QwtCurve::drawSpline(), and QwtCurve::drawSteps().

void QwtPainter::drawRect QPainter *  painter,
const QRect &  rect
[static]
 

Wrapper for QPainter::drawRect()

Definition at line 168 of file qwt_painter.cpp.

void QwtPainter::drawRect QPainter *  painter,
int  x,
int  y,
int  w,
int  h
[static]
 

Wrapper for QPainter::drawRect()

Definition at line 160 of file qwt_painter.cpp.

Referenced by QwtRichText::draw(), QwtPlainText::draw(), QwtSymbol::draw(), QwtPicker::drawRubberBand(), and QwtPlot::printCanvas().

void QwtPainter::drawRoundFrame QPainter *  ,
const QRect &  ,
int  width,
const QColorGroup &  cg,
bool  sunken
[static]
 

Draw a round frame.

Definition at line 560 of file qwt_painter.cpp.

Referenced by QwtDial::drawFrame().

void QwtPainter::drawSimpleRichText QPainter *  painter,
const QRect &  rect,
int  flags,
QSimpleRichText &  text
[static]
 

Wrapper for QSimpleRichText::draw()

Definition at line 357 of file qwt_painter.cpp.

Referenced by QwtRichText::draw().

void QwtPainter::drawText QPainter *  painter,
const QRect &  rect,
int  flags,
const QString &  text,
int  len = -1
[static]
 

Wrapper for QPainter::drawText()

Definition at line 293 of file qwt_painter.cpp.

void QwtPainter::drawText QPainter *  painter,
int  x,
int  y,
int  w,
int  h,
int  flags,
const QString &  text,
int  len = -1
[static]
 

Wrapper for QPainter::drawText()

Definition at line 284 of file qwt_painter.cpp.

References drawText().

void QwtPainter::drawText QPainter *  painter,
const QPoint &  pos,
const QString &  text,
int  len = -1
[static]
 

Wrapper for QPainter::drawText()

Definition at line 217 of file qwt_painter.cpp.

void QwtPainter::drawText QPainter *  painter,
int  x,
int  y,
const QString &  text,
int  len = -1
[static]
 

Wrapper for QPainter::drawText()

Definition at line 208 of file qwt_painter.cpp.

Referenced by QwtPlainText::draw(), QwtScaleDraw::drawLabel(), and drawText().

void QwtPainter::fillRect QPainter *  painter,
const QRect &  rect,
const QBrush &  brush
[static]
 

Wrapper for QPainter::fillRect()

Definition at line 181 of file qwt_painter.cpp.

Referenced by QwtPlot::printCanvas().

const QwtMetricsMap & QwtPainter::metricsMap  )  [static]
 

Returns:
Metrics map

Definition at line 144 of file qwt_painter.cpp.

Referenced by QwtMarker::draw(), QwtLegendItem::drawIdentifier(), QwtLegendItem::drawItem(), and QwtPlot::print().

void QwtPainter::resetMetricsMap  )  [static]
 

Reset the metrics map to the ratio 1:1

See also:
QwtPainter::setMetricsMap, QwtPainter::resetMetricsMap

Definition at line 136 of file qwt_painter.cpp.

Referenced by QwtPlot::print().

void QwtPainter::setClipRect QPainter *  painter,
const QRect &  rect
[static]
 

Wrapper for QPainter::setClipRect()

Definition at line 152 of file qwt_painter.cpp.

Referenced by QwtPlot::printCanvas(), and QwtPlot::printLegend().

void QwtPainter::setDeviceClipping bool  enable  )  [static]
 

En/Disable device clipping. On X11 the default for device clipping is enabled, otherwise it is disabled.

See also:
QwtPainter::deviceClipping()

Definition at line 77 of file qwt_painter.cpp.

void QwtPainter::setMetricsMap const QwtMetricsMap &  map  )  [static]
 

Change the metrics map

See also:
QwtPainter::resetMetricsMap, QwtPainter::metricsMap

Definition at line 127 of file qwt_painter.cpp.

void QwtPainter::setMetricsMap const QPaintDevice *  layout,
const QPaintDevice *  device
[static]
 

Scale all QwtPainter drawing operations using the ratio QwtPaintMetrics(from).logicalDpiX() / QwtPaintMetrics(to).logicalDpiX() and QwtPaintMetrics(from).logicalDpiY() / QwtPaintMetrics(to).logicalDpiY()

See also:
QwtPainter::resetScaleMetrics(), QwtPainter::scaleMetricsX, QwtPainter::scaleMetricsY()

Definition at line 117 of file qwt_painter.cpp.

Referenced by QwtPlot::print().

int QwtPainter::setTextXorRopMode TextXorRopMode  mode  )  [static]
 

Selects a method to work around a bug in the drawing of text using the XorROP raster operator on the X Window system. Has no effect on other platforms.

See also:
QwtPicker
Possible modes are:
  • XorRopTextNormal; fails on the X Window System with X Free Type enabled.
  • XorRopTextKeepFont; works around the bug while keeping the font, but the color of the text is unpredictable. It is possible to get satisfactory results by choosing a suitable combination of font, text color and background color.
  • XorRopTextKeepColor; works around the bug while keeping the color, but the font of the text is unpredictable (it depends on the version of Qt). The font that is used may not at all resemble the requested font. This mode does not exist when Qwt has been built for Qt-2.3.

Parameters:
mode Mode to do the XorROP text drawing

Definition at line 640 of file qwt_painter.cpp.

int QwtPainter::textXorRopMode  )  [static]
 

Return the method to work around a bug in the drawing of text using the XorROP raster operator on the X Window system.

See also:
QwtPainter::textXorRopMode

Definition at line 594 of file qwt_painter.cpp.


Generated on Sun Nov 21 11:12:52 2004 for Qwt User's Guide by doxygen 1.3.5