I gave up on QT and decided instead to invest time learning javascript frameworks, which provide a lot more flexibility for creating apps.
Then try QML! You can create Qt apps using JavaScript (it's ES5 though).
PyQt5 Tutorial: Create a Python GUI in 2018
111–120 of 211 posts
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#112Earlier quoted context omitted.
You can do all those (sorting, filtering, etc) in Qt as well using the Model/View components. There is a bit of a learning curve to understand the "Qt way of doing MVC", but after that it works fine. At work we use Qt5 with both C++ and Python (through PyQt) and I love it.
Thanks! What I'd like to know more specifically is if there are some ready-made components already packing a lot of these functionalities without needing too much custom logic, or you need to roll out your own from low-level ones?
The model/view components scale to ~infty items, if the model is correctly implemented. They also support lazy loading.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#113Earlier quoted context omitted.
What's the memory consumption of pyQT compared to electron apps?
An order of magnitude lower. I see 40Mb on macos right now for a simple app.
Measuring memory use is difficult.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#114Still using tkinter here which is python's default GUI, what's the license for PyQt5? For me learning Qt in general is another big investment of limited time, so far I have been using tkinter with python and it works well.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#115This 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
#116I'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…
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
#117I 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?
> If you're building a desktop app that needs to really look good and be fast, why are you using Python? Why not? For an app to feel fast, you need to make it responsive and non-blocking. You can easily make apps with Python and Qt or Gtk that start instantly and never seem to hang. Discipline when it comes to not running things on the main thread, using proper async techniques etc. is more important than the number…
I work on a data visualization program written with PyQt. As an example, in a scatterplot with several hundred thousand rows, the bottleneck is not number crunching. Numpy could go up another order of magnitude. Probably two. The bottleneck is figuring out efficient ways to display all of the points, correctly, and make them pickable.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#118In commercial settings, I wonder how hard it really is to package this up? I've been building/distributing fully cython'd installers for a while (to sort-of hide the source as well as make a convenient package)... I wonder if that would be harder with PyQt for some reason? "In the Python world, the process of turning source code into a self-contained executable is called freezing. Although there are many libraries th…
It's robust, proven, does work well with C extensions (including numpy and QT) and produces stand alone binaries. You can produce binaries for Windows, Linux and Mac (but not cross compile). It works by turning the whole Python code into C before compiling the result. The additional benefit of that is that you gain a bit of execution speed.
The project is amazingly little known in the community while PyInstaller, py2exe, cx_Freeze, bbfreze, py2app are: nuikta works better, handle more edge cases, target more OSes and support recent versions of Python.
The best way to be convinced is to read the last entry of the blog on the home page: the guy is meticulous with this project.
Re: PyQt5 Tutorial: Create a Python GUI in 2018
#119Re: PyQt5 Tutorial: Create a Python GUI in 2018
#120Earlier quoted context omitted.
An order of magnitude lower. I see 40Mb on macos right now for a simple app.
I see a simple electron app using 140MB total. Measured by running 'free -m' before and after starting the app and waiting a while for a gc to run. Measuring memory use is difficult.