In my example, there is an event loop, and it still gets a zero-length file. I've modified Russel's example to have an event loop, and it still exhibits the same behavior.<br><br><div class="gmail_quote">On Mon, Mar 15, 2010 at 13:09, 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;">On Mon, 15 Mar 2010 12:57:27 -0500, David Bronke <<a href="mailto:whitelynx@gmail.com">whitelynx@gmail.com</a>><br>
wrote:<br>
<div class="im">> Well, according to the Qt docs, the << and >> operators for QWebHistory<br>
> were<br>
> added in Qt 4.6, which would explain why it's just giving you<br>
> NotImplemented<br>
> under Qt 4.5.3... I'm not seeing that output here, though, and I'm still<br>
> getting a zero-length file. (with your test script as well)<br>
<br>
<br>
</div>Which is what you would expect - you don't have an event loop running.<br>
<font color="#888888"><br>
Phil<br>
</font><div><div></div><div class="h5"><br>
> On Mon, Mar 15, 2010 at 12:39, Russell Valentine<br>
> <<a href="mailto:russ@coldstonelabs.org">russ@coldstonelabs.org</a>>wrote:<br>
><br>
>> Looks like your on to something unless I did something wrong as well. I<br>
>> wrote a little simple case. Using .__lshift__ instead of "<<" just made<br>
>> it<br>
>> not have an exception but it shows as "NotImplemented" in the console.<br>
>><br>
>> Qt: 4.5.3<br>
>> PyQt4: 4.7<br>
>> Python: 2.6.4<br>
>> =================<br>
>><br>
>> from PyQt4 import QtCore, QtGui, QtWebKit<br>
>> import sys<br>
>><br>
>> app = QtGui.QApplication(sys.argv)<br>
>><br>
>> f=QtCore.QFile("history.file")<br>
>> d=QtCore.QDataStream(f)<br>
>> page=QtWebKit.QWebPage()<br>
>> page.mainFrame().load(QtCore.QUrl("<a href="http://python.org" target="_blank">http://python.org</a>"))<br>
>><br>
>> d.__lshift__(page.history())<br>
>><br>
>><br>
>><br>
>><br>
>> David Bronke wrote:<br>
>><br>
>>> Sorry, I spoke to soon. Using out.__lshift__(view.page().history())<br>
>>> yeilds<br>
>>> a<br>
>>> zero-length file. Attached is another somewhat minimal test case; it<br>
>>> loads<br>
>>> google, wikipedia, and CNN one after the other, and when CNN is loaded,<br>
>>> it<br>
>>> saves the web view's history to a file and checks the file's length. On<br>
>>> my<br>
>>> machine, this invariably comes out to 0 bytes.<br>
>>><br>
>>> Qt version: 4.6.1<br>
>>> PyQt4 version: 4.7.1-snapshot-20100120 (I couldn't get anything but the<br>
>>> snapshot to install correctly)<br>
>>> Python version: 2.6.4<br>
>>> OS: Arch Linux<br>
>>><br>
>>> Should I update to the latest snapshot and see if that fixes anything?<br>
>>><br>
>><br>
>><br>
</div></div></blockquote></div><br>