|
QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
|
可缩放图形的绘制设备 更多...
#include <qwt_graphic.h>
类 | |
| class | PathInfo |
| class | PrivateData |
Public 类型 | |
| enum | RenderHint { RenderPensUnscaled = 0x1 } |
| 渲染图形的提示 更多... | |
| enum | CommandType { VectorData = 1 << 0 , RasterData = 1 << 1 , Transformation = 1 << 2 } |
| 指示图形是否包含特定类型的绘制命令 更多... | |
Public 类型 继承自 QwtNullPaintDevice | |
| enum | Mode { NormalMode , PolygonPathMode , PathMode } |
| 绘制设备的渲染模式 更多... | |
Public 成员函数 | |
| QwtGraphic () | |
| 构造函数 | |
| QwtGraphic (const QwtGraphic &) | |
| 复制构造函数 | |
| virtual | ~QwtGraphic () |
| 析构函数 | |
| QwtGraphic & | operator= (const QwtGraphic &) |
| 赋值运算符 | |
| void | reset () |
| 清除所有存储的命令 | |
| bool | isNull () const |
| 检查图形是否为空 | |
| bool | isEmpty () const |
| 检查图形是否为空 | |
| CommandTypes | commandTypes () const |
| 获取正在使用的绘制命令类型 | |
| void | render (QPainter *) const |
| 重放所有记录的绘制命令 | |
| void | render (QPainter *, const QSizeF &, Qt::AspectRatioMode=Qt::IgnoreAspectRatio) const |
| 重放所有记录的绘制命令,缩放以适应给定大小 | |
| void | render (QPainter *, const QPointF &, Qt::Alignment=Qt::AlignTop|Qt::AlignLeft) const |
| 重放所有记录的绘制命令,对齐到指定位置 | |
| void | render (QPainter *, const QRectF &, Qt::AspectRatioMode=Qt::IgnoreAspectRatio) const |
| 重放所有记录的绘制命令,缩放以适应给定矩形 | |
| QPixmap | toPixmap (qreal devicePixelRatio=0.0) const |
| 将图形转换为默认大小的 QPixmap | |
| QPixmap | toPixmap (const QSize &, Qt::AspectRatioMode=Qt::IgnoreAspectRatio, qreal devicePixelRatio=0.0) const |
| 将图形转换为指定大小的 QPixmap | |
| QImage | toImage (qreal devicePixelRatio=0.0) const |
| 将图形转换为默认大小的 QImage | |
| QImage | toImage (const QSize &, Qt::AspectRatioMode=Qt::IgnoreAspectRatio, qreal devicePixelRatio=0.0) const |
| 将图形转换为指定大小的 QImage | |
| QRectF | scaledBoundingRect (qreal sx, qreal sy) const |
| 计算缩放图形的目标矩形 | |
| QRectF | boundingRect () const |
| 获取边界矩形 | |
| QRectF | controlPointRect () const |
| 获取控制点矩形 | |
| const QVector< QwtPainterCommand > & | commands () const |
| 获取记录的绘制命令列表 | |
| void | setCommands (const QVector< QwtPainterCommand > &) |
| 追加绘制命令 | |
| void | setDefaultSize (const QSizeF &) |
| 设置默认大小 | |
| QSizeF | defaultSize () const |
| 获取默认大小 | |
| qreal | heightForWidth (qreal width) const |
| 根据给定宽度查找高度 | |
| qreal | widthForHeight (qreal height) const |
| 根据给定高度查找宽度 | |
| void | setRenderHint (RenderHint, bool on=true) |
| 切换渲染提示 | |
| bool | testRenderHint (RenderHint) const |
| 测试渲染提示 | |
| RenderHints | renderHints () const |
| 获取渲染提示 | |
Public 成员函数 继承自 QwtNullPaintDevice | |
| QwtNullPaintDevice () | |
| Constructor | |
| virtual | ~QwtNullPaintDevice () |
| Destructor | |
| void | setMode (Mode) |
| Set the render mode | |
| Mode | mode () const |
| Get the render mode | |
| virtual QPaintEngine * | paintEngine () const override |
| Return the paint engine | |
| virtual int | metric (PaintDeviceMetric) const override |
| Return metric information for the paint device | |
| virtual void | drawRects (const QRect *, int) |
| Draw rectangles (integer version) | |
| virtual void | drawRects (const QRectF *, int) |
| Draw rectangles (floating point version) | |
| virtual void | drawLines (const QLine *, int) |
| Draw lines (integer version) | |
| virtual void | drawLines (const QLineF *, int) |
| Draw lines (floating point version) | |
| virtual void | drawEllipse (const QRectF &) |
| Draw ellipse (floating point version) | |
| virtual void | drawEllipse (const QRect &) |
| Draw ellipse (integer version) | |
| virtual void | drawPoints (const QPointF *, int) |
| Draw points (floating point version) | |
| virtual void | drawPoints (const QPoint *, int) |
| Draw points (integer version) | |
| virtual void | drawPolygon (const QPointF *, int, QPaintEngine::PolygonDrawMode) |
| Draw polygon (floating point version) | |
| virtual void | drawPolygon (const QPoint *, int, QPaintEngine::PolygonDrawMode) |
| Draw polygon (integer version) | |
| virtual void | drawTextItem (const QPointF &, const QTextItem &) |
| Draw a text item | |
| virtual void | drawTiledPixmap (const QRectF &, const QPixmap &, const QPointF &) |
| Draw a tiled pixmap | |
Protected 成员函数 | |
| virtual QSize | sizeMetrics () const override |
| virtual void | drawPath (const QPainterPath &) override |
| Store a path command in the command list | |
| virtual void | drawPixmap (const QRectF &, const QPixmap &, const QRectF &) override |
| Store a pixmap command in the command list | |
| virtual void | drawImage (const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags) override |
| Store a image command in the command list | |
| virtual void | updateState (const QPaintEngineState &) override |
| Store a state command in the command list | |
可缩放图形的绘制设备
渲染图形的提示
| 枚举值 | |
|---|---|
| RenderPensUnscaled | 渲染 QwtGraphic 时,在 render() 内部设置 controlPointRect() 与目标矩形坐标之间的特定缩放。 设置 RenderPensUnscaled 时,此特定缩放仅应用于控制点, 不应用于画笔。所有其他绘制变换(由应用程序代码设置) 按常规方式工作。 |
| QwtGraphic::QwtGraphic | ( | ) |
构造函数
| QwtGraphic::QwtGraphic | ( | const QwtGraphic & | other | ) |
复制构造函数
|
virtual |
析构函数
| QRectF QwtGraphic::boundingRect | ( | ) | const |
获取边界矩形
| const QVector< QwtPainterCommand > & QwtGraphic::commands | ( | ) | const |
获取记录的绘制命令列表
| QwtGraphic::CommandTypes QwtGraphic::commandTypes | ( | ) | const |
获取正在使用的绘制命令类型
| QRectF QwtGraphic::controlPointRect | ( | ) | const |
获取控制点矩形
| QSizeF QwtGraphic::defaultSize | ( | ) | const |
获取默认大小
|
overrideprotectedvirtual |
Store a image command in the command list
| rect | target rectangle |
| image | Image to be painted |
| subRect | Reactangle of the pixmap to be painted |
| flags | Image conversion flags |
重载 QwtNullPaintDevice .
|
overrideprotectedvirtual |
Store a path command in the command list
| path | Painter path |
重载 QwtNullPaintDevice .
|
overrideprotectedvirtual |
Store a pixmap command in the command list
| rect | target rectangle |
| pixmap | Pixmap to be painted |
| subRect | Reactangle of the pixmap to be painted |
重载 QwtNullPaintDevice .
| qreal QwtGraphic::heightForWidth | ( | qreal | width | ) | const |
根据给定宽度查找高度
| bool QwtGraphic::isEmpty | ( | ) | const |
检查图形是否为空
| bool QwtGraphic::isNull | ( | ) | const |
检查图形是否为空
| QwtGraphic & QwtGraphic::operator= | ( | const QwtGraphic & | other | ) |
赋值运算符
| void QwtGraphic::render | ( | QPainter * | painter | ) | const |
重放所有记录的绘制命令
| void QwtGraphic::render | ( | QPainter * | painter, |
| const QPointF & | pos, | ||
| Qt::Alignment | alignment = Qt::AlignTop | Qt::AlignLeft |
||
| ) | const |
重放所有记录的绘制命令,对齐到指定位置
| void QwtGraphic::render | ( | QPainter * | painter, |
| const QRectF & | rect, | ||
| Qt::AspectRatioMode | aspectRatioMode = Qt::IgnoreAspectRatio |
||
| ) | const |
重放所有记录的绘制命令,缩放以适应给定矩形
| void QwtGraphic::render | ( | QPainter * | painter, |
| const QSizeF & | size, | ||
| Qt::AspectRatioMode | aspectRatioMode = Qt::IgnoreAspectRatio |
||
| ) | const |
重放所有记录的绘制命令,缩放以适应给定大小
| QwtGraphic::RenderHints QwtGraphic::renderHints | ( | ) | const |
获取渲染提示
| void QwtGraphic::reset | ( | ) |
清除所有存储的命令
| QRectF QwtGraphic::scaledBoundingRect | ( | qreal | sx, |
| qreal | sy | ||
| ) | const |
计算缩放图形的目标矩形
| void QwtGraphic::setCommands | ( | const QVector< QwtPainterCommand > & | commands | ) |
追加绘制命令
| void QwtGraphic::setDefaultSize | ( | const QSizeF & | size | ) |
设置默认大小
| void QwtGraphic::setRenderHint | ( | RenderHint | hint, |
| bool | on = true |
||
| ) |
切换渲染提示
|
overrideprotectedvirtual |
实现了 QwtNullPaintDevice.
| bool QwtGraphic::testRenderHint | ( | RenderHint | hint | ) | const |
测试渲染提示
| QImage QwtGraphic::toImage | ( | const QSize & | size, |
| Qt::AspectRatioMode | aspectRatioMode = Qt::IgnoreAspectRatio, |
||
| qreal | devicePixelRatio = 0.0 |
||
| ) | const |
将图形转换为指定大小的 QImage
| QImage QwtGraphic::toImage | ( | qreal | devicePixelRatio = 0.0 | ) | const |
将图形转换为默认大小的 QImage
| QPixmap QwtGraphic::toPixmap | ( | const QSize & | size, |
| Qt::AspectRatioMode | aspectRatioMode = Qt::IgnoreAspectRatio, |
||
| qreal | devicePixelRatio = 0.0 |
||
| ) | const |
将图形转换为指定大小的 QPixmap
| QPixmap QwtGraphic::toPixmap | ( | qreal | devicePixelRatio = 0.0 | ) | const |
将图形转换为默认大小的 QPixmap
|
overrideprotectedvirtual |
Store a state command in the command list
| state | State to be stored |
重载 QwtNullPaintDevice .
| qreal QwtGraphic::widthForHeight | ( | qreal | height | ) | const |
根据给定高度查找宽度