QWebView加载时崩溃

2024-10-06 07:13:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用Maya内部的PySide2创建一个小部件,其中QWebView加载谷歌网站在它的showEvent上。你知道吗

在Maya之外,我可以作为一个独立的工具毫无问题地运行它,但是在Maya内部,当我使用它的load方法时,它会立即崩溃。这很奇怪,因为当Maya崩溃时,我确实看到google成功地加载到了我的widget中。你知道吗

我正在Centos 7上使用Maya 2018 extension 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

Tags: appsselfmainlibx86parentpyside2maya