4 ms·
I 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 i
by kbumsik 8y ago
I 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.