我正在尝试创建QWebEngineView的打印预览,但无法使其工作。你知道吗
这是我的密码:
...
self.view = QWebEngineView()
...
def handle_preview(self):
dialog = QPrintPreviewDialog()
dialog.paintRequested.connect(self.view.print_)
dialog.exec_()
代码告诉我这个错误:
AttributeError:“QWebEngineView”对象没有“print”属性
当我使用QTextEdit时,代码运行得非常好。但那不是我想要的。我想用QWebEngineView。你知道吗
根据官方示例:WebEngine Widgets PrintMe Example可以使用以下代码实现预览。你知道吗
相关问题 更多 >
编程相关推荐