马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
代码如下:from PySide6.QtWidgets import QApplication,QMainWindow,QWidget
from PySide6.QtWebEngineWidgets import QWebEngineView
from web import Ui_Form
class MyWindow(QWidget,Ui_Form):
def __init__(self):
super().__init__()
self.ui=Ui_Form()
self.ui.setupUi(self)
self.ui.webview.load('wwwbaiducom/')#这里不能发完整URL
if __name__=='__main__':
app=QApplication([])
window=MyWindow()
window.show()
app.exec()
报错如下:Traceback (most recent call last):
File "C:\Users\Pixel\Desktop\文档\pythonlearn\pyqt-test1.py", line 13, in <module>
window=MyWindow()
File "C:\Users\Pixel\Desktop\文档\pythonlearn\pyqt-test1.py", line 9, in __init__
self.ui.webview.load('wwwbaiducom/')
AttributeError: 'Ui_Form' object has no attribute 'webview'
|