I have an application whose GUI is to be remade for ergonomic reasons. It was written in PyGTK and I am wondering if I should switch to PyQt to ease future developments or not.
This application has a mostly classical UI with buttons, toolbars, dialogs etc. but also has some specific requirements : I will certainly need to create a custom widget based on treeview/tableview (to make a spreadsheet-like widget) and this application has a lot of worker threads which update the GUI.
I am seeking advice on these two points :
PyQt is widely used for creating large-scale GUI-based programs. It gives programmers the freedom to create GUIs of their choice while also providing a lot of good pre-built designs. PyQT gives you widgets to create complex GUIs.
No, you must buy a PyQt commercial license for commercial use. A possible alternative is to switch to PySide2, also known as Qt for Python. This comes from the same company as Qt itself, and is licensed under GPL/LGPL/Commercial, also the same as Qt itself. The differences between PyQt and Pyside2 are minor.
You can purchase the commercial version of PyQt here. More information about licensing can be found in the License FAQ. PyQt does not include a copy of Qt. You must obtain a correctly licensed copy of Qt yourself.
I can't compare, because I don't use GTK, but I'd suggest Qt.
Qt definitely has "treeview/tableview" you're talking about and you can make the "cells" your custom widgets (I'm just studying this topic right now). Qt was made with a lot of thought about threads, so worker threads can use the signal/slot mechanism with ease. And yes, you can modify the existing widgets by applying stylesheets or subclassing.
Now about PyQt, I wouldn't recommend it because of licensing issues. PySide seems like a better Qt→Python binding to me: it can be used in commercial applications freely and has a few tiny advantages in the API (but otherwise it's fully compatible with PyQt).
Qt is cross-platform and deployment of PySide applications is very easy with cx_Freeze; users of your application won't have to install anything at all.
I also have no experience with GTK, but can offer some answers nevertheless:
Qt is designed from the ground up to be object-oriented; almost everything in it has excellent support for subclassing. PyQt likewise.
Qt explicitly does NOT support modification of the GUI by any threads other than the main GUI thread. You're likely to cause crashes this way. As BlaXpirit mentioned, though, there are a variety of very easy inter-thread communication mechanisms such as signal passing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With