Quantcast
Channel: Qt DevNet forums: Qt WebKit
Viewing all articles
Browse latest Browse all 542

QWebPage chooseFile function override problem

$
0
0
Hi all, I am trying to upload a file programmatically to an input type file. My goal is to press the choose file button on a website and instead of seeing the dialog insert a file with software. I understand that I have to implement the function chooseFile myself or override it in a custom WebPage class. I am using python API, and I really dont know how to do that, please help ! my browser application class looks like this: class Browser(QApplication):   def __init__(self):     super(Browser, self).__init__(None)     self.webView = QWebView()     self.webView.showMaximized()     self.webView.loadFinished.connect(self.loadFinished)     self.documentElement = self.webView.page().currentFrame().documentElement()     def load(self, url):     self.log.add("Loading page " + url)     self.prepareLoad()     self.webView.load(QUrl(url))     def upload(self):     self.webView.load(QUrl(someurl))     self.documentElement = self.webView.page().currentFrame().documentElement() does anyone know how to continue the upload method ?

Viewing all articles
Browse latest Browse all 542

Trending Articles