8 ms·
The main problem with "other toolkits" vs Electron apps is that they are not as simple to use in order to create a very good looking UIs. Compare how easy it is
by _em6m 9y ago
The main problem with "other toolkits" vs Electron apps is that they are not as simple to use in order to create a very good looking UIs. Compare how easy it is to use HTML and CSS in order to create a very complex UIs with all sort of effects vs how utterly complicated is to override, let's say, Qt's ::paint() method in order to achieve rich text inside a label. Let me repeat it. Rich text inside a label. Such a simple thing...
- mi100hael 9y agoThe other issue is that a lot of these sorts of applications like Slack started life as a web app. In that case, your options are use Electron or build a new desktop application from the ground up.
- toyg 9y ago> your options are use Electron or build a new desktop application from the ground up. It's ironic that people bang the drum about REST and decoupling... and then at the first hint of actual serious frontend/backend decoupling, everyone runs for the hills.
- WorldMaker 9y agoSome of the same applications are also cross-targeting mobile with Cordova, and/or are already or are working to become PWAs.
- mherrmann 9y agoI agree that HTML/CSS is easier to use, though maybe some of that is just because everybody has been using them for years. However, you certainly don't have to override ::paint() to get rich text inside a label. You can use a simple subset of HTML in your QLabel to get various text effects.
- alexandernst 9y agoPlease read in between lines... I could easy write any other example. Don't make me compare HTML/CSS's flexibility with Qt's...
- yorwba 9y agoIf you really need the full flexibility of HTML/CSS, you can just use QtWebKit and embed a webview in your UI.
- monkmartinez 9y agoOr just use Electron/React-native and skip the pain involved with licensing, packaging, and lack of mobile support.
- toyg 9y ago> licensing, packaging, and lack of mobile support To be fair, these are different problems from what the grandparent was discussing. Licensing is a problem a business really shouldn't have: Qt is LGPL and PyQt licenses are cheap even for ramen-eating startups. Lack of mobile support is a Python problem, I agree there. I can assure you everyone in the Python world is sorely aware of it. Unfortunately, nothing will change until someone does what Google did for Java with Android. But it's a problem that electron apps have too, because "html apps" are still pretty bad on mobile (and terrible on desktop). Similarly, packaging a PyQt app is not much more of a problem than packaging any app that is not among the "blessed" mobile languages (Java/Kotlin and Objective-C/Swift).
- horsawlarway 9y agoThat's crazy! /s
- alexandernst 9y agoSo... it order to replace Electron, let's use QtWebkit, which is basically Electron? :)
- 9y ago
- revelation 9y agoIf it is so trivial, what is the big deal with "Single Page Applications"? Seems like plenty of pain there in the HTML and CSS world.. Meanwhile, there have never been anything but Single Page Applications in the native world. And sure, Qt is now more than 20 years old, it's from a time strongly rooted in "widget" based UI systems that have somewhat fallen out of favor. That is what QML is for, which similarly to WPF that started this trend, allows for GPU accelerated vector composition of anything you could ever want, with sane provided defaults so not every project is reinventing grids.
- pjmlp 9y agoWhile on the web to get GPU acceleration of anything beyond WebGL, it is a guessing game depending on the browser.
- fnl 9y agoAre you aware of QML, which is part of the Qt framework? https://en.m.wikipedia.org/wiki/QML https://en.m.wikipedia.org/wiki/QML
- gregschlom 9y agoYep, came here to say that. QML is absolutely great for making UIs, in fact I wish we could use it for the web, too.
- _wmd 9y agoBe careful what you wish for. https://github.com/qmlweb/qmlweb https://github.com/qmlweb/qmlweb
- alexandernst 9y agoYes. QML is a step in the right direction, but the syntax is kind of awkward, and you still need C++ on the background, which makes it harder to use, more expensive (in terms of man/hours cost) and slower to develop than <the JS framework of the month> + HTML/CSS.
- ZenoArrow 9y ago> "you still need C++ on the background" There are ways around that. For example, DOtherSide is a C library to bind to QML, and binary releases for Windows and Linux are made available on the GitHub page, so in principal you could try out QML without needing to directly use a C/C++ compiler: https://github.com/filcuc/DOtherSide https://github.com/filcuc/DOtherSide There are also a few other languages with QML bindings, such as Rust (the Rust binding is based on DOtherSide): https://www.vandenoever.info/blog/2017/02/17/a-simple-rust-gui-with-qml.html https://www.vandenoever.info/blog/2017/02/17/a-simple-rust-g...
- fnl 9y agoNot that most companies would care, as dev cost seems to be all that matters these days, but the upsides are much faster and leaner applications than what you get from Electron.
- kelnos 9y agoHow is this an issue? Before Electron and other HTML/CSS-based "native" apps became all the rage (which is fairly recently), native apps were built using Qt, GTK, Cocoa, WPF, WinForms, MFC, etc., and they did just fine. Perhaps we just really don't need these "effects" and just need consistent, simple UIs of the sort that toolkits that paint native widgets can give you. Whenever I install an app that's built using something like Electron (which is immediately obvious once the app launches), I know I'm in for a sub-par experience.
- chatmasta 9y agoIt’s the difference between HipChat and Slack. Like it or not, the users do.
- kelnos 9y agoWhat do you mean? I've uninstalled the Slack desktop app and just use the website because the app is such a terrible experience.
- horsawlarway 9y agoWow. You realize they share most of the same code, and are essentially feature identical? Seriously, open the desktop app, then open the web app. They're identical. Precisely because they chose to use a toolkit that let them easily handle cross platform issues with UI in a sane and repeatable manner.
- s73ver_ 9y agoSee, for a website, that's fine. But not for an application. Why would I not want an application that fits in well with my chosen OS, and follows the design guidelines and patterns of that OS?
- ake1 9y agoif they are identical, why would i choose to open up a bundled web browser when the one i already have opened works just fine and can display the web page just as well?
- yoodenvranx 9y ago> create a very good looking UIs I don't want a good looking UI, I want to have a fast and _usable_ UI! This fad in the UI and JS world that absolutely everything has to be "beautiful" needs to go away.
- fknop 9y agoMaybe you don't want a good looking UI, but it's safe to say that at least 90% of users want a good looking UI. Good looking UI is a major part of user experience.
- deadlydose 9y agoNot saying I don't believe you, but do you have a source for that 90% claim?
- knowuh 9y agoThe history of fashion and marketing tell us that appearance matters. It drives engineers batty, because it's often irrational. Just because something is irrational doesn't mean it doesn't have a huge impact on something like adoption. If we didn't care how things looked, we might all be wearing google glass.
- adamsea 9y agoTo be annoying, and not to disagree with your comment in any real way at all, I’d argue it’s the engineers who are being irrational for choosing to ignore or not make the effort to understand human nature. I’m sure there are plenty of studies in psychology, social psychology, or anthropology explaining the rational basis behind why fashion/marketing has such a strong impact on human behavior. I’d also bet that the advertising industry is well aware of these studies ;).
- chrisza4 9y agoThere is no reason why. Thise study explain “how”. Only reason that marketing/fashion have an impact on human is nature. “How” is what they studied
- dekhn 9y agoHey, not sure if you knew this, but the QLabel class supports rich text by just setting the label text to a QString that contains rich text. You don't need to override ::paint because the authors of the class already included support for rich text.
- ThePhysicist 9y agoI would disagree with this as I've created many small apps using QT, and getting started is much easier than with Electron (in my opinion). It is as easy as this: import sys from PyQt5.QtWidgets import QApplication, QWidget if __name__ == '__main__': app = QApplication(sys.argv) w = QWidget() w.setWindowTitle('Hello, world!') w.show() Also, styling apps in QT is really easy, in fact you can even use CSS: http://doc.qt.io/archives/qt-4.8/stylesheet-examples.html http://doc.qt.io/archives/qt-4.8/stylesheet-examples.html
- moocowtruck 9y agowhat do i need installed to get started with this, i have your code but what do i do next?
- mherrmann 9y agoDid you see the tutorial? https://github.com/mherrmann/fbs-tutorial https://github.com/mherrmann/fbs-tutorial
- kbutler 9y agoThat's his point. With a web app, his experience tells him he can run the code within an environment that he's used to. With PyQt, he needs to download and install PyQt. When ready to ship, he needs to figure out how to build it into an app that can be delivered to clients. With web technologies, he knows how to get deliver code in ways it can be loaded in a web browser, and how he can deliver code to end users. Though to use that web code with Electron, he needs to download and install electron and figure out how to build it into an app that can be delivered to clients.
- FridgeSeal 9y agoYes god forbid anyone ever need to learn something new to do something different. The web has a lot of great advantages for sure, but native applications have advantages and can do things that are unwieldy and inefficient via the web.
- carlos22 9y agoQLabels support a subset of html and are styleable with simple css rules. But yes no animations or stuff like that.
- jcelerier 9y agoThere's plenty of stuff for fluid animations in Qt : https://qmlbook.github.io/ch05/index.html https://qmlbook.github.io/ch05/index.html
- jcelerier 9y agoHere's how to do a TodoMVC with Qt. It takes less than 150 CLOC tops. No need to override whatever paint method anywhere. https://github.com/jcelerier/TodoMVC-QML/blob/master/Main.qml https://github.com/jcelerier/TodoMVC-QML/blob/master/Main.qm...
- electricslpnsld 9y ago> The main problem with "other toolkits" vs Electron apps is that they are not as simple to use in order to create a very good looking UIs. What Electron apps are good examples of ones that look very good? Slack and VS Code both look fairly bland, and Spotify is a bit of an over-energetic mess, at the moment.
- jakelazaroff 9y agoDiscord and Insomnia are two I use regularly. Also, IMO, VS Code is the best-looking IDE/text editor I've used.
- shadowfox 9y agoAs it happens QT does support rich text inside labels. Basically it can interpret a subset of HTML markup to render complex labels. See [1] [1] http://doc.qt.io/archives/qt-4.8/richtext-html-subset.html http://doc.qt.io/archives/qt-4.8/richtext-html-subset.html