I am loading an url of a website that allows me to create some data and save it to a database to my QWebView. At first I could save the data but couldn't open the pop-up windows. So I reimplemented QWebView.createWindow() method. Now I am able open the pop-up windows. But after opening a pop-up my webview loses its ability to save data to the database. After I push the save button it doesn't load or reload. What am I doing wrong? Here is my code:
class MyWebView(QWebView):
def __init__(self):
QWebView.__init__(self)
self.page().windowCloseRequested.connect(self.closeWindow)
self.page().settings().setAttribute(QWebSettings.JavaEnabled, True)
self.page().settings().setAttribute(QWebSettings.JavascriptEnabled, True)
self.page().settings().setAttribute(QWebSettings.JavascriptCanOpenWindows, True)
self.page().settings().setAttribute(QWebSettings.JavascriptCanCloseWindows, True)
self.page().settings().setAttribute(QWebSettings.JavascriptCanAccessClipboard, True)
def createWindow(self, webType):
self.webview = MyWebView()
if webType == QWebPage.WebModalDialog:
self.webview.setWindowModality(Qt.ApplicationModal)
return self.webview
def closeWindow(self):
self.close()