Qwt User's Guide 6.0.2

- Main Page
- Related Pages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Static Public Member Functions
QwtPainter Class Reference

`#include <qwt_painter.h>`

List of all members.

## Static Public Member Functions
static void | drawColorBar (QPainter *painter, const QwtColorMap &, const QwtInterval &, const QwtScaleMap &, Qt::Orientation, const QRectF &)
static void | drawEllipse (QPainter *, const QRectF &)
static void | drawFocusRect (QPainter *, QWidget *)
static void | drawFocusRect (QPainter *, QWidget *, const QRect &)
static void | drawImage (QPainter *, const QRectF &, const QImage &)
static void | drawLine (QPainter *, double x1, double y1, double x2, double y2)
static void | drawLine (QPainter *, const QPointF &p1, const QPointF &p2)
static void | drawLine (QPainter *, const QLineF &)
static void | drawPath (QPainter *, const QPainterPath &)
static void | drawPie (QPainter *, const QRectF &r, int a, int alen)
static void | drawPixmap (QPainter *, const QRectF &, const QPixmap &)
static void | drawPoint (QPainter *, double x, double y)
static void | drawPoint (QPainter *, const QPointF &)
static void | drawPolygon (QPainter *, const QPolygonF &pa)
static void | drawPolyline (QPainter *, const QPolygonF &pa)
static void | drawPolyline (QPainter *, const QPointF *, int pointCount)
static void | drawRect (QPainter *, double x, double y, double w, double h)
static void | drawRect (QPainter *, const QRectF &rect)
static void | drawRoundedFrame (QPainter *, const QRectF &, double xRadius, double yRadius, const QPalette &, int lineWidth, int frameStyle)
static void | drawSimpleRichText (QPainter *, const QRectF &, int flags, const QTextDocument &)
static void | drawText (QPainter *, double x, double y, const QString &)
static void | drawText (QPainter *, const QPointF &, const QString &)
static void | drawText (QPainter *, double x, double y, double w, double h, int flags, const QString &)
static void | drawText (QPainter *, const QRectF &, int flags, const QString &)
static void | fillRect (QPainter *, const QRectF &, const QBrush &)
static bool | isAligning (QPainter *painter)
static bool | polylineSplitting ()
static bool | roundingAlignment ()
static bool | roundingAlignment (QPainter *)
static void | setPolylineSplitting (bool)
static void | setRoundingAlignment (bool)

## Detailed Description

A collection of QPainter workarounds.

## Member Function Documentation

void QwtPainter::drawColorBar | ( | QPainter * | painter,
|  | const QwtColorMap & | colorMap,
|  | const QwtInterval & | interval,
|  | const QwtScaleMap & | scaleMap,
|  | Qt::Orientation | orientation,
|  | const QRectF & | rect
| ) |  |
| static

Draw a color bar into a rectangle

Parameters:

  painter | Painter
  colorMap | Color map
  interval | Value range
  scaleMap | Scale map
  orientation | Orientation
  rect | Traget rectangle

void QwtPainter::drawRoundedFrame | ( | QPainter * | painter,
|  | const QRectF & | rect,
|  | double | xRadius,
|  | double | yRadius,
|  | const QPalette & | palette,
|  | int | lineWidth,
|  | int | frameStyle
| ) |  |
| static

Draw a frame with rounded borders

Parameters:

  painter | Painter
  rect | Frame rectangle
  xRadius | x-radius of the ellipses defining the corners
  yRadius | y-radius of the ellipses defining the corners
  palette | QPalette::WindowText is used for plain borders QPalette::Dark and QPalette::Light for raised or sunken borders
  lineWidth | Line width
  frameStyle | bitwise OR´ed value of QFrame::Shape and QFrame::Shadow

void QwtPainter::drawSimpleRichText | ( | QPainter * | painter,
|  | const QRectF & | rect,
|  | int | flags,
|  | const QTextDocument & | text
| ) |  |
| static

Draw a text document into a rectangle

Parameters:

  painter | Painter
  rect | Traget rectangle
  flags | Alignments/Text flags, see QPainter::drawText()
  text | Text document

bool QwtPainter::isAligning | ( | QPainter * | painter | ) |
| static

Check if the painter is using a paint engine, that aligns coordinates to integers. Today these are all paint engines beside QPaintEngine::Pdf and QPaintEngine::SVG.

Parameters:

  painter | Painter

Returns:
  true, when the paint engine is aligning

See also:
  setRoundingAlignment()

bool QwtPainter::polylineSplitting | ( |  | ) |
| inline static

Returns whether line splitting for the raster paint engine is enabled.

See also:
  setPolylineSplitting()

bool QwtPainter::roundingAlignment | ( |  | ) |
| inline static

Returns whether coordinates should be rounded, before they are painted to a paint engine that floors to integer values. For other paint engines this ( Pdf, SVG ), this flag has no effect.

See also:
  setRoundingAlignment(), isAligning()

bool QwtPainter::roundingAlignment | ( | QPainter * | painter | ) |
| inline static

Returns:
  roundingAlignment() && isAligning(painter);

Parameters:

  painter | Painter

void QwtPainter::setPolylineSplitting | ( | bool | enable | ) |
| static

En/Disable line splitting for the raster paint engine.

The raster paint engine paints polylines of many points much faster when they are splitted in smaller chunks.

See also:
  polylineSplitting()

void QwtPainter::setRoundingAlignment | ( | bool | enable | ) |
| static

Enable whether coordinates should be rounded, before they are painted to a paint engine that floors to integer values. For other paint engines this ( Pdf, SVG ), this flag has no effect. QwtPainter stores this flag only, the rounding itsself is done in the painting code ( f.e the plot items ).

The default setting is true.

See also:
  roundingAlignment(), isAligning()