PyQT4 QWebView 无法正确调整大小

发布于 2024-09-03 16:09:54 字数 94 浏览 2 评论 0原文

我有一个网格布局中的 QWebview 以及其他小部件。当用户调整窗口大小时,QWebview 不会调整大小,但其他小部件会调整大小。如何使 QWebview 正确调整大小?

I have a QWebview in a grid layout, along with other widgets. When the user resizes the window, the QWebview doesn't resize, but the other widgets do. How can I make the QWebview resize correctly?

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

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

发布评论

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

评论(2

初见终念 2024-09-10 16:09:54

您很可能没有使用正确的 sizePolicy。看看这里 http://doc.qt.nokia.com/4.6/layout。 使用其他小部件

代替 QWebView 会改变什么吗?

Most likely you're not using correct sizePolicy. Take a look here http://doc.qt.nokia.com/4.6/layout.html

Does using other widget in place of QWebView change anything?

黯淡〆 2024-09-10 16:09:54

在对话框类的 resizeEvent 中,它扩展了 QDialog,调用 webView->setGeometry,以及 this->resize、this->update。

提示:检查大小是否通过 QResizeEvent *ptr 更改

in the dialog class's resizeEvent, one that extends QDialog, call webView->setGeometry, and this->resize, this->update.

hint: check if size changed via the QResizeEvent *ptr

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