Dugan Chen's Homepage

Various Things

A PyQt implementation of JQuery’s Promises and Deferreds

I tried to implement jQuery’s Promises and Deferreds in PyQt. I was moderately successful. The use case here is chaining QNetworkAccessManager calls. When you have the name of an artist, it takes two calls to fetch the artist’s photo from last.fm. The first call fetches a reply that has the image URL. The second call […]

PyQt Implementation of MSDN’s MVP Example

I had a look at Microsoft’s Model View Presenter example, and I couldn’t resist blogging a PyQt version. For the PyQt version, we’ll have a dropdown list of music artists. When one artist is selected, its bio is retrieved from Last.FM and loaded into the UI. I only loosely skimmed the article and its source […]

MVP with PyQt. With a Model layer.

Some of the peer feedback I received on my MVP for Qt (PyQt and PySide) made good points. Pushing all the complexity to a single monolithic Presenter class simply moves the problem; you still have to subdivide that complexity, or the Presenter will be huge. Furthermore, if you have a tabbed layout, there are benefits […]