News for hackers. Stuff that matters.
Re:Ask HN: How to do cross platform GUI? by cpach on Saturday August 22, 2020 @04:34AM (#24242687)
Have you considered Qt?

As a Mac user I prefer native applications if available. But still, I would consider a well-written Qt application.

For example, qBittorrent is quite alright.

https://en.m.wikipedia.org/wiki/Qt_(software)

https://www.qbittorrent.org/

Re:Ask HN: How to do cross platform GUI? by anang on Saturday August 22, 2020 @04:53AM (#24242768)
Are there any canonical resources for learning qt with common language bindings? I know pyqt exists, but there’s a lot of info out there and it’s hard to know what’s good and what’s not. I’ve also found that generally any guides are either kitchen sink level or not much more than hello world.

Where should I look? I’m willing to put in the work!

Re:Ask HN: How to do cross platform GUI? by otterlicious on Saturday August 22, 2020 @07:52PM (#24248278)
I learned from this guide (well the PyQt4 version). It starts off small and works up to the kitchen sink if that's what you need:

http://zetcode.com/gui/pyqt5/

There are a few others here:

https://wiki.python.org/moin/PyQt/Tutorials

The 2020 one there may be what you're looking for, more than hello world but doesn't quite all the way get to the kitchen sink, just maybe the silverware drawer.

Re:Ask HN: How to do cross platform GUI? by the_pwner224 on Sunday August 23, 2020 @03:22PM (#24254540)
Someone else linked a beginner type PyQt tutorial, but just FYI the PyQt API is pretty much exactly the same as the C++ API, down to capitalization. I only use PyQt but still use to the official Qt documentation which is for C++. The only issue can be finding which module a class needs to be imported from in PyQt, which usually can be resolved with Google and then later by looking at old code and copying the few lines of import statements you build up.
Re:Ask HN: How to do cross platform GUI? by emddudley on Monday August 24, 2020 @10:51PM (#24267731)
PySide2 is the offical Qt Python bindings, and so the Qt website has reference docs and examples for it. PyQt is a separate project by Riverbank Computing.
Re:Ask HN: How to do cross platform GUI? by d0mine on Sunday August 23, 2020 @04:32AM (#24250530)
Beware of there may be Qt licensing issues.
Re:Ask HN: How to do cross platform GUI? by formerly_proven on Sunday August 23, 2020 @09:05AM (#24251617)
Not really. It's not 1997.

Qt is LGPL. PySide is LGPL. PyQt is "GPL but allows you to link from popular open source licenses".

Re:Ask HN: How to do cross platform GUI? by andi999 on Sunday August 23, 2020 @01:05PM (#24253324)
PyQt is "GPL but allows you to link from popular open source licenses" what is this supposed to mean?
Re:Ask HN: How to do cross platform GUI? by formerly_proven on Sunday August 23, 2020 @02:31PM (#24254099)
Ah, I see I'm not quite right there. PyQt _used_ to include a file listing the usual open source licenses (MIT, BSD, Apache, Python and so on) as ok to use with their GPL code base, but they since removed that, because in the meantime it has become clearer that the GPL is already giving people that freedom.

https://riverbankcomputing.com/pipermail/pyqt/2014-February/...

Re:Ask HN: How to do cross platform GUI? by andi999 on Sunday August 23, 2020 @03:06PM (#24254409)
Your statement sounds like GPL is giving a "freedom", so like you could use GPL code in an MIT licensed project (sorry if I misinterpreted your statement); this is not true, see https://www.tawesoft.co.uk/kb/article/mit-license-faq "Can I use GPL-licensed code in my MIT-licensed project? No. The project as a whole must conform to the terms of the GPL license and must be distributed under the terms of that license. Therefore such a project as a whole must be distributed as GPL, but can still contain MIT-licensed software."

So it is more like MIT licensed projects give you the freedom to use in a GPL project.

Re:Ask HN: How to do cross platform GUI? by flingo on Monday August 24, 2020 @06:10AM (#24259149)
The keyword here is "linking exception". It is a hack to sidestep the licensing problems caused by dynamic linking. e.g. If I encase gcc in java, and release gcc.class under GPL3+, but use it extensively in a separate proprietary java program, does that infringe on the terms of the GPL? Does providing copies of the two together, with a single installer make a difference?

https://en.wikipedia.org/wiki/GPL_linking_exception

Re:Ask HN: How to do cross platform GUI? by andi999 on Monday August 24, 2020 @08:37AM (#24260008)
Free PyQT does not have the linking exception (which would be lgpl); only the commercial version has.

https://riverbankcomputing.com/commercial/license-faq

Re:Ask HN: How to do cross platform GUI? by making3 on Sunday August 23, 2020 @04:25AM (#24250500)
Are there any modern applications / examples built with Qt? This is the screenshot from the Wikipedia article:

https://upload.wikimedia.org/wikipedia/commons/e/e8/Qt_Creat...

I always see Qt mentioned, so I'm definitely not trying to discredit it. I just never seem to see common examples with it compared to something written in Electron.

Re:Ask HN: How to do cross platform GUI? by genezeta on Sunday August 23, 2020 @05:03AM (#24250645)
Maya, Krita, Octave, OBS, Scribus, Virtualbox, Wireshark. These all have fairly modern Qt GUIs and you can find screenshots around easily enough.

The comparison to Electron is somewhat flawed though. I mean, the GUI in an Electron application owes much more to whatever library they choose than to the fact that it runs inside Electron. Electron provides no particular GUI elements to the developer.

Re:Ask HN: How to do cross platform GUI? by mkoubaa on Sunday August 23, 2020 @09:38AM (#24251854)
Besides, QtWebEngine allows you to embed chromium into a QT app which means you can effectively get a similar stack as electron but also have the option to use desktop native widgets
Re:Ask HN: How to do cross platform GUI? by TeMPOraL on Sunday August 23, 2020 @04:55AM (#24250615)
Check out Ripcord - https://cancel.fm/ripcord/. It's a third-party Slack & Discord client written in Qt.

Now, don't let the screenshots color your impressions as to what kinds of UI designs are possible under Qt: Ripcord's UI is bare-bones on purpose; it's a selling feature. I bring up this application because it lets you do a more apples-to-apples comparison: IM clients these days are a poster child of an Electron app that uses orders of magnitude more resources than they should for the functionality provided. Ripcord lets you compare the experience and performance with a native app, implementing the same features but without overhead and gratuitous UI shine.

(And personally, I do use it for Slack/Discord instead of official clients.)

Re:Ask HN: How to do cross platform GUI? by jasode on Sunday August 23, 2020 @12:02PM (#24252787)
>I just never seem to see common examples with it compared to something written in Electron.

Autodesk Fusion 360 uses Qt[1]. (It's 3D CAD modeling software like Solidworks/Inventor). Some screenshots of its UI : https://www.google.com/search?q=%22autodesk+fusion+360%22+ui...

CAD/CAM modeling software is resource intensive and users always complain about slow performance when manipulating big files so writing that type of app in Electron/Chrome/Javascript browser engine would be worse than native C++/Qt.

That said, another competitor Onshape is browser-based and yes, people do complain about its performance.

Some other well-known desktops using Qt are Autodesk Maya and Wolfram Mathematica.[2]

[1] https://forums.autodesk.com/t5/fusion-360-api-and-scripts/wh...

[2] https://en.wikipedia.org/wiki/Category:Software_that_uses_Qt

Re:Ask HN: How to do cross platform GUI? by johnflan on Sunday August 23, 2020 @09:07AM (#24251633)
I believe many modern car digital dashboards are written in Qt too
Re:Ask HN: How to do cross platform GUI? by stjohnswarts on Sunday August 23, 2020 @02:42PM (#24254206)
Qt embedded is actually pretty nifty. I converted an old GTK "bare metal" interface UI over to Qt once while keeping the "business" logic basically the same other than a couple of tweaks, it went pretty well. The app was pretty well partitioned between backend logic and GUI logic so it wasn't a bad experience at all. All in C++
Re:Ask HN: How to do cross platform GUI? by thebruce87m on Sunday August 23, 2020 @07:22PM (#24256146)
How did you do licensing? That’s the killer for me on bare-metal.
Re:Ask HN: How to do cross platform GUI? by stjohnswarts on Tuesday August 25, 2020 @06:04PM (#24276739)
I wasn't in on that, we had licensing, and I'm sure it was paid for. It was a medical devices company so they had pretty deep pockets.
Re:Ask HN: How to do cross platform GUI? by butz on Sunday August 23, 2020 @04:33AM (#24250536)
Re:Ask HN: How to do cross platform GUI? by eblanshey on Sunday August 23, 2020 @11:07AM (#24252421)
I'm very happy with the VNote UI, which uses Qt. It's an open source markdown note-taking app. Check out the dark themes.