I like the tutorial, but I don't know why you would use PyQt these days. Tkinter is more permissive and has wrappers like appJar which make it disgustingly easy to put together a quick, ugly GUI. If you're building a desktop app that needs to really look good and be fast, why are you using Python?
I've only been a Python dev, and have ended up becoming entrenched in Tkinter. I want to be able to just use another GUI framework for when I finally switch to something else. So, I can see the use.
PyQt5 Tutorial: Create a Python GUI in 2018
121–130 of 211 posts
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#122Just 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
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#123I've been using wxPython for many years, and it works very well. What are the advantages of PyQT over wxPython? Anyone experienced both 'worlds' in a non-trivial application?
1. wxPython has inconsistent looks and layouts between platforms and monitor resolutions (or DPI). For example, on PlayOnLinux GUI app I cannot click an "OK" button while using Surface Pro because the button is hidden outside of the window. 2. QML is an amazing language. It is modern, declarative and reactive but still very simple to use. Personally I don't want to go back to the traditional GUI coding styles after e…
To join in this comment thread's Electron-ragging, I often find it frustrating that the hard-won OS idioms of the last 20 years have been left so easy to jettison in the age of apps.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#124Earlier quoted context omitted.
I can't speak for fbs (never used it), but the way these things usually work (pyinstaller et al ) is by compiling everything to .pyc or .pyd and/or pack it up with the python runtime in an executable. It's probably not too hard to extract the original source, but it would be enough to deter a casual observer. The problems with packaging PyQt usually boil down to module discovery, because the import machinery is lever…
Ok, thanks for the info! Yeah the pyinstaller, etc. experiences I've had were trivial to decompile from pyc back to py so for "hide the source" we found that Cython takes it to the next level. I wonder what fbs does in this case that handles the PyQt import stuff so well.
Do you use any particular lib for your cythonization, or is it all custom ?
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#125Earlier quoted context omitted.
If you use the complete Qt installer, you get QtDesigner. If you use the PyQT-provided wheels and/or you don'want to mess with the whole Qt, then you can separately install QtCreator, which is very simple and embeds QtDesigner.
Looking at a tutorial, it looks like all it does is layout the form for you. That's a shame. Things closer to what the original VB was are sorely missed in modern computing.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#126Re: PyQt5 Tutorial: Create a Python GUI in 2018
#127Is there a GoQt5 being worked on anywhere?
https://github.com/kitech/qt.go
https://github.com/therecipe/qt
Both seem to be in active development. Does anybody have experience with either?
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#128I'm using PyQt for a project right now, and overall it's a nice feeling as always. The model/view classes are great, once you get the hang of them. There are a lot of utilities for things like persistence and threading (but I wouldn't cross the streams with python threads), and it's all crossplatform and very mature by now, the only issues are usually around packaging. QML is also very powerful, but I'm usually happy…
> (but I wouldn't cross the streams with python threads) You can't. Also keep in mind that Python's thread-local storage only works with the threading module threads, not Python threads created elsewhere (e.g. by the "outer" C++ application itself or by a QThread wrapper). It's really quite poorly implemented there IMHO.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#129This is a case where the "in 2018" in the title is very helpful, as Googling information about Python and Qt usually returns something dreadfully out of date. (and as other comments note, there are lots of new companion tools/competitors like Electron)
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?
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#130This is a case where the "in 2018" in the title is very helpful, as Googling information about Python and Qt usually returns something dreadfully out of date. (and as other comments note, there are lots of new companion tools/competitors like Electron)
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?