News for hackers. Stuff that matters.
Re:Ask HN: Is there still a place for native desktop apps? by jcelerier on Sunday May 17, 2020 @06:31PM (#23216116)
a few reasons :

- Qt is actually the native toolkit of multiple operating systems (Jolla for instance and KDE Plasma) - you just need to have a Linux kernel running and it handles the rest. It also does the effort of going to look for the user theme for widgets to mix in with the rest of the platform, while web apps completely disregard that.

- Windows has at least 4 different UI toolkits now which all render kinda differently (win32, winforms, wpf, the upcoming winui, whatever is using Office) - only Win32 is the native one in the original sense of the term (that is, rendering of some stuff was originally done in-kernel for more performance). So it does not really matter on that platform I believe. Mac sure is more consistent, but even then ... most of the apps I use on a mac aren't cocoa apps.

- The useful distinction for me (more than native and non-native) is, if you handle a mouse event, how many layers of deciphering and translation has it to go through, and are these layers in native code (eg. compiled to asm). As it reliably means that user interaction will have much less latency than if you have to go through interpreted code, GC, ...

Of course you can make Qt look deliberately non-native if you want, but by default it tries its best - see https://code.woboq.org/qt5/qtbase/src/plugins/platforms/coco... and code such as https://code.woboq.org/qt5/qtbase/src/plugins/platforms/wind...

Re:Ask HN: Is there still a place for native desktop apps? by irishcoffee on Sunday May 17, 2020 @07:20PM (#23216453)
Knowing what I know about Qt and what I've done with it in my day job, it's basically the best kept secret on hn. What they're doing with 6+licensing... I'm not sure how I feel, but from a pure multi-platform framework it really is the bees knees.

I've taken c++ qt desktop apps that never had any intention of running on a phone, built them, ran them, everything "just worked. I was impressed.

Re:Ask HN: Is there still a place for native desktop apps? by hoseja on Monday May 18, 2020 @03:28AM (#23219376)
I just wish it weren't stuck, anisotropically, ~10 years in the past. Maybe Qt6 will be better, but more likely it will be more and more QML.
Re:Ask HN: Is there still a place for native desktop apps? by RMPR on Tuesday May 19, 2020 @05:14AM (#23232879)
Since QML uses Javascript it may be their best bet to attract new developers.
Re:Ask HN: Is there still a place for native desktop apps? by hoseja on Tuesday May 19, 2020 @08:07AM (#23233923)
Yes, well, QML also uses JavaScript.
Re:Ask HN: Is there still a place for native desktop apps? by PaulDavisThe1st on Sunday May 17, 2020 @07:01PM (#23216337)
This is not really accurate. Qt relies on a lower level windowing system (X Window, Wayland, Cocoa, win32 etc. etc.).

Also worth noting that many creation-centric applications for the desktop (graphics, audio, video etc. etc.) don't look "native" even when they actually are. In one case (Logic Pro, from Apple), the "platform leading app from the platform creator" doesn't even look native!

Re:Ask HN: Is there still a place for native desktop apps? by jcelerier on Sunday May 17, 2020 @07:36PM (#23216568)
> This is not really accurate. Qt relies on a lower level windowing system (X Window, Wayland, Cocoa, win32 etc. etc.).

Qt also supports rendering directly on the GPU (or with software rendering on the framebuffer) without any windowing system such as X11 or Wayland - that's likely how it is most commonly used in the wild, as that's one of the main way to use it on embedded devices.

Re:Ask HN: Is there still a place for native desktop apps? by PaulDavisThe1st on Sunday May 17, 2020 @08:49PM (#23217024)
I'd like to see it do that on macOS ...

You're seriously suggesting that the common use of Qt on Linux systems is direct rendering without the windowing system?

Re:Ask HN: Is there still a place for native desktop apps? by gwillz on Sunday May 17, 2020 @09:06PM (#23217116)
Not parent, but yes, sort of.

Arguably it's use in embedded contexts is much larger than desktop. It's quite popular for in-car computers, defense systems, etc.

For desktop linux, yes, it uses the windowing system.

Re:Ask HN: Is there still a place for native desktop apps? by jcelerier on Monday May 18, 2020 @03:31AM (#23219392)
Well, yes. I can't tell too much because of NDAs but if you go buy a recent car there is a good chance that all the screens are rendered with Qt on Linux or a RTOS - there is likely more of those than desktop linux users as much as this saddens me
Re:Ask HN: Is there still a place for native desktop apps? by saagarjha on Monday May 18, 2020 @06:23AM (#23220587)
On macOS Qt doesn’t really use Cocoa, it use Quartz/CoreGraphics (the drawing rather than the application layer). Note that Apple’s pro apps are native controls with a UI theme: they usually behave like their unthemed counterparts.
Re:Ask HN: Is there still a place for native desktop apps? by PaulDavisThe1st on Wednesday May 20, 2020 @12:54AM (#23243406)
I had meant to write Quartz, not Cocoa.

I know how Qt works at that level. I did a bunch of work in the mid-naughts on the equivalent stuff in GTK.

Re:Ask HN: Is there still a place for native desktop apps? by rattray on Sunday May 17, 2020 @07:31PM (#23216531)
> Qt relies on a lower level windowing system

That's true of QtWidgets, but not QML / Qt Quick (the newer tool), correct? (I found this hard to determine online).

Re:Ask HN: Is there still a place for native desktop apps? by jcelerier on Sunday May 17, 2020 @08:01PM (#23216728)
Kinda - QML is a programming language, Qt Quick is an UI scene graph (with the main way to use it being through QML) which also "renders everything" and makes by default less effort than widgets to look like the OS.

But :

- QML can be used with other graphics stack - for instance Qt Widgets like with https://www.kdab.com/declarative-widgets/ or alternatives to the official Qt Quick controls with https://github.com/uwerat/qskinny or with completely custom rendering like here with NanoVG : https://github.com/QUItCoding/qnanopainter

- QtQuick Controls can be made to use the same style hints than the desktop with https://github.com/KDE/qqc2-desktop-style

Re:Ask HN: Is there still a place for native desktop apps? by madeofpalk on Sunday May 17, 2020 @07:36PM (#23216561)
What does “native” even mean?

Put a <button/> in an HTML page and you get a platform-provided UI widget.

Re:Ask HN: Is there still a place for native desktop apps? by PaulDavisThe1st on Sunday May 17, 2020 @08:51PM (#23217035)
It's not platform-provided in my experience, but browser provided. The result of <button/> when viewed in a browser on macOS has no relation to the Cocoa API in any meaningful sense.
Re:Ask HN: Is there still a place for native desktop apps? by madeofpalk on Sunday May 17, 2020 @09:39PM (#23217300)
I'm pretty sure that when you render just a <button> in at least Safari, the browser will render a native Cocoa button control. If you set a CSS property like background colour or change the border, then it will "fall back" to a custom rendered control that isn't from the OS UI.

I did a small bit of research into this, and found plenty of "anecdotal" evidence, but nothing confirming for sure. I'm looking and interacting with the controls and they seem pretty native - if they're a recreation than that's pretty impressive :)

Re:Ask HN: Is there still a place for native desktop apps? by saagarjha on Monday May 18, 2020 @06:24AM (#23220595)
The drawing is native and the interaction is handled by the browser.
Re:Ask HN: Is there still a place for native desktop apps? by slightwinder on Monday May 18, 2020 @05:29AM (#23220241)
A GUI is a collection of elements with specific look and behaviour. A Desktop Environment is a collection of GUI(s), tools and services. Native means you have something which follows this look and behaviour 100% and can utilize all the tools and services.

Implementing the look is simple, adding behaviour quite harder and utilizing the service the endgame. WebUI usually does nothing from those or some parts, it all depends on the constellation. But usually there is a obvious difference at some point where you realize whether something is native or just made an attempt.