News for hackers. Stuff that matters.
[dead]
Re:A Better Qt Because of Open Source and KDE by sho_hn on Tuesday December 10, 2019 @07:55PM (#21758503)
Irony: Electron is based on Blink. Blink is derived from WebKit. WebKit is derived from KDE's KHTML. KHTML was written against Qt APIs, and many of the original KHTML authors overlap the set of Qt authors. Electron is a competitor Qt begat. :-)
Re:A Better Qt Because of Open Source and KDE by pjmlp on Tuesday December 10, 2019 @03:01PM (#21756257)
Only if you mean a better heat producing software.
Re:A Better Qt Because of Open Source and KDE by ronilan on Tuesday December 10, 2019 @03:03PM (#21756283)
I understand you are not a fan.
Re:A Better Qt Because of Open Source and KDE by coldtea on Tuesday December 10, 2019 @03:37PM (#21756586)
No, but when running Electron you will need one or two.
Re:A Better Qt Because of Open Source and KDE by wiz21c on Tuesday December 10, 2019 @03:19PM (#21756416)
Right in time for the cutest pun of the year :-)
Re:A Better Qt Because of Open Source and KDE by throwaway894345 on Tuesday December 10, 2019 @04:15PM (#21756937)
Missed opportunity: s/cutest/coolest
Re:A Better Qt Because of Open Source and KDE by detaro on Tuesday December 10, 2019 @04:27PM (#21757031)
but cute = Qt
Re:A Better Qt Because of Open Source and KDE by throwaway894345 on Tuesday December 10, 2019 @04:46PM (#21757208)
touche
Re:A Better Qt Because of Open Source and KDE by StavrosK on Tuesday December 10, 2019 @03:17PM (#21756401)
There is no fan big enough for the heat Electron generates.
Re:A Better Qt Because of Open Source and KDE by avaku on Tuesday December 10, 2019 @04:22PM (#21756997)
> I understand you are not a fan.

Pun intended? :)

Re:A Better Qt Because of Open Source and KDE by de_watcher on Wednesday December 11, 2019 @10:12AM (#21763080)
Fan intended.
Re:A Better Qt Because of Open Source and KDE by shaan7 on Wednesday December 11, 2019 @01:42AM (#21760139)
F
Re:A Better Qt Because of Open Source and KDE by neilsimp1 on Tuesday December 10, 2019 @02:51PM (#21756166)
I'll bite. Define "better" here.
Re:A Better Qt Because of Open Source and KDE by cosmic_quanta on Tuesday December 10, 2019 @02:53PM (#21756187)
I also would like to know how "better" is defined.

Is it developer ergonomics? That's the only thing I can think of, and even then that's debatable.

Re:A Better Qt Because of Open Source and KDE by babypuncher on Tuesday December 10, 2019 @04:17PM (#21756957)
If your only goal is to create a cross platform desktop client for your existing web app as fast as humanly possible, then Electron is better.
Re:A Better Qt Because of Open Source and KDE by pjmlp on Wednesday December 11, 2019 @01:43AM (#21760149)
The Web app already exists then, no need for Electron.
Re:A Better Qt Because of Open Source and KDE by bollockitis on Tuesday December 10, 2019 @07:19PM (#21758265)
Let's not forget that worse is better. Electron is worse in almost every conceivable way; therefore, it is better.
Re:A Better Qt Because of Open Source and KDE by laxd on Tuesday December 10, 2019 @03:20PM (#21756423)
Not a fan of electron at all. But I think it points out the direction for the future of gui. There's a whole generation of new languages (rust, go, dart, D, ...) that wants to get into the gui-space and finding QT and GTK problematic. QT is known for "using every C++ feature", making it less than ideal for bindings. GTK is not very cross platform I think, and is criticized for beeing gnome-centric. Both toolkits are object-oriented, making them a poor fit for any language that is not. Something like mozilla's webrender could be used in a more language agnostic way (declerative, reactive), while having the support required for the gargantuan task of a graphics/toolkit backend.
Re:A Better Qt Because of Open Source and KDE by dev-il on Wednesday December 11, 2019 @01:55AM (#21760207)
Qt isn't known for "using every C++ feature" at all. Quite to the contrary, as far as C++ goes, Qt is stuck in the old times BEFORE modern C++. And it really shows in the architecture, memory management and syntax. In fact, lots of Qt's non-gui stuff is precisely about features that were missing in standard C++ at the time and later found their way there, leaving Qt with its old non-standard stuff (including containers, smart pointers, etc) and its raw pointers everywhere.

Making a wrapper for Qt is not really any more complicated by Qt being written in (old-style) C++ than if it had been written in C. In fact, lots of languages do have Qt wrappers. As for Qt being object oriented… well, while that might indeed have been a problem for a language that is not… all your examples (rust, go, dart, D, ...) are, so that's hardly the problem there. Also, as far as the declarative and reactive goes: Qt does do that as well, and way better than any browser-lib-based webrendering engine (including mozilla's)

The real pain point with Qt is with its licensing at least since Qt was bought by Digia.

Re:A Better Qt Because of Open Source and KDE by ahartmetz on Tuesday December 10, 2019 @06:17PM (#21757897)
Two points. Qt isn't using every C++ feature - it works fine without exceptions and generally feels fairly pedestrian to use (that's a feature). It is very much not a template hell like some parts of Boost.

Second, it has QML, which is a declarative UI framework with great runtime performance.

Re:A Better Qt Because of Open Source and KDE by mjevans on Tuesday December 10, 2019 @04:21PM (#21756992)
I'd like the pain-point parties (Apple, Microsoft) to just ship open-source linkable libraries of somekind in their app stores.

If OSX, Windows, and the mobile stores carried a common framework developers could target it would become a defacto UI standard since you could finally develop a cross-platform app that used 'native widgets' (at least a library that might already be installed) for every given platform, and which could have an OS prompt that asks to install it from a trusted source if they don't happen to have it.

Re:A Better Qt Because of Open Source and KDE by comex on Tuesday December 10, 2019 @06:34PM (#21758009)
What’s the need? For better or worse, app bundles tend to be huge these days; there’s no obstacle to embedding a few megabytes’ worth of GUI libraries in your app bundle, or just statically linking them into your executable. Heck, a lot of apps embed a 120MB+ Electron framework; that’s pushing it, but Qt is “only” <20MB of DLLs, or less if you statically link it. (A more focused GUI library could be much smaller.)

I’d love to see better cross-platform desktop apps. But I think the missing piece is for someone to write a good library that uses native widgets – not figuring out how to distribute that library.

For the record, I think Qt is reasonably good, but not native enough. On macOS, even QWidget often imitates native widgets (poorly) instead of using them; on top of that, QWidget as a whole has unfortunately been semi-deprecated, in favor of newer QML stuff that doesn’t even try to look native.

Re:A Better Qt Because of Open Source and KDE by jlarcombe on Wednesday December 11, 2019 @08:58AM (#21762324)
I hear this quite a lot and am always curious to know which bits of the QWidget hierarchy are insufficiently native on the Mac - I've run in to many problems with Qt on the Mac over the years but that hasn't really been one, though our current app doesn't really use native-looking widgets anyway.

As for QWidget being semi-deprecated, this is not the case. They made some noises in that direction around the time Qt 5 was being developed but I think they thought better of it, so it's alive and well and still being developed.

Re:A Better Qt Because of Open Source and KDE by comex on Wednesday December 11, 2019 @09:25PM (#21768774)
For instance:

- Text fields are not backed by native NSTextViews, so automatic substitutions, spell checking, and the options you usually have in the right-click/Edit menu are all missing.

- Pop-up menus (but not top-menu-bar menus) are also custom, and the appearance and animations are way off. And there are some discrepancies in behavior:

a. Suppose you right-click and hold (which opens the right-click menu in a mode where you select menu items by releasing instead of clicking), then release while over a menu item that's either disabled or a submenu. With native menus, the menu gets dismissed; with Qt menus, it stays open. Sounds incredibly minor, right? But it's something I grew to subconsciously rely on, over years of using macOS. When I started using a Qt app, I kept instinctively trying to dismiss menus that way and getting frustrated when they stayed open.

b. If the mouse cursor leaves the menu area, native menus stop highlighting any item, while Qt menus keep highlighting whichever item was last highlighted. In the press-and-hold mode, this makes it seem like releasing the button might choose that item; it actually dismisses the menu, same as with native menus, but it's confusing.

Re:A Better Qt Because of Open Source and KDE by pjmlp on Wednesday December 11, 2019 @01:42AM (#21760141)
They are open enough, apparently linking to OS APIs is a lost art.
Re:A Better Qt Because of Open Source and KDE by int_19h on Friday December 13, 2019 @03:14PM (#21784984)
Qt seems to be quite deliberately written in a super/subset of C++ that looks a great deal like Java with smart pointers. Which, coincidentally, also makes it possible to provide language projections without having to manually adapt each and every class.
Re:A Better Qt Because of Open Source and KDE by japanoise on Tuesday December 10, 2019 @04:12PM (#21756911)
That more seems like there's a hole in the market for a better gui.
Re:A Better Qt Because of Open Source and KDE by billsix on Tuesday December 10, 2019 @07:39PM (#21758389)
Re:A Better Qt Because of Open Source and KDE by dfox on Tuesday December 10, 2019 @08:38PM (#21758754)
There is essentially no way to implement modern (ie. what any user expects since Windows 95) UI toolkit as an immediate mode thing. It is not only about drawing stuff on screen and handling mostly mouse events. There are things like keyboard shortcuts, keyboard navigation, clipboard/cutbuffers/selections, automation and accessibility hooks...
Re:A Better Qt Because of Open Source and KDE by ocornut on Wednesday December 11, 2019 @09:17AM (#21762508)
I'm not sure I understand why you think there is no way to do that with an API designed in IMGUI style? IMGUI is a style of exposing UI API. There's no reason this can't be made with a IM-style UI.

You are comparing apple and oranges when comparing the feature set of a small UI system made by 1 person-ish vs something like Qt benefiting from decades of experiences and hundreds of devs.

Re:A Better Qt Because of Open Source and KDE by jchw on Tuesday December 10, 2019 @02:58PM (#21756228)
I think “better” here might be defined by `du -s .` inside the application directory. :)
Re:A Better Qt Because of Open Source and KDE by snarfy on Tuesday December 10, 2019 @02:52PM (#21756174)
laughs in gigabytes
[dead]
Re:A Better Qt Because of Open Source and KDE by dang on Tuesday December 10, 2019 @02:57PM (#21756223)
We've banned this account for trolling. Could you please stop creating accounts to break HN's guidelines with?

Also, please don't make accounts for every few comments you post. We ban accounts that do that. This is in the site guidelines: https://news.ycombinator.com/newsguidelines.html.

HN is a community. Users needn't use their real name, but do need some identity for others to relate to. Otherwise we may as well have no usernames and no community, and that would be a different kind of forum. https://hn.algolia.com/?sort=byDate&dateRange=all&type=comme...

Re:A Better Qt Because of Open Source and KDE by michaelmrose on Tuesday December 10, 2019 @03:56PM (#21756766)
Electron is a layer over gtk that lets you use web tech instead of straight gtk it is functionally unsuitable to be a replacement for qt.