Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

QML is practically electron - it's runtime interpreted declarative UI plus a Javascript engine.

QML still has only rudimentary support for AOT compilation. Both the old qmlcompiler and the new qmlsc compiler are commercial-only: https://www.qt.io/blog/the-new-qtquick-compiler-technology . LGPL users only get the interpreter.

Widgets is still the 'Real Qt'. Some very modern, responsive-layout desktop apps like Telegram are written entirely with Widgets.



> QML is practically electron - it's runtime interpreted declarative UI plus a Javascript engine.

It uses significantly less resources and QML and QtQuick are pretty nice to work with compared to targeting a weird embedded browser with HTML, CSS and JS.


> practically electron - it's runtime interpreted declarative UI plus a Javascript engine

Except, none of that is what's wrong with Electron. What's wrong with Electron is the bloat inherent in being an entire web browser, and the fact that the DOM+CSS is terrible for UI development.


I'm so glad someone said it. I have long stopped working in GUI space, but I remember how horrible HTML/CSS is for app development and how great and flexible Qt was. Even more frustrating seeing where the industry is going now with Electron.


Having a declarative UI does not make it comparable to Electron. Same as XAML is not comparable. They don't embed the whole browser.


> QML is practically electron

Nope. Electron is a whole browser under your seat, QML is a declarative language to instantiate C++ UI objects. The core logic of your application is written in C++/Qt instead of Javascript.

> QML still has only rudimentary support for AOT compilation

Fair point. But it shouldn't really matter in any application today, as your logic must reside in C++ models if you want to have real performance.


Real question: You wrote "responsive-layout desktop app". What do you mean by this term?

From my experience, if you develop Qt widgets (like dialogs with many child widgets), it is possible (some might say easy) to make things resize correctly by using QHBoxLayout (horizontal) and QVBoxLayout (vertical).


I meant "Responsive" to mean something like media query breakpoints - at certain widths, Telegram will rearrange entire UI elements and change the navigation paradigm.


qmlcompiler is open source and the new qmlsc is also open source. It's just the extensions that helps making your qml code compatible with the new compiler that isn't open source. This is indeed annoying but not everything is commercial only.


Where can I find the source code for qmlcompiler and qmlsc?

qmltc and qmlcachegen are available in the qtdeclarative.git repo (on either code.qt.io or GitHub) but i can't find qmlcompiler nor qmlsc anywhere. I believe they are commercial only under the "Qt for Device Creation" license.


I found a qmlcompiler folder at https://github.com/qt/qtdeclarative/tree/dev/src/qmlcompiler, but I don't know if it's the compiler itself or bindings. I can't find qmlsc in GitHub qt or qtproject though.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: