Live data from Hacker News

PyQt5 Tutorial: Create a Python GUI in 2018

build-system.fman.io

151–160 of 211 posts

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#151
post #7

As someone who works with Windows forms, I'm wondering where the visual designer to place widgets is.

In addition to what the other said, if you use Qt Quick instead of Qt Widgets you get something which is an order of magnitude more powerful than most of the alternatives : * http://blog.qt.io/blog/2017/07/05/qt-quick-designer-coffee-m... * http://blog.qt.io/blog/2017/05/24/qt-quick-designer-qt-creat...

Does Qt Quick integrate well with Python?

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#152

Earlier quoted context omitted.

In addition to what the other said, if you use Qt Quick instead of Qt Widgets you get something which is an order of magnitude more powerful than most of the alternatives : * http://blog.qt.io/blog/2017/07/05/qt-quick-designer-coffee-m... * http://blog.qt.io/blog/2017/05/24/qt-quick-designer-qt-creat...

Does Qt Quick integrate well with Python?

as much as the other parts of the API I guess ?

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#153

Earlier quoted context omitted.

Qt qualifies on any platform, imo.

Unless you use Qt quick which seems to be the way forward, and what many devs with html/css/js background seem to prefer. Qt widgets look close to native UIs but the feel isn't always the same, especially when you have to juggle with different platforms (all native widgets differ in subtle ways even when their function is the same).

Qt quick has Qt Quick Controls. Confusing naming, basically the same as Qt widgets, but built in Qt Quick (meaning they're themeable).

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#155
post #147
post #131

Earlier quoted context omitted.

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.

> ui for connecting signals and slots and configuring stuff as well, but few people use it. I try hard to do that (it saves on boilerplate), but the challenge is always in finding signals and slots with the same precise amount of parameters. Say I trigger a signal with no parameters and I want to connect it to a slot that takes a boolean always with the same value (e.g. a pressed() connected to a setEnabled(bool), wh…

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.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#156
post #75

Earlier quoted context omitted.

Then try QML! You can create Qt apps using JavaScript (it's ES5 though).

ES6 in Qt 5.12

Wow, I just checked it, and it looks awesome! I'm very exited about the next Qt 5.12. Thank you for letting me know.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#157

Earlier quoted context omitted.

What's the memory consumption of pyQT compared to electron apps?

I can't comment for pyQt. But the regular C++ Qt app I'm tinkering with at the moment uses 11MB private and about 50MB in shared memory for displaying a simple window with some nested widgets and scrollable lists.

for reference, the app I'm working on (https://ossia.io), a multiple-hundred-LOC Qt-based DAW with support for many network protocols and which uses most Qt libraries as well as boost uses itself 41 megabytes of RAM (private working set) and 70 megabytes total (working set) with a small document loaded, according to the windows task manager.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#158
post #139

Earlier quoted context omitted.

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 !

I was replying to a post that stated specifically that it was "non-ugly". In 2018, non-ugly means this : * https://assets.guitar-pro.com/1.3/images/www/guitar-pro-7/ca... * https://www.awn.com/sites/default/files/styles/original/publ... * http://www.comptoir-hardware.com/images/stories/_software/am... it's not what I use myself, being more of an i3/terminal guy, but it's absolutely what the clients want

For me, "non-ugly" means that it uses the standard UI controls and UI theme for the platform in a reasonable way. That's exactly what the screenshot shows. I would describe it as "neat". All your links are the exact opposite of that.

I'm sure someone (and, in particular, their designers) think they look nice. But the thing about looks is that they're very subjective. However, if I'm using some OS/desktop combo, that means I find its UI, at the very least, acceptable. And thus any app that uses native UI look & feel on that platform is also acceptable. I can't say that for many custom-themed apps.

For example, out of your links, I would say that 2 are downright ugly, and the third is tolerable. And I'm not sure what "in 2018" has to do with that.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#159
post #82
post #29

Earlier quoted context omitted.

Flexibility to do what, though? I'm genuinely curious: what doesn't Qt offer that a desktop app might need?

Why do you think programmers of all people are heavily migrating to Electron based editors like VS Code? Because they like using slow and bloated apps? And I'm not talking only of web programmers, I know plenty of C++ programmers who moved to VS Code.

Because C++ is not a particularly good language to write large UI apps in.

Also, because QML is still not as good as the rest of Qt. But it's the right approach - a dedicated framework for desktop apps that is not built on things intended for completely different purposes (like HTML), but stealing the good ideas from there, like using a markup language to define the UI tree, and bindings.

Really, what we need is a cross-platform WPF with less fat. HTML is not it - it's cross-platform WPF with more fat, and not optimized for UI.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#160
post #131

Earlier quoted context omitted.

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.

Ahh...responsive layouts in VB, those were the days. Cramming everything into a frame, and looping through each widget to set width to 49% of the frame.....every time they moved/resized the form. It seems a lot more pleasant in my memory that it likely was at the time.
Post reply on HN