2

I've been working on a my first real project using PyQt lately. I've done just a little bit of work in Qt for C++ but nothing more than just messing around. I've found that the Qt python bindings are essentially just a straight port of C++ classes into python, which makes sense. The issue is that this creates a lot of messy, unpythonic code.

For example if you look at QAbstractItemModel, there's a lot of hoops you have to go through that forces you to hide the actual python.

I was just wondering if there's any intention of writing a python implementation of Qt that isn't necessarily just a wrapper? Either by Nokia or anyone else? I really like Qt but I would love to be able to write more pythonic code.

I hope this is OK to ask here. I'm not trying to start a GUI war or anything.

Falmarri
  • 297
  • QAbstractItemModel was really annoying, when I was using PyQt. I tried to stick QTableWidget, QTreeWidget etc., rather than QTableView, QTreeView, etc. and be forced to create my own model (unless I could just use some built in, like QFileSystemModel). – gruszczy Jan 01 '11 at 04:07
  • Hmmm. Good point. I didn't think of that – Falmarri Jan 01 '11 at 22:51

2 Answers2

3

Take a look at PySide, Nokia's Python bindings for the QT framework. I can't give you a decent comparison (I only looked into it earlier this year, and opted for PyQt instead due to its maturity), but it looked promising.

bedwyr
  • 2,212
1

I agree with your assessment of working with PyQt - Qt is an awesome framework but PyQt is clearly 'unpythonic' in many respects.

As for PySide, my understanding is that PySide is pretty much a clone of PyQt but entirely OpenSource LPG etc - no licensing fees at all. See http://www.qtrac.eu/pyqtbook.html#pyside - Mark Summerfield's site: "PySide is highly compatible with PyQt...."

BUT - using P3k and the latest PyQt package, things have gotten quite a bit more 'pythonic' - some of the Qt classes have been wrapped into generic python types, among them QString. You didn't mention what version of Python or Qt you're working with -try the latest and greatest and maybe you'll feel more comfortable.

HTH

Vector
  • 3,180
  • 3
  • 22
  • 25