I had already done those 2 changes in my version of his script; I've attached my modified version. With this version, I still get a zero-length file.<div><br></div><div><br><br><div class="gmail_quote">On Mon, Mar 15, 2010 at 13:48, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Mon, 15 Mar 2010 13:24:21 -0500, Russell Valentine<br>
<<a href="mailto:russ@coldstonelabs.org">russ@coldstonelabs.org</a>> wrote:<br>
> Yes, my fault. How about this one:<br>
> It will be a while before I can try it. In the process up upgrading to<br>
> Qt4.6<br>
> ===========<br>
><br>
> from PyQt4 import QtCore, QtGui, QtWebKit<br>
> import sys<br>
><br>
><br>
> class MainWindow(QtGui.QMainWindow):<br>
> def __init__(self):<br>
> super(QtGui.QMainWindow, self).__init__()<br>
> self.webview=QtWebKit.QWebView()<br>
> self.setCentralWidget(self.webview)<br>
> def go(self):<br>
> self.webview.load(QtCore.QUrl("<a href="http://python.org" target="_blank">http://python.org</a>"))<br>
> f=QtCore.QFile("history.file")<br>
<br>
</div> f.open(QtCore.QIODevice.WriteOnly)<br>
<div class="im"><br>
> d=QtCore.QDataStream(f)<br>
> d << (self.webview.history())<br>
><br>
><br>
><br>
> if __name__ == "__main__":<br>
> app = QtGui.QApplication(sys.argv)<br>
> window = MainWindow()<br>
> window.show()<br>
> QtCore.QTimer.singleShot(1000, window.go)<br>
> sys.exit(app.exec_())<br>
<br>
</div>With this I get a 12 byte file - not an empty file.<br>
<br>
The history isn't updated until the load is finished. If you connect the<br>
loadFinished() signal to a slot that writes the history I get a 254 byte<br>
file.<br>
<font color="#888888"><br>
Phil<br>
</font></blockquote></div><br></div>