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.



On Mon, Mar 15, 2010 at 13:48, Phil Thompson <[email protected]>wrote:

> On Mon, 15 Mar 2010 13:24:21 -0500, Russell Valentine
> <[email protected]> wrote:
> > Yes, my fault. How about this one:
> > It will be a while before I can try it. In the process up upgrading to
> > Qt4.6
> > ===========
> >
> > from PyQt4 import QtCore, QtGui, QtWebKit
> > import sys
> >
> >
> > class MainWindow(QtGui.QMainWindow):
> >      def __init__(self):
> >          super(QtGui.QMainWindow, self).__init__()
> >          self.webview=QtWebKit.QWebView()
> >          self.setCentralWidget(self.webview)
> >      def go(self):
> >          self.webview.load(QtCore.QUrl("http://python.org";))
> >          f=QtCore.QFile("history.file")
>
>            f.open(QtCore.QIODevice.WriteOnly)
>
> >          d=QtCore.QDataStream(f)
> >          d << (self.webview.history())
> >
> >
> >
> > if __name__ == "__main__":
> >      app = QtGui.QApplication(sys.argv)
> >      window = MainWindow()
> >      window.show()
> >      QtCore.QTimer.singleShot(1000, window.go)
> >      sys.exit(app.exec_())
>
> With this I get a 12 byte file - not an empty file.
>
> The history isn't updated until the load is finished. If you connect the
> loadFinished() signal to a slot that writes the history I get a 254 byte
> file.
>
> Phil
>

Attachment: qwebhistory-test.py
Description: Binary data

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to