7 ms·
Ask HN: Should Qt be considered in the place of electron?
When a cross platform app is required, Electron is often mentioned first: Should Qt be considered to fill that gap (As in the new QML-y Qt)
- tlb 8y agoI'm developing something on Electron, but casting occasional glances at Qt wondering if it'd be better. It's hard to beat the edit-test-debug cycle of Electron, where I can tweak a line of code, hit Cmd-R, and see the results in less than a second.
- CarVac 8y agoQML is just as fast. If you don't make any changes to the C++ side of things then there's no recompiling needed.
- ctrlaltdev 8y agoWell, if I can ditch chromium, I'm all for it. Will look into it.
- eivarv 8y agoHeck yes. I still don't get how so many creators of apps justify choosing Electron to themselves, what with all the downsides (resource usage, power consumption, accessibility, security, and so on). Another GUI-framework I've enjoyed using is wxWidgets, which provides a thin abstraction to a platform's native widgets. Has a bunch of language bindings, and a pretty liberal license as well.
- h1d 8y agoWhat exactly is the security concern by using Electron? Accessibility is only achieved by the creator's intention.
- eivarv 8y agoWell, it brings the usual web security issues to the desktop, dragging with it much of the browsers' attack surface. Also, there's been a bunch of CVE – there's one [0] in particular that springs to mind. Accessibility is only achieved by the creator's intention. That's a problem. Native widgets come with accessibility built in (to the extent accessibility is supported on the platform in question). [0]: https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/cve-2018-1000136-electron-nodeintegration-bypass/ https://www.trustwave.com/en-us/resources/blogs/spiderlabs-b...
- Gibbon1 8y agoI've used an editor and two IDE's that are built off wxWidgets. They are all fast and responsive. And support Windows, Mac and Linux. As in they 'work' for all three. I think wxWidgets supports a variety of bindings for different languages as well. Never used it but C#/netcore might be a good choice as well. I've only used C# with winforms though, so the danger I'm talking out my ass is high.
- RantyDave 8y agoI did an app on wxWidgets a few years ago. It's really kinda good - a lot like what MFC should've been.
- zerr 8y agoOf course. If it's only for desktops, you should go with Qt Widgets.
- throwaway2021 8y agoYes.
- Memosyne 8y agoAs much as I enjoy working with Qt, I wouldn't bet on it for the future. QML support still seems a bit iffy and being told QWidgets are being phased out is disheartening. The framework is in a sort of limbo stage where newcomers don't really know how to proceed. The lack of popularity (outside of some niches) doesn't help either. I hate working with web frameworks but the network effect is real and not in favor of Qt. Perhaps there was a time when Qt was thriving and innovating, but right now it seems like it's just a bunch of fortune 500 companies paying 1-2 Qt developers to maintain legacy software. Sometimes I wonder if there is an alternate universe where Qt won "the battle" and made the world a better place. Sadly for us, that didn't happen here.
- iqy 8y agoQWidgets are being phased out? What???
- Data_Junkie 8y agoNo, they are just mostly finished and aren't seeing a lot of new feature work being done ,if any. Qml is a way better way so that's what they are working on. It gets better every release, and that guy doesn't have a clue. Sorry. Just for the record, QML is awesome.
- Memosyne 8y ago> they are just mostly finished Yeah, I don't know how much experience you have with Qt but widgets are far from being "finished". There's plenty of things that could be improved if their focus wasn't on Qt Quick. The use of Qt Widgets is declining (albeit slowly), as stated in http://blog.qt.io/blog/2019/01/14/qt-customer-survey-2018/ http://blog.qt.io/blog/2019/01/14/qt-customer-survey-2018/. You're telling me that they're going to support two different technologies that do the same thing without giving preference to the newer, technically superior one? Qt Quick is intended to replace Qt Widgets, but it isn't currently at a stage where that's feasible -- hence my apprehension.
- 8y ago
- ken 8y agoI hear this a lot, as a contrast to Electron, but I haven't seen any examples of good cross-platform Qt apps. The only Qt app I've used recently is VirtualBox, which is terrible on the Mac. The controls don't look or work right at all. On Windows, it's less bad, but still noticeably non-native. I searched the web and found that Google Earth Pro also uses Qt, so I downloaded that. It looks awful, too. The scrollbars, split panes, buttons, and toolbars look wrong. Checkboxes are drawn mangled, animation is absent, and the outline view doesn't size its rows correctly so the bottom half of text is cut off. Despite language being "System default" in the Earth prefs, and English being the top language in my System Prefs, part of the UI is in Japanese (my #2). The view right after launch: https://i.imgur.com/eDvSoUm.png https://i.imgur.com/eDvSoUm.png I think a good first step would be looking at existing Qt apps. Are you OK with the quality of apps like VirtualBox and Earth? Alternatively, do you think you can do a better job at this than Google and Oracle? I think if you're planning to write a typical Qt app, in order to make 'native app' fans happy, you're going to be in for a surprise.
- cpburns2009 8y ago> The only Qt app I've used recently is VirtualBox, which is terrible on the Mac. The controls don't look or work right at all. On Windows, it's less bad, but still noticeably non-native. On Windows and Linux (primarily Ubuntu), KeePassXC, VirtualBox and VLC have been pretty good in my experience and they're Qt as far as I know. Dropbox uses Qt as well, however, it's interface is minimal. Electron doesn't even try to look or behave natively for what it's worth.
- ken 8y agoCurious. VLC on MacOS doesn't exhibit any of the weird UI glitches that other Qt apps have, and an inspection of the package shows it doesn't contain any Qt frameworks. VLC's Wiki [1] says: "Qt / Qt4 is the default, plain, graphical, interface to VLC, made using the Qt library (Linux users may need to have this installed). It is used as the default interface on the Windows and Linux versions of VLC media player from version 0.9.0 and above." [1]: https://wiki.videolan.org/Qt_Interface/ https://wiki.videolan.org/Qt_Interface/ I googled for "dropbox mac qt" and only found this page [2] from 2014 which says they were experimenting with rewriting the Dropbox UI in Qt for Linux and Windows. The linked post [3] says the Qt rewrite is for Windows and Linux only. [2]: http://www.webupd8.org/2014/07/dropbox-ui-rewritten-in-qt-for-latest.html http://www.webupd8.org/2014/07/dropbox-ui-rewritten-in-qt-fo... [3]: https://web.archive.org/web/20141015093406/https://forums.dropbox.com/topic.php?id=118006 https://web.archive.org/web/20141015093406/https://forums.dr... I consider Qt (along with Gtk+) to be native on Linux -- there's no more-native toolkit that it's wrapping or emulating. So I find it interesting that these cross-platform applications (Wikipedia lists 9 platforms for VLC!) both use Qt for only 2 platforms, and 1 of those is where it's native, anyway. These are mature applications which have clearly put a lot of effort into both user experience and cross platform support, and they have already gone to the trouble of implementing their UI in Qt, but for most platforms they choose not to use it. What I get from this is: Qt is useful as a cross-platform GUI toolkit only for targeting Windows. Is that overly cynical?
- cpburns2009 8y agoQt with or without QML should definitely be considered. Granted, I can't say I've ever made more than a toy application in Qt (via Python and PySide). A third option if you're too afraid of C++ or one of the Qt bindings, and you really need something web-like, is JavaFX.
- dbla 8y agoDoes anyone have experience with Proton Native? https://proton-native.js.org/#/ https://proton-native.js.org/#/ Never used it myself but I wonder if it is a more performant alternative to Electron
- johnny22 8y agoQt is brought up in almost every thread where electron is mentioned.
- techntoke 8y agoBecause it is awesome
- mindcrime 8y agoAnother option is SWT and the Eclipse RCP.
- actf 8y agoDoes anyone else find Qt difficult to setup/compile and find the qtmoc hoops that are necessary really frustrating when it comes to compiling projects in a non standard way?
- miguelrochefort 8y agoCan Qt run in a browser? There's your answer.
- eliaspro 8y agoYes, it does: http://blog.qt.io/blog/2018/05/22/qt-for-webassembly/ http://blog.qt.io/blog/2018/05/22/qt-for-webassembly/
- flukus 8y agoLooking at the widget gallery (http://example.qt.io/qt-webassembly/quickcontrols2/gallery/gallery.html http://example.qt.io/qt-webassembly/quickcontrols2/gallery/g...) I want to complain about what a waste the 5.6MB download is, but that's probably smaller than a lot of new sites and most android apps. I now fear this might become viable and websites will become a black box where things like ad blockers don't work.
- invaliduser 8y agoMore like Qt runs the browser.
- pookeh 8y agoHas anyone tried react-native-desktop that uses QT? What are your experiences? https://github.com/status-im/react-native-desktop https://github.com/status-im/react-native-desktop
- quickthrower2 8y agoAlso consider Adobe AIR.
- invaliduser 8y agoActually, this is funny because that's literally what I have been doing for the last 2 startups I co-founded. The first one was in 2013, so Electron was not an option at the time, I needed a runtime to run my webapp (in the healthcare industry, for many legal reasons and budget, I could not and would not have it hosted on the internet, so I needed it to be a desktop app). At the time it was webkit, and it already was a great experience. The app was part C++, part Angular1, all the data was stored locally in a sqlite db. The company is still running, and the app is on the verge of being rewritten (basically because the new CTO is not much into C++) with Electron. Second project, started in 2016, originally a React Native app (IOS and android), but many customers wanted a desktop/web version. Web was a lot of work because the app depends on storing data locally (sqlite again), so to make it fast, I did a first prototype with Electron, spent a week on but I had many issues with building native nodejs modules, so I dropped it and back again on Qt, but today it's all chromium-based instead of webkit. So I wrote the native part I needed in C++ (was fast and easy because the Qt library covers a lot), bridged it to the application, and the port of the ReactNative app was completed in less than 2 months. I like Electron very much, but if you know C++, Qt is great competitor as a webengine runtime. Of course, I had my share of issues with Qt, but I don't feel like it would have been really better with Electron, whatever the framework, there are always issues.