• 3700阅读
  • 4回复

qt 重写类 [复制链接]

上一主题 下一主题
离线sl91wxl
 

只看楼主 倒序阅读 楼主  发表于: 2013-08-15
哪位大神教我一下,如果我想重写 QGraphicsItem类,能够画很多条直线作为一个item,这个类该怎么写

离线dbzhang800

只看该作者 1楼 发表于: 2013-08-15
可以多看看Manual:

To write your own graphics item, you first create a subclass of QGraphicsItem, and then start by implementing its two pure virtual public functions: boundingRect(), which returns an estimate of the area painted by the item, and paint(), which implements the actual painting. For example:
离线sl91wxl

只看该作者 2楼 发表于: 2013-08-15
ok,迷迷糊糊不知道看不太懂
离线sl91wxl

只看该作者 3楼 发表于: 2013-08-15
我想画个坐标系作为item,
离线sl91wxl

只看该作者 4楼 发表于: 2013-08-15
重写item 做出来的坐标系已经做好了,谁有同样的问题可以一起探讨
快速回复
限100 字节
 
上一个 下一个