
New Features in Qt 5.12 - kbumsik
https://wiki.qt.io/New_Features_in_Qt_5.12
======
kbumsik
> Qt QML: The JavaScript engine now supports ECMAScript 7

Wow, I'm so exited about this. I was often frustrated by QML because it
supported ES5 only. I want to try the ES7 in QML as soon as possible.

~~~
21
Can't you use Babel to compile your code to ES5?

~~~
kbumsik
No, 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
What 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
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
Thankyou. 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.

