QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | Protected 成员函数 | 所有成员列表
QwtGraphic类 参考

可缩放图形的绘制设备 更多...

#include <qwt_graphic.h>

类 QwtGraphic 继承关系图:
QwtNullPaintDevice

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 ()
 析构函数
 
QwtGraphicoperator= (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
 

详细描述

可缩放图形的绘制设备

成员枚举类型说明

◆ CommandType

指示图形是否包含特定类型的绘制命令

枚举值
VectorData 

图形包含可缩放的矢量数据

RasterData 

图形包含光栅数据(QPixmap 或 QImage)

Transformation 

图形包含超出简单平移的变换

◆ RenderHint

渲染图形的提示

枚举值
RenderPensUnscaled 

渲染 QwtGraphic 时,在 render() 内部设置 controlPointRect() 与目标矩形坐标之间的特定缩放。

设置 RenderPensUnscaled 时,此特定缩放仅应用于控制点, 不应用于画笔。所有其他绘制变换(由应用程序代码设置) 按常规方式工作。

构造及析构函数说明

◆ QwtGraphic() [1/2]

QwtGraphic::QwtGraphic ( )

构造函数

◆ QwtGraphic() [2/2]

QwtGraphic::QwtGraphic ( const QwtGraphic other)

复制构造函数

◆ ~QwtGraphic()

QwtGraphic::~QwtGraphic ( )
virtual

析构函数

成员函数说明

◆ boundingRect()

QRectF QwtGraphic::boundingRect ( ) const

获取边界矩形

◆ commands()

const QVector< QwtPainterCommand > & QwtGraphic::commands ( ) const

获取记录的绘制命令列表

◆ commandTypes()

QwtGraphic::CommandTypes QwtGraphic::commandTypes ( ) const

获取正在使用的绘制命令类型

◆ controlPointRect()

QRectF QwtGraphic::controlPointRect ( ) const

获取控制点矩形

◆ defaultSize()

QSizeF QwtGraphic::defaultSize ( ) const

获取默认大小

◆ drawImage()

void QwtGraphic::drawImage ( const QRectF &  rect,
const QImage &  image,
const QRectF &  subRect,
Qt::ImageConversionFlags  flags 
)
overrideprotectedvirtual

Store a image command in the command list

参数
recttarget rectangle
imageImage to be painted
subRectReactangle of the pixmap to be painted
flagsImage conversion flags
参见
QPaintEngine::drawImage()

重载 QwtNullPaintDevice .

◆ drawPath()

void QwtGraphic::drawPath ( const QPainterPath &  path)
overrideprotectedvirtual

Store a path command in the command list

参数
pathPainter path
参见
QPaintEngine::drawPath()

重载 QwtNullPaintDevice .

◆ drawPixmap()

void QwtGraphic::drawPixmap ( const QRectF &  rect,
const QPixmap &  pixmap,
const QRectF &  subRect 
)
overrideprotectedvirtual

Store a pixmap command in the command list

参数
recttarget rectangle
pixmapPixmap to be painted
subRectReactangle of the pixmap to be painted
参见
QPaintEngine::drawPixmap()

重载 QwtNullPaintDevice .

◆ heightForWidth()

qreal QwtGraphic::heightForWidth ( qreal  width) const

根据给定宽度查找高度

◆ isEmpty()

bool QwtGraphic::isEmpty ( ) const

检查图形是否为空

◆ isNull()

bool QwtGraphic::isNull ( ) const

检查图形是否为空

◆ operator=()

QwtGraphic & QwtGraphic::operator= ( const QwtGraphic other)

赋值运算符

◆ render() [1/4]

void QwtGraphic::render ( QPainter *  painter) const

重放所有记录的绘制命令

◆ render() [2/4]

void QwtGraphic::render ( QPainter *  painter,
const QPointF &  pos,
Qt::Alignment  alignment = Qt::AlignTop | Qt::AlignLeft 
) const

重放所有记录的绘制命令,对齐到指定位置

◆ render() [3/4]

void QwtGraphic::render ( QPainter *  painter,
const QRectF &  rect,
Qt::AspectRatioMode  aspectRatioMode = Qt::IgnoreAspectRatio 
) const

重放所有记录的绘制命令,缩放以适应给定矩形

◆ render() [4/4]

void QwtGraphic::render ( QPainter *  painter,
const QSizeF &  size,
Qt::AspectRatioMode  aspectRatioMode = Qt::IgnoreAspectRatio 
) const

重放所有记录的绘制命令,缩放以适应给定大小

◆ renderHints()

QwtGraphic::RenderHints QwtGraphic::renderHints ( ) const

获取渲染提示

◆ reset()

void QwtGraphic::reset ( )

清除所有存储的命令

◆ scaledBoundingRect()

QRectF QwtGraphic::scaledBoundingRect ( qreal  sx,
qreal  sy 
) const

计算缩放图形的目标矩形

◆ setCommands()

void QwtGraphic::setCommands ( const QVector< QwtPainterCommand > &  commands)

追加绘制命令

◆ setDefaultSize()

void QwtGraphic::setDefaultSize ( const QSizeF &  size)

设置默认大小

◆ setRenderHint()

void QwtGraphic::setRenderHint ( RenderHint  hint,
bool  on = true 
)

切换渲染提示

◆ sizeMetrics()

QSize QwtGraphic::sizeMetrics ( ) const
overrideprotectedvirtual
返回
Ceiled defaultSize()

实现了 QwtNullPaintDevice.

◆ testRenderHint()

bool QwtGraphic::testRenderHint ( RenderHint  hint) const

测试渲染提示

◆ toImage() [1/2]

QImage QwtGraphic::toImage ( const QSize &  size,
Qt::AspectRatioMode  aspectRatioMode = Qt::IgnoreAspectRatio,
qreal  devicePixelRatio = 0.0 
) const

将图形转换为指定大小的 QImage

◆ toImage() [2/2]

QImage QwtGraphic::toImage ( qreal  devicePixelRatio = 0.0) const

将图形转换为默认大小的 QImage

◆ toPixmap() [1/2]

QPixmap QwtGraphic::toPixmap ( const QSize &  size,
Qt::AspectRatioMode  aspectRatioMode = Qt::IgnoreAspectRatio,
qreal  devicePixelRatio = 0.0 
) const

将图形转换为指定大小的 QPixmap

◆ toPixmap() [2/2]

QPixmap QwtGraphic::toPixmap ( qreal  devicePixelRatio = 0.0) const

将图形转换为默认大小的 QPixmap

◆ updateState()

void QwtGraphic::updateState ( const QPaintEngineState &  state)
overrideprotectedvirtual

Store a state command in the command list

参数
stateState to be stored
参见
QPaintEngine::updateState()

重载 QwtNullPaintDevice .

◆ widthForHeight()

qreal QwtGraphic::widthForHeight ( qreal  height) const

根据给定高度查找宽度


该类的文档由以下文件生成: