Earlier quoted context omitted.
Really good? Platform-native APIs.
Agreed, but you can use those from Python, through pywin32 and (for a few rare things that are missing in the former) ctypes. (If you're on Windows. On Linux, Qt could be considered native. On Mac there is PyObjC. )
PyQt5 Tutorial: Create a Python GUI in 2018
171–180 of 211 posts
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#172Earlier quoted context omitted.
I don't consider connecting signals in xml (via designer) better than connecting them in code. The line is still there, just in different place.
But the UI changes very rarely, and it’s out of the way most of the time; whereas the class method is always in the way in parts of code that could see a lot of day-to-day activity, migrations (py3...) and so on.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#173We use Qt heavily at Starsky Robotics. We initially used it because it has tight integration with ROS via RQT [1], but I'm pretty impressed with the framework in general. Lots of great tools out of the box, QtCreator is awesome and once you get the right signal/slot model in your head everything is a breeze. Plus getting to prototyping in python is always fast! For our use case, relative speed of the GUI isn't a fact…
Felt exactly like making a RQT plugin.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#174Earlier quoted context omitted.
Agreed, but you can use those from Python, through pywin32 and (for a few rare things that are missing in the former) ctypes. (If you're on Windows. On Linux, Qt could be considered native. On Mac there is PyObjC. )
Pywin32 to call native apis for GUIs sounds very, very painful. I had a few run-ins with pywin32 and COM automation, I don’t think I could bear the thought of developing a full UI with that sort of hacks. At that point, might as well go C# (or IronPython, if it’s still around) and enjoy the VS goodies.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#175Re: PyQt5 Tutorial: Create a Python GUI in 2018
#176Earlier quoted context omitted.
The API still looks messy and unpythonic though, sadly. Look at the basic hello world example. Why do I need to pass QApplication an empty array? Why am I calling a method ending with _ to launch the program? And the fact the label magically attaches to the app through some side effect is also confusing. Does anyone know if there's any good shim/wrapper around PyQt that has a better API?
Maybe it's not pythonic but I can assure you, after having passed 6 years working with it that it's extremely efficient and very well integrated with python. It just works, and a complaint about aesthetics won't change that :-)
Having used much worse Python bindings for other C++ libraries, the degree to which PyQt just works without blowing up in your face is itself pretty astonishing. Add to that the maturity and depth of the Qt Widget library, and the result is a real pleasure to use.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#177The Linux side was surprisingly painless, but getting the Windows side going was a nightmare; none of the traditional options for creating a standalone Windows executable actually worked, and I ended up resorting to installing MSYS2 on every machine, then packaging the app for MSYS2 (and pulling in all of Qt5 as a dependency, meaning that it takes up multiple gigabytes of space for what should be a pretty simple desktop app).
I didn't know about fbs. I'm gonna try it out tonight. The fact that it seems to require resulting apps to be under the GPL is unfortunate, but that's already the case for PyQt5, so whatever.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#178Earlier quoted context omitted.
The API still looks messy and unpythonic though, sadly. Look at the basic hello world example. Why do I need to pass QApplication an empty array? Why am I calling a method ending with _ to launch the program? And the fact the label magically attaches to the app through some side effect is also confusing. Does anyone know if there's any good shim/wrapper around PyQt that has a better API?
Maybe it's not pythonic but I can assure you, after having passed 6 years working with it that it's extremely efficient and very well integrated with python. It just works, and a complaint about aesthetics won't change that :-)
Knowing some of my coworkers, though (who use Python daily), I can understand why it'd be jarring.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#179Just to note, there are official [1] Python bindings available for Qt and this can usually be installed with `pip install pyside2` . [1] https://www.qt.io/qt-for-python