4 ms·
Can't you use Babel to compile your code to ES5?
by 21 8y ago
Can't you use Babel to compile your code to ES5?
- kbumsik 8y agoNo, QML is a language on top of JS. We need a Babel plugin that can parse the whole QML syntax first, which doesn't exist AFAIK.
- jazoom 8y agoWhat has your experience been like using QML? How does the experience compare to something like Electron? I'm interested in making a cross-platform program but I don't want to be writing any C++.
- kbumsik 8y agoI learned PyQt(Python+Qt) and QML while making a stupid Linux app just for my own need [1]. QML is a very cool language for GUI development. Like ReactJS, QML is declarative and reactive but has a very clean syntax. Here is an example of a single-button app using QML: import QtQuick 2.9 import QtQuick.Controls 1.3 ApplicationWindow { title: "Example" visible: true width: 300 height: 300 Button { text: "Button" anchors.centerIn: parent onClicked: console.log('Hello') } } You can see how clean it is. The main idea of PyQt+QML is writing JS(QML) code for GUI frontend and Python for backend. The downside (for web dev) is QML has vanilla JS only: no HTML5 API, no DOM, no NodeJS API. So you cannot take advantage of npm packages. So the decision tree is quite simple: If you don't want spend time on learning something other than HTML+CSS than go Electron, if you are willing to try much more native app then go Qt+QML. [1]: https://github.com/kbumsik/VirtScreen https://github.com/kbumsik/VirtScreen
- jazoom 8y agoThankyou. That's exactly the info I needed to know and couldn't find with a decent amount of internet searching. The Qt website/docs could really use an overview like that. It sounds like I'd be writing mainly Python but using JS as a markup language. QML does look clean, and kinda reminds me of Dart/Flutter, which is another technology I'm considering. The desktop framework is still in its infancy, though.