Live data from Hacker News

PyQt5 Tutorial: Create a Python GUI in 2018

build-system.fman.io

131–140 of 211 posts

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#131
post #41

Earlier 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.

It gives you ui for connecting signals and slots and configuring stuff as well, but few people use it. And qt singals and slots model is far superior to VB/Delphi style callbacks or c# delegates, but you have to program for a while to get why.

Also - layouts in VB/Delphi weren't responsive, layouts made in QtDesigner are.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#132
post #90
post #85

I'm sometimes considering porting the UI of a relatively complex management app I wrote sometime ago for a small company, from Ext JS to a Python-flavored traditional GUI framework like PyQt (it would essentially become a desktop app powered by an already Python-based backend, which wouldn't be really a problem deployment-wise, as it's an internal-facing app). I think there would be some benefits, but what stops me i…

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.

yep, Qt (Pyside) is very mature and very stable. In a professional, long term context, it's totally decisive.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#133
post #123
post #43

Earlier quoted context omitted.

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…

Is number five true? (Genuine question.) I haven't used QT in anger, and it's been a few years since I last wrote something in WXP. But the last project went with wxWidgets because of its built-in support for things like drag-and-drop negotiation, (multiple) file type association, undo, print, file preview, system level common accelerators and OS defined accessibility settings (including color and font remapping, spe…

Qt has tons of stuff, as far as I know everything you mention is covered pretty well (well, I don't know about speech, but widget text is very accessible).

QT is basically one of two toolkits that most Linux desktops are built on: it has to be wide-ranging enough to cover everything a desktop does, be accessible, and it has to interoperate with "the other" toolkit (GTK). It's absolutely nothing like Electron.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#134
post #43
post #28

I'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…

Can vouch that wxPython's documentation is very lacking even from my limited use experience.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#135
post #4

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?

For me pyqt is just the most convenient to use. It's hard to beat on the "time to code vs quality of the result" metric.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#136
post #97

Still 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.

I use this as a reference: https://github.com/baoboa/pyqt5/tree/master/examples

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#137
post #32
post #4

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 was recently surprised by how non-ugly a Python Tkinter app can look with some effort. Take a look at this: https://thonny.org/

"Main development of Thonny takes place in Institute of Computer Science of University of Tartu, Estonia."

Interesting!

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#138

Earlier quoted context omitted.

> (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.

The "threading" functionality in Python is a significant downside to the language. I don't know why they went with the idea that people don't need real threads like they can get in C/C++, Java, C#.

Python threads are real (operating system) threads.

Note that the "threading" and "_threading" modules wrap thread creation and otherwise just use interpreter C APIs. Their design flaw is that they assume that they are the only ones using the interpreter API.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#139
post #32

Earlier quoted context omitted.

I was recently surprised by how non-ugly a Python Tkinter app can look with some effort. Take a look at this: https://thonny.org/

that's an interesting definition of "non-ugly". I would hesitate a lot before making an app that looks like this screenshot public.

well it's a bit old school but it certainly looks functional. If the program under it is good, it's a very superficial comment. If only you'd see my emacs screen, it's unbelievably ugly and somehow, I work with it every day !

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#140
post #75

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).

Seconded. I got QML running on my pi using EGL (fullscreen without X) and love it.
Post reply on HN