Qt中坐标系的单位长度是多少
答案:2 悬赏:70 手机版
解决时间 2021-01-25 17:39
- 提问者网友:缘字诀
- 2021-01-25 01:22
Qt中坐标系的单位长度是多少
最佳答案
- 五星知识达人网友:轻熟杀无赦
- 2021-01-25 02:53
可以使用setSceneRect()设置QGraphicsScene的大小。如果不设置,则默认为scene中包含所有子元素的边界区域( itemsBoundingRect()函数的返回值)。
更详细的说明参看QGraphicsScene的文档,讲解很详细,看下面这段:
The scene's bounding rect is set by calling setSceneRect(). Items can be placed at any position on the scene, and the size of the scene is by default unlimited. The scene rect is used only for internal bookkeeping, maintaining the scene's item index. If the scene rect is unset, QGraphicsScene will use the bounding area of all items, as returned by itemsBoundingRect(), as the scene rect. However, itemsBoundingRect() is a relatively time consuming function, as it operates by collecting positional information for every item on the scene. Because of this, you should always set the scene rect when operating on large scenes.
更详细的说明参看QGraphicsScene的文档,讲解很详细,看下面这段:
The scene's bounding rect is set by calling setSceneRect(). Items can be placed at any position on the scene, and the size of the scene is by default unlimited. The scene rect is used only for internal bookkeeping, maintaining the scene's item index. If the scene rect is unset, QGraphicsScene will use the bounding area of all items, as returned by itemsBoundingRect(), as the scene rect. However, itemsBoundingRect() is a relatively time consuming function, as it operates by collecting positional information for every item on the scene. Because of this, you should always set the scene rect when operating on large scenes.
全部回答
- 1楼网友:枭雄戏美人
- 2021-01-25 03:19
重载qwidget的painevent()函数.
在painevent函数中可以使用translate,rotate等函数转换painter的坐标系,使绘图变得跟简单.
然后用lineto()函数画线.如果你想画一个三角型箭头的话就最好用drawpath().
可以用drawtext()来画出文字.
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯