在 Qt 中调整图像大小以适合窗口

发布于 2024-10-02 15:33:11 字数 137 浏览 1 评论 0原文

我正在使用 Qt 构建一个应用程序。我的主窗口由地图图像组成,我希望调整其大小以适合窗口。这意味着当窗口变小时,图像也会变小,反之亦然。当用户选择该图像上的一个点时,我想删除此功能。我是 Qt 新手,还没能弄清楚这一点。我为此使用 QGraphicsView。

I am using Qt to construct an application. My MainWindow consists of an image of a map which I would like to be resized to the fit the window. This means when the window gets smaller the image gets smaller and vice versa. When the user selects a point on that image I want to remove this feature. I am new to Qt and haven't been able to figure this out. I am using QGraphicsView for this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你又不是我 2024-10-09 15:33:11

QGraphicsView::fitInView

QGraphicsView::fitInView

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文