我有Qtabwiget每次加载另一个标签时,它都会加载一个Qtwebengineview类的实例。我需要的是当qtwebengine的每个实例完成加载它改变它的父选项卡而不是我改变当前打开的选项卡。这是代码:
class Ui_MainWindow(QMainWindow):
def setupUi(self, MainWindow):
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
self.tabWidget.setGeometry(QtCore.QRect(0, 75, self.sizeObject.width(), self.sizeObject.height() - 120))
self.tabWidget.setObjectName("tabWidget")
def loadFinished(self, ok):
self.progressBar.hide()
>>>I want here to be able to change parent qtabwidget text to the title of the qtwebengineview child<<<
class HtmlView(QWebEngineView):
def __init__(self, parent):
super(HtmlView, self).__init__(parent)
self.parent = parent
self.loadFinished.connect(self.parent.loadFinished)