QWebView:拉伸以填充屏幕尺寸?

发布于 2024-10-07 08:16:25 字数 133 浏览 0 评论 0原文

我是 QT 移动开发的新手,正在尝试研究如何拉伸 QWebView 以填充整个用户屏幕。我找到了 showFullScreen() 方法,但它似乎没有做任何事情。

有人可以建议这是否可能吗?

谢谢,

马克

I'm new to QT mobile development and am trying to work out how to stretch a QWebView to fill the entire user screen. I found the showFullScreen() method but it doesn't seem to do anything.

Can anybody advise if this is possible?

Thanks,

Mark

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

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

发布评论

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

评论(3

小鸟爱天空丶 2024-10-14 08:16:26

我的答案是mrmcduff的补充,请尝试下面的方法:

void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)

将两个参数都设置为QSizepolicy::Expanding,写一个demo来测试一下,对Qt布局应该很有用,至少我是这么认为的。

My answer is the supplement of mrmcduff, please try the below method:

void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)

set both of the parameters to be QSizepolicy::Expanding, write a demo to test and view it, it should be very useful to Qt layout, at least I think so.

朱染 2024-10-14 08:16:26

您需要将 QWebView 对象放入布局中。对于使用 qt 的任何类型的 UI 实现,了解布局管理都很重要。
以下链接可以帮助您:

http://doc.qt.io/qt-5 /layout.html

http://doc.qt.io/qt -5/designer-layouts.html

You need to put QWebView object in the layout. For any kind of UI implementation using qt it is important to understand layout management.
Following links can help you in that:

http://doc.qt.io/qt-5/layout.html

http://doc.qt.io/qt-5/designer-layouts.html

独自唱情﹋歌 2024-10-14 08:16:26

确保 QWebView 所在的布局具有 0 边距。您可能想验证您是否意外地在 QWebView 中添加了填充或边距。您还需要将尺寸策略设置为拉伸。

您使用的是哪个版本的 Qt?

Be sure the layout you've got the QWebView in has 0 margin. You may want to verify that you're not accidentally adding padding or margin inside QWebView. You also want to set your size policy to stretch.

Which version of Qt are you using?

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