Qwt User's Guide: QwtPainter Class Reference

Qwt User's Guide 6.0.1

- Main Page
- Related Pages
- Classes
- Files

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

Static Public Member Functions

# QwtPainter Class Reference

A collection of QPainter workarounds. More...

`#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 QPointF *, int pointCount)
static void | drawPolyline (QPainter *, const QPolygonF &pa)
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 *, const QRectF &, int flags, const QString &)
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 | 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::drawEllipse | ( | QPainter * | painter,
|  | const QRectF & | rect
| ) |  | `[static]`

Wrapper for QPainter::drawEllipse()

void QwtPainter::drawFocusRect | ( | QPainter * | painter,
|  | QWidget * | widget
| ) |  | `[static]`

Draw a focus rectangle on a widget using its style.

void QwtPainter::drawFocusRect | ( | QPainter * | painter,
|  | QWidget * | widget,
|  | const QRect & | rect
| ) |  | `[static]`

Draw a focus rectangle on a widget using its style.

void QwtPainter::drawImage | ( | QPainter * | painter,
|  | const QRectF & | rect,
|  | const QImage & | image
| ) |  | `[static]`

Wrapper for QPainter::drawImage()

void QwtPainter::drawLine | ( | QPainter * | painter,
|  | double | x1,
|  | double | y1,
|  | double | x2,
|  | double | y2
| ) |  | `[inline, static]`

Wrapper for QPainter::drawLine()

void QwtPainter::drawLine | ( | QPainter * | painter,
|  | const QPointF & | p1,
|  | const QPointF & | p2
| ) |  | `[static]`

Wrapper for QPainter::drawLine()

void QwtPainter::drawLine | ( | QPainter * | painter,
|  | const QLineF & | line
| ) |  | `[inline, static]`

Wrapper for QPainter::drawLine()

void QwtPainter::drawPath | ( | QPainter * | painter,
|  | const QPainterPath & | path
| ) |  | `[static]`

Wrapper for QPainter::drawPath()

void QwtPainter::drawPie | ( | QPainter * | painter,
|  | const QRectF & | r,
|  | int | a,
|  | int | alen
| ) |  | `[static]`

Wrapper for QPainter::drawPie()

void QwtPainter::drawPixmap | ( | QPainter * | painter,
|  | const QRectF & | rect,
|  | const QPixmap & | pixmap
| ) |  | `[static]`

Wrapper for QPainter::drawPixmap()

void QwtPainter::drawPoint | ( | QPainter * | painter,
|  | double | x,
|  | double | y
| ) |  | `[inline, static]`

Wrapper for QPainter::drawPoint()

void QwtPainter::drawPoint | ( | QPainter * | painter,
|  | const QPointF & | pos
| ) |  | `[static]`

Wrapper for QPainter::drawPoint()

void QwtPainter::drawPolygon | ( | QPainter * | painter,
|  | const QPolygonF & | pa
| ) |  | `[static]`

Wrapper for QPainter::drawPolygon()

void QwtPainter::drawPolyline | ( | QPainter * | painter,
|  | const QPointF * | points,
|  | int | pointCount
| ) |  | `[static]`

Wrapper for QPainter::drawPolyline()

void QwtPainter::drawPolyline | ( | QPainter * | painter,
|  | const QPolygonF & | pa
| ) |  | `[static]`

Wrapper for QPainter::drawPolyline()

void QwtPainter::drawRect | ( | QPainter * | painter,
|  | double | x,
|  | double | y,
|  | double | w,
|  | double | h
| ) |  | `[static]`

Wrapper for QPainter::drawRect()

void QwtPainter::drawRect | ( | QPainter * | painter,
|  | const QRectF & | rect
| ) |  | `[static]`

Wrapper for QPainter::drawRect()

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

void QwtPainter::drawText | ( | QPainter * | painter,
|  | const QRectF & | rect,
|  | int | flags,
|  | const QString & | text
| ) |  | `[static]`

Wrapper for QPainter::drawText()

void QwtPainter::drawText | ( | QPainter * | painter,
|  | double | x,
|  | double | y,
|  | const QString & | text
| ) |  | `[static]`

Wrapper for QPainter::drawText()

void QwtPainter::drawText | ( | QPainter * | painter,
|  | const QPointF & | pos,
|  | const QString & | text
| ) |  | `[static]`

Wrapper for QPainter::drawText()

void QwtPainter::drawText | ( | QPainter * | painter,
|  | double | x,
|  | double | y,
|  | double | w,
|  | double | h,
|  | int | flags,
|  | const QString & | text
| ) |  | `[static]`

Wrapper for QPainter::drawText()

void QwtPainter::fillRect | ( | QPainter * | painter,
|  | const QRectF & | rect,
|  | const QBrush & | brush
| ) |  | `[static]`

Wrapper for QPainter::fillRect()

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()