Qt问题:通过QGraphicsView 实现的地图浏览作为程序主界面左上角显示
Qt问题:通过QGraphicsView实现的地图浏览作为程序主界面左上角显示Qt新手请教问题:我在网上下载了一个基于QGraphicsView的地图浏览程序。通过Cla...
Qt问题:通过QGraphicsView 实现的地图浏览作为程序主界面左上角显示Qt新手请教问题:我在网上下载了一个基于QGraphicsView的地图浏览程序。通过Class MapWidget:public QGraphicsView 类实现的。请问怎么把这个地图浏览作为我程序主界面左上角显示,右侧下侧显示我的按钮。谢谢
展开
1个回答
展开全部
可以使用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.
微测检测5.10
2023-05-10 广告
2023-05-10 广告
您好!建议咨 深圳市微测检测有限公司,已建立起十余个专业实验室,企业通过微测检测就可以获得一站式的测试与认 证解决方案;(EMC、RF、MFi、BQB、QI、USB、安全、锂电池、快充、汽车电子EMC、汽车手机互 联、语音通话质量),认证遇...
点击进入详情页
本回答由微测检测5.10提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询