[PyQt] QGraphicsWebView -> QGLContext::makeCurrent(): Cannot make invalid context current.

2012-10-10 Thread Doogster
The attached program runs fine. However, on every machine I've tried it on, it prints several dozen warning lines when closed: QGLContext::makeCurrent(): Cannot make invalid context current. QGLContext::makeCurrent(): Cannot make invalid context current. QGLContext::makeCurrent(): Cannot make inva

[PyQt] QHttpMultiPart impossible to use

2012-06-19 Thread Doogster
How does one use PyQt's QHttpMultiPart and QHttpPart classes? On both Arch Linux (PyQt 4.9) and Windows (4.8.1, I believe), the attached code sample segfaults the Python interpreter. While Qt's QNetworkAccessManager::post() method is overloaded to take a pointer to a QHttpMultiPart, PyQt's QNetwo

Re: [PyQt] Last.fm call fails with QNetworkAccessManager

2012-01-07 Thread Doogster
Of course, I figured it out just half an hour after giving up and asking for help. The problem was that the URL was percent-encoded, so I needed use QUrl.fromEncoded(url_string) and not QUrl(url_string). On Sat, Jan 7, 2012 at 2:09 PM, Doogster wrote: > Could you please tell me why a

[PyQt] Last.fm call fails with QNetworkAccessManager

2012-01-07 Thread Doogster
Could you please tell me why a GET request to a last.fm web service URL returns a different result whether I call it from a browser or from a QNetworkAccessManager? A specific example would be the following URL: http://ws.audioscrobbler.com/2.0/?album=American+IV%3A+The+Man+Comes+Around&format=js

[PyQt] QTreeView Drop Target: Between Rows, Column 1

2009-11-11 Thread Doogster
How do I set the drop target in my QTreeView to be between any row in Column 1? To set the drop target to be between rows, I have flags return ItemIsDropEnabled if the index is invalid. However, an invalid index has both the row and column set to -1. That prevents me from narrowing the drop target

Re: [PyQt] Unicode characters in QTreeView

2009-09-09 Thread Doogster
> What kind of datatype does python-mpd extract? Is it 8-bit str or > unicode? If it's 8-bit str, you need to decode it properly before > passing it to Qt. Your advice worked. Returning QtCore.QVariant(var.decode("utf-8")) in the model for the display role instead of just QtCore.QVariant(var) did

[PyQt] Unicode characters in QTreeView

2009-09-09 Thread Doogster
Japanese characters aren't displaying properly in my QTreeView. What should I do? Here's a screenshot (the bottom line should be in Japanese). http://img.photobucket.com/albums/v298/dugan-c/unicode-error.jpg This is an MPD client and the rows are id3 tags. The line in question does display prope