QGraphicsView fitInView边距 [英] QGraphicsView fitInView margins

查看:2280
本文介绍了QGraphicsView fitInView边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么:

graphics_view->fitInView(scene->sceneRect(), Qt::KeepAspectRatio);

无法正常工作?

推荐答案

我想出了问题是什么,它是请参阅此问题。这个问题的主要原因是你不应该在显示表单之前调用fitInView。

I figured out what the problem was, it is described in this question. The main cause of the problem is that you shouldn't call fitInView before the form is shown.

这篇关于QGraphicsView fitInView边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆