python - 加载 url 时 QWebView 崩溃
问题描述
我正在使用PySide2
Maya 内部来创建一个小部件,该小部件QWebView
将 google.com 加载到其showEvent
.
我可以在 Maya 作为独立工具之外毫无问题地运行它,但是在 Maya 内部,当我使用它的load
方法时它会立即崩溃。这很奇怪,因为当 Maya 崩溃时,我确实看到 google 已成功加载到我的小部件中。
我在 Centos 7 上使用 Maya 2018 扩展 4。有人可以确认这在你的机器上也崩溃了吗?
这是我正在运行的脚本,每次都会为我崩溃:
from PySide2 import QtWidgets
from PySide2 import QtWebKitWidgets
class BrowserTool(QtWidgets.QWidget):
def __init__(self, parent=None):
super(BrowserTool, self).__init__(parent)
self.resize(800, 800)
self.web_view = QtWebKitWidgets.QWebView(parent=self)
self.main_layout = QtWidgets.QVBoxLayout()
self.main_layout.addWidget(self.web_view)
self.setLayout(self.main_layout)
def showEvent(self, event):
self.web_view.load("http://www.google.com")
tool = BrowserTool()
tool.show()
以下是 Maya 从其崩溃文件中吐出的内容:
//====================================================
//command history (most recent last):
//====================================================
//last tool: nurbsSelect
//====================================================
//panel with focus: scriptEditorPanel1
//visible panels:
// modelPanel4 outlinerPanel1 scriptEditorPanel1
//====================================================
/lib64/libc.so.6(+0x1617dc) [0x7f33f10707dc]
OBJ_bsearch_ex
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libcrypto.so.6(+0x7e125) [0x7f334111b125]
X509_OBJECT_retrieve_match
X509_STORE_add_cert
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Network.so.5(+0xfd5dc) [0x7f33e4ddc5dc]
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Network.so.5(+0x100d9a) [0x7f33e4ddfd9a]
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Network.so.5(+0x103512) [0x7f33e4de2512]
QSslSocket::startClientEncryption()
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Network.so.5(+0xeddb0) [0x7f33e4dccdb0]
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Network.so.5(+0xf56d9) [0x7f33e4dd46d9]
QMetaObject::activate(QObject*, int, int, void**)
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Network.so.5(+0xcea6b) [0x7f33e4dada6b]
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Network.so.5(+0xd0b98) [0x7f33e4dafb98]
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Network.so.5(+0xd9165) [0x7f33e4db8165]
QApplicationPrivate::notify_helper(QObject*, QEvent*)
QApplication::notify(QObject*, QEvent*)
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libExtensionLayer.so(+0x1edc3c) [0x7f3400af0c3c]
QCoreApplication::notifyInternal2(QObject*, QEvent*)
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Core.so.5(+0x2c3bfe) [0x7f33f6489bfe]
g_main_context_dispatch
/lib64/libglib-2.0.so.0(+0x4a818) [0x7f33dc8b1818]
g_main_context_iteration
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
QThread::exec()
/Volumes/apps/x86_64/maya/2018_EXT4/lib/libQt5Core.so.5(+0xaa9d3) [0x7f33f62709d3]
/lib64/libpthread.so.0(+0x7e25) [0x7f33f12d9e25]
clone
解决方案
推荐阅读
- networking - ZeroMQ:如何实现客户端通知?
- javascript - 将值分配给动态更改其 id 的输入字段
- qt - 从节点属性读取数据类型
- excel - 使用 CountIfs 检查单元格是否有日期或为空
- python - 将文件路径传输到另一个类并将项目添加到列表
- delphi - 为什么在抑制 WM_PASTE 后数据集的状态会更改为 dsEdit?
- reactjs - 使用 catch 在 redux-saga 中进行 Rest API axios 错误处理
- r - 将值与列名组合为新列
- java - 处理大量输入数据时出现 StackOverflow 错误
- vba - 基于模板的电子邮件中丢失的 HTML 格式