netsnake ·
·
阅读: 743
这样应该可以解决
class GWebPage(QtWebKit.QWebPage):
def __init__(self, *args):
super(self.__class__,self).__init__(*args)
def acceptNavigationRequest(self, frame, request, type):
#frame is not null, then will be a new window
return QtWebKit.QWebPage.acceptNavigationRequest(self,frame, request, type)
///application code as following
self.webKit = QtWebKit.QWebView()
page = GWebPage(self.webKit)
self.webKit.setPage(page)