I believe that, with version 4, Qt is available under a free software license on all platforms, including Windows. - Yes, it is, but it'll take some time till pyQt4 will be available (and it'll start with Qt 4.1 support, 4.0 isn't planned). See Pyqt homepage. Qt is GPL, as is PyQt, as will be your app if you use it (and plan to actually distribute it ;-)). If you don't want to go GPL, you can buy commercial licenses for Qt and PyQt.

With Qt 3, you can develop under linux and your program will run on windows too, so you won't need Qt3 for Win, only your users; there are free and cheap versions of Qt3 for Windows, but I never went there.

I've used wxPy a lot (several medium-to-large programs), and PyQt only a little (one program, 500 lines), but these are my initial impressions:

All this applies to PyQt 3.x I don't want to be anti-Qt, so if anything here is incorrect or misleading, please add a note!

Also, since I've been using wxPy for a while, I surely did things using a wxPy approach, and missed out completely on some things that PyQt does better. PyQt programmers, please enlighten me. :-)

I (TRauMa) used pyQt and it's some time since I ventured into wx, but now, with missing Qt4 support (see above) I think I'll give wx another shot. So here's my 0.02€:

Prehaps I'll post here when I made some progress with wx, and tell you what you it did to me ;-).

NB: I'm no expert in both toolkits, my GUI's tend to be easy containers for OpenGL apps. I'm writing an application with multiple interfaces (Qt so far, wx comming now), and that keeps me from using to much from the special dishes both toolkits serve. Caveat emptor.

I have been experimenting with PyQt4 and wxPython for a few (albeit relatively small) projects recently and I found this page with it's comparison but noticed that it was a long way out of date and hence cast PyQt in an inaccurately unfavourable light. I therefore thought it was worth updating it with a few comments. Note that I use both wxPython and PyQt4, but I probably prefer PyQt4 for my purposes, so bear in mind that this is a bit biased the other way.

   1 # wxpython
   2 import wx
   3 import wx.lib.newevent
   5 MyNewEvent, EVT_MYNEWEVENT = wx.lib.newevent.NewEvent()
   7 class MyClass():
   8     def __init__(self, parent):
   9         self.parent = parent
  11     def DoStuff(self):
  12         event = MyNewEvent(result={'Data': [0,1,2]})
  13         wx.PostEvent(self.parent.GetEventHandler(), event)
  15 class ParentClass(wx.Window):
  16     def __init__(self):
  17         self.instance = MyClass(self)
  18         self.Bind(EVT_MYNEWEVENT, self.OnEvent, self.instance)
  19         self.instance.DoStuff()
  21     def OnEvent(self, event):
  22         DoSomething(event.result)

   1 from PyQt4 import QtCore, QtGui
   3 class MyClass():
   4     MyNewEvent = QtCore.pyqtSignal(dict)
   6     def __init__(self, parent):
   7         pass
   9     def DoStuff():
  10         self.MyNewEvent.emit({'Data': [0,1,2]})
  12 class ParentClass(QtGui.QMainWindow):
  13     def __init__(self):
  14         self.instance = MyClass(self)
  15         self.instance.MyNewEvent.connect(self.OnEvent)
  17     def OnEvent(self, data):
  18         DoSomething(data)

I'd be very interested in an updated view from someone more experienced with wxpython as I realised this is biased towards PyQt4. At the moment, I use wxpython when I need to do tools that can't be open source and PyQt4 for everything else. When PySide reaches revision 1, I expect to use PySide all the time.

ComparingWxPythonAndPyQt (last edited 2010-09-01 13:41:37 by c-98-246-90-205)

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.