A collection of QPainter workarounds. More...
#include <qwt_painter.h>
Static Public Member Functions | |
static QPixmap | backingStore (QWidget *, const QSize &) |
static qreal | devicePixelRatio (const QPaintDevice *) |
static void | drawBackgound (QPainter *, const QRectF &, const QWidget *) |
static void | drawColorBar (QPainter *, const QwtColorMap &, const QwtInterval &, const QwtScaleMap &, Qt::Orientation, const QRectF &) |
static void | drawEllipse (QPainter *, const QRectF &) |
Wrapper for QPainter::drawEllipse() More... | |
static void | drawFocusRect (QPainter *, const QWidget *) |
Draw a focus rectangle on a widget using its style. More... | |
static void | drawFocusRect (QPainter *, const QWidget *, const QRect &) |
Draw a focus rectangle on a widget using its style. More... | |
static void | drawFrame (QPainter *, const QRectF &rect, const QPalette &palette, QPalette::ColorRole foregroundRole, int lineWidth, int midLineWidth, int frameStyle) |
static void | drawImage (QPainter *, const QRectF &, const QImage &) |
Wrapper for QPainter::drawImage() More... | |
static void | drawLine (QPainter *, qreal x1, qreal y1, qreal x2, qreal y2) |
Wrapper for QPainter::drawLine() More... | |
static void | drawLine (QPainter *, const QPointF &p1, const QPointF &p2) |
Wrapper for QPainter::drawLine() More... | |
static void | drawLine (QPainter *, const QLineF &) |
Wrapper for QPainter::drawLine() More... | |
static void | drawPath (QPainter *, const QPainterPath &) |
Wrapper for QPainter::drawPath() More... | |
static void | drawPie (QPainter *, const QRectF &r, int a, int alen) |
Wrapper for QPainter::drawPie() More... | |
static void | drawPixmap (QPainter *, const QRectF &, const QPixmap &) |
Wrapper for QPainter::drawPixmap() More... | |
static void | drawPoint (QPainter *, const QPoint &) |
Wrapper for QPainter::drawPoint() More... | |
static void | drawPoint (QPainter *, qreal x, qreal y) |
Wrapper for QPainter::drawPoint() More... | |
static void | drawPoint (QPainter *, const QPointF &) |
Wrapper for QPainter::drawPoint() More... | |
static void | drawPoints (QPainter *, const QPolygon &) |
Wrapper for QPainter::drawPoints() More... | |
static void | drawPoints (QPainter *, const QPoint *, int pointCount) |
Wrapper for QPainter::drawPoints() More... | |
static void | drawPoints (QPainter *, const QPolygonF &) |
Wrapper for QPainter::drawPoints() More... | |
static void | drawPoints (QPainter *, const QPointF *, int pointCount) |
Wrapper for QPainter::drawPoints() More... | |
static void | drawPolygon (QPainter *, const QPolygonF &) |
Wrapper for QPainter::drawPolygon() More... | |
static void | drawPolygon (QPainter *, const QPolygon &) |
Wrapper for QPainter::drawPolygon() More... | |
static void | drawPolyline (QPainter *, const QPolygonF &) |
Wrapper for QPainter::drawPolyline() More... | |
static void | drawPolyline (QPainter *, const QPointF *, int pointCount) |
Wrapper for QPainter::drawPolyline() More... | |
static void | drawPolyline (QPainter *, const QPolygon &) |
Wrapper for QPainter::drawPolyline() More... | |
static void | drawPolyline (QPainter *, const QPoint *, int pointCount) |
Wrapper for QPainter::drawPolyline() More... | |
static void | drawRect (QPainter *, qreal x, qreal y, qreal w, qreal h) |
Wrapper for QPainter::drawRect() More... | |
static void | drawRect (QPainter *, const QRectF &rect) |
Wrapper for QPainter::drawRect() More... | |
static void | drawRoundedFrame (QPainter *, const QRectF &, qreal xRadius, qreal yRadius, const QPalette &, int lineWidth, int frameStyle) |
static void | drawRoundFrame (QPainter *, const QRectF &, const QPalette &, int lineWidth, int frameStyle) |
static void | drawSimpleRichText (QPainter *, const QRectF &, int flags, const QTextDocument &) |
static void | drawText (QPainter *, qreal x, qreal y, const QString &) |
Wrapper for QPainter::drawText() More... | |
static void | drawText (QPainter *, const QPointF &, const QString &) |
Wrapper for QPainter::drawText() More... | |
static void | drawText (QPainter *, qreal x, qreal y, qreal w, qreal h, int flags, const QString &) |
Wrapper for QPainter::drawText() More... | |
static void | drawText (QPainter *, const QRectF &, int flags, const QString &) |
Wrapper for QPainter::drawText() More... | |
static qreal | effectivePenWidth (const QPen &) |
static void | fillPixmap (const QWidget *, QPixmap &, const QPoint &offset=QPoint()) |
static void | fillRect (QPainter *, const QRectF &, const QBrush &) |
Wrapper for QPainter::fillRect() More... | |
static int | horizontalAdvance (const QFontMetrics &, const QString &) |
static qreal | horizontalAdvance (const QFontMetricsF &, const QString &) |
static int | horizontalAdvance (const QFontMetrics &, QChar) |
static qreal | horizontalAdvance (const QFontMetricsF &, QChar) |
static bool | isAligning (const QPainter *) |
static bool | isX11GraphicsSystem () |
static bool | polylineSplitting () |
static bool | roundingAlignment () |
static bool | roundingAlignment (const QPainter *) |
static void | setPolylineSplitting (bool) |
En/Disable line splitting for the raster paint engine. More... | |
static void | setRoundingAlignment (bool) |
Static Private Attributes | |
static bool | d_polylineSplitting = true |
static bool | d_roundingAlignment = true |
A collection of QPainter workarounds.
Definition at line 36 of file qwt_painter.h.
|
static |
widget | Widget, for which the backingstore is intended |
size | Size of the pixmap |
Definition at line 1462 of file qwt_painter.cpp.
|
static |
paintDevice | Paint device |
Definition at line 1428 of file qwt_painter.cpp.
|
static |
Fill rect with the background of a widget
painter | Painter |
rect | Rectangle to be filled |
widget | Widget |
Definition at line 1334 of file qwt_painter.cpp.
|
static |
Draw a color bar into a rectangle
painter | Painter |
colorMap | Color map |
interval | Value range |
scaleMap | Scale map |
orientation | Orientation |
rect | Traget rectangle |
Definition at line 1188 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawEllipse()
Definition at line 409 of file qwt_painter.cpp.
|
static |
Draw a focus rectangle on a widget using its style.
Definition at line 798 of file qwt_painter.cpp.
|
static |
Draw a focus rectangle on a widget using its style.
Definition at line 804 of file qwt_painter.cpp.
|
static |
Draw a rectangular frame
painter | Painter |
rect | Frame rectangle |
palette | Palette |
foregroundRole | Foreground role used for QFrame::Plain |
frameWidth | Frame width |
midLineWidth | Used for QFrame::Box |
frameStyle | bitwise OR´ed value of QFrame::Shape and QFrame::Shadow |
Definition at line 894 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawImage()
Definition at line 756 of file qwt_painter.cpp.
|
inlinestatic |
Wrapper for QPainter::drawLine()
Definition at line 152 of file qwt_painter.h.
|
static |
Wrapper for QPainter::drawLine()
Definition at line 524 of file qwt_painter.cpp.
|
inlinestatic |
Wrapper for QPainter::drawLine()
Definition at line 159 of file qwt_painter.h.
|
static |
Wrapper for QPainter::drawPath()
Definition at line 324 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPie()
Definition at line 397 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPixmap()
Definition at line 777 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPoint()
Definition at line 674 of file qwt_painter.cpp.
|
inlinestatic |
Wrapper for QPainter::drawPoint()
Definition at line 134 of file qwt_painter.h.
|
static |
Wrapper for QPainter::drawPoint()
Definition at line 662 of file qwt_painter.cpp.
|
inlinestatic |
Wrapper for QPainter::drawPoints()
Definition at line 140 of file qwt_painter.h.
|
static |
Wrapper for QPainter::drawPoints()
Definition at line 697 of file qwt_painter.cpp.
|
inlinestatic |
Wrapper for QPainter::drawPoints()
Definition at line 146 of file qwt_painter.h.
|
static |
Wrapper for QPainter::drawPoints()
Definition at line 730 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPolygon()
Definition at line 544 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPolygon()
Definition at line 603 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPolyline()
Definition at line 561 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPolyline()
Definition at line 581 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPolyline()
Definition at line 620 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawPolyline()
Definition at line 640 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawRect()
Definition at line 330 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawRect()
Definition at line 336 of file qwt_painter.cpp.
|
static |
Draw a rectangular frame with rounded borders
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 |
Definition at line 1048 of file qwt_painter.cpp.
|
static |
Draw a round frame
painter | Painter |
rect | Frame rectangle |
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 |
Definition at line 828 of file qwt_painter.cpp.
|
static |
Draw a text document into a rectangle
painter | Painter |
rect | Traget rectangle |
flags | Alignments/Text flags, see QPainter::drawText() |
text | Text document |
Definition at line 472 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawText()
Definition at line 421 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawText()
Definition at line 428 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawText()
Definition at line 445 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::drawText()
Definition at line 453 of file qwt_painter.cpp.
|
inlinestatic |
pen | Pen |
Definition at line 199 of file qwt_painter.h.
|
static |
Fill a pixmap with the content of a widget
In Qt >= 5.0 QPixmap::fill() is a nop, in Qt 4.x it is buggy for backgrounds with gradients. Thus fillPixmap() offers an alternative implementation.
widget | Widget |
pixmap | Pixmap to be filled |
offset | Offset |
Definition at line 1294 of file qwt_painter.cpp.
|
static |
Wrapper for QPainter::fillRect()
Definition at line 365 of file qwt_painter.cpp.
|
static |
Distance appropriate for drawing a subsequent character after text.
fontMetrics | Font metrics |
text | Text |
Definition at line 1362 of file qwt_painter.cpp.
|
static |
Distance appropriate for drawing a subsequent character after text.
fontMetrics | Font metrics |
text | Text |
Definition at line 1380 of file qwt_painter.cpp.
|
static |
Distance appropriate for drawing a subsequent character after ch.
fontMetrics | Font metrics |
ch | Character |
Definition at line 1397 of file qwt_painter.cpp.
|
static |
Distance appropriate for drawing a subsequent character after ch.
fontMetrics | Font metrics |
ch | Character |
Definition at line 1414 of file qwt_painter.cpp.
|
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.
If we have an integer based paint engine it is also checked if the painter has a transformation matrix, that rotates or scales.
painter | Painter |
Definition at line 250 of file qwt_painter.cpp.
|
static |
Check is the application is running with the X11 graphics system that has some special capabilities that can be used for incremental painting to a widget.
Definition at line 216 of file qwt_painter.cpp.
|
inlinestatic |
Definition at line 168 of file qwt_painter.h.
|
inlinestatic |
Check whether coordinates should be rounded, before they are painted to a paint engine that rounds to integer values. For other paint engines ( PDF, SVG ), this flag has no effect.
Definition at line 181 of file qwt_painter.h.
|
inlinestatic |
painter | Painter |
Definition at line 190 of file qwt_painter.h.
|
static |
En/Disable line splitting for the raster paint engine.
In some Qt versions the raster paint engine paints polylines of many points much faster when they are split in smaller chunks: f.e all supported Qt versions >= Qt 5.0 when drawing an antialiased polyline with a pen width >=2.
Also the raster paint engine has a nasty bug in many versions ( Qt 4.8 - ... ) for short lines ( https://codereview.qt-project.org/#/c/99456 ), that is worked around in this mode.
The default setting is true.
Definition at line 318 of file qwt_painter.cpp.
|
static |
Enable whether coordinates should be rounded, before they are painted to a paint engine that floors to integer values. For other paint engines ( PDF, SVG ) this flag has no effect. QwtPainter stores this flag only, the rounding itself is done in the painting code ( f.e the plot items ).
The default setting is true.
Definition at line 298 of file qwt_painter.cpp.
|
staticprivate |
Definition at line 129 of file qwt_painter.h.
|
staticprivate |
Definition at line 130 of file qwt_painter.h.