5 ms·
For UI you always want to use the a platform or OS’ native controls and APIs rather than some stack on top of it for best performance and a polished look and fe
by andsoitis 3y ago
For UI you always want to use the a platform or OS’ native controls and APIs rather than some stack on top of it for best performance and a polished look and feel. Anything else is most often second class.
- ahartmetz 3y agoExcept on Windows, where Qt looks more "standard" than whatever MSFT's current "standard" framework is this week, and on Linux, where GTK and Qt are the native frameworks. If you handle these with Qt and your budget is limited, you might want to handle more platforms with Qt.
- marwis 3y agoIf your budget is limited you're better off using HTML. It's significantly cheaper and gives more consistent and less janky experience than QtQuick.
- bigyikes 3y agoThis is how I’m developing my application with Rust. The UI is completely separated from the core of the app, and the core can be compiled natively or target Web Assembly. I’m building the UI with HTML and JS (by the way, Web Components feel way better than React) and running the whole app in the browser (via WASM). Eventually, I’d like to create native applications for all platforms, but I don’t have the time to spend on that right now. When the time comes, I’ll be able to easily remove the HTML frontend and bolt on a new one written specifically for the target platform. This lets me prioritize dev speed in the short term and native UX in the long term.
- justinclift 3y agoWhether or not that's true depends on the existing skill set of your developers. :)
- ahartmetz 3y agoQWidgets is the one to use if you want to blend in. Qt Quick is highly productive, but native styling is, AFAIK, not completely there yet. It's getting better, not sure how good it will get.
- marwis 3y agoThe original article is about mobile development where AFAIK you're supposed to use QML. I don't know the state of QWidgets on iOS/Android but my guess is it's even worse than QML if at all possible.
- ahartmetz 3y agoRight, QWidgets are not very suitable for mobile. QML is... very suitable for custom (especially touch) GUIs, native styling is WIP. Seems to be done with higher priority than desktop native styling.
- rubymamis 3y agoYeah, lack of native styling in QML sucks. Although, customizing Qt Quick components is SO easy and straightforward.
- LtWorf 3y agoFrom my work experience: it's not cheaper. Paying people to reimplement stuff that is already implemented and functioning, and then pay them to fix the bugs, and then pay them to make it accessible.
- ahartmetz 3y agoI once took part in a project where we created a QML based implementation of a previously Node.js based embedded app. Node.js took ten people two years, QML three people six months - and no callback hell. Lots of caveats though: I'm not sure how experienced the Node.js guys were - team QML was fairly experienced (and competent in general). JS GUI frameworks have improved a lot respectively become available in the first place. Recreating something is always easier than creating it the first time. We used the same backend parts that were probably co-developed with the Node.js frontend (but AFAIK not counted in the two years, ten people). We heard that the Node.js version had quite high velocity initially, but slowed down greatly when it came to polishing. Like more than half of the time spent on the last 5%. The QML version also ran more smoothly.
- bluGill 3y agoIn many cases QT is the native toolkit. Embedded systems for example. It often is useful to run those elsewhere, as a demo.
- cxr 3y agoQt should just copy Cocoa already, on both desktop and mobile, and both in API surface area and appearance (on desktop, at least, i.e. the Mac look). Now is a better time to do so than ever, given the flattening of Aqua, which makes it easy to mimic, and the Oracle v. Google precedent moving API copyrightability out of the grey area.
- edg5000 3y agoWhat I did some time ago was create two native projects, drop in a WebView, write most code in C++, then use a single shared C++ header for things like bluetooth. This functionality is implemented in a C++ file for Android and an ObjC++ file for iOS. On Android you use JNI to access the Java Bluetooth API's and on iOS you can directly invoke the iOS Bluetooth libraries using Objective-C. The WebView on Android and iOS supports configuring an interop function. It allows you to map a JavaScript function to Java/ObjC functions. In my case, I had a single function with a single string argument, which I used to pass JSON messages. I then implemented a callback mechanism where each message would get a unique ID. From JavaScript code, I could call a function in the shared C++ core and get a callback when data is returned. The shared C++ code can directly access the internet and filesystem (I read in another comment that they changed this recently?). The performance of the WebView is amazing, especially if you just rawdog it and write plain JavaScript. Modern JavaScript is nothing like it was back in the IE6 days. With flat UIs, at the end of the day, who cares that it "doesn't feel native". What price are you willing to pay just so that it "feels native"?
- holoduke 3y agoPerformance? Not so much on Android I would say. The bloated gigantic UI toolkit is so large and complex. A native c application would run much much faster. Harder to create for sure. But if you want performance you should go low level.
- viraptor 3y agoThat's what wxwidgets does and... yeah, it's not always great. Native widgets have specific behaviour/attributes which don't necessarily translate to generic frameworks. My wx experience is constantly running into "why didn't this call do anything" situations because of that. There's no perfect solution that I've seen.