StupidBeauty
Read times:1833Posted at:Sat Aug 6 18:11:22 2011
- no title specified

Qt4.7文档翻译:QPolygon类参考,QPolygon Class Reference

详细描述

QPolygon类提供由整数精度的点组成的向量。

每个QPolygon对象 是一个 QVector < QPoint >。 最简单的向一个QPolygon 中添加点的方式就是使用 QVector 的流操作符,就像下面这样的:

QPolygon polygon;

polygon << QPoint(10, 20) << QPoint(20, 30);

除咯 QVector 提供 的那些函数之外, QPolygon 还提供咯一些与点相关的函数。

多边形中的每个点都可以通过将它的索引传递给 point ()函数的方式来获取。要填充(populate)多边形的内容的话,QPolygon提供咯这些函数: setPoint (),设置指定索引值对应的点; setPoints (),设置这个多边形中的所有的点(改变多边形的大小以装下那麽多的点); putPoints (),将一些点复制到多边形中从某个索引开始的位置(必要的时候会改变多边形的大小)。

QPolygon提供咯 boundingRect ()和 translate ()函数,以便为那些几何功能服务。使用 QMatrix::map ()函数来为QPolygon进行更加通用的变换。

QPolygon类是 隐式共享的

参见 QVector QPolygonF QLine

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands