私はこれに似たコードを持っています:
class A(QWebView):
def __init__(self):
# some code here
# in here I want to check what url is loaded and based on that assign appropriate SLOT
# I was wondering how to do something like that:
# if 'examle.html' in self.url():
# self.loadFinished.connect(self.example)
# else:
# self.loadFinished.connect(self.anotherSLOT)
if __name__ == '__main__':
app = QApplication(sys.argv)
br = A()
br.load(QUrl('http://example')
br.show()
app.exec_()
完全に間違っているような気がします。理想的には、両方のURLをロードして適切なスロットに接続したいのですが、今のところ、このような解決策しか思いつきません。