News for hackers. Stuff that matters.
Re:Getting started with NodeGUI, a Qt-based library for desk... by Barrin92 on Thursday October 03, 2019 @02:17PM (#21150105)
Given that Qt already supports declarative JS like UI development with QML which I think is literally a stripped down JS and Python/C++ on the backend I honestly don't really see the point of this.
Re:Getting started with NodeGUI, a Qt-based library for desk... by nocman on Thursday October 03, 2019 @02:48PM (#21150586)
The point, in my estimation, would be to have all of the Javascript libraries you have accessible in node (which you use already on other projects, and are very familiar with) accessible while also having access to a full desktop GUI in that environment.

This is a reasonable alternative to Electron, without requiring you to have another copy of Chromium on your machine for every Javascript-based desktop application you write.

I suspect it will perform much better than Electron also, assuming the author has done a decent job integrating Qt's API with node.

All of that being said, I have not tried Node-GUI, so I don't know how well it works.

EDIT: I have also not looked at QT's built-in Javascript support in a long time, and was not aware that later versions support ES6. I have never written a Qt app using javascript, I've only used C++, and a small amount of python. It would be interesting to explore the implications of having the node ecosystem available to a Qt app, and how that compares to the built-in Javascript support alone.

Re:Getting started with NodeGUI, a Qt-based library for desk... by moron4hire on Thursday October 03, 2019 @02:40PM (#21150460)
What I don't understand is comments like this. Be nicer. Don't automatically assume a project is worthless from a surface level understanding. You don't know what led to its creation.
Re:Getting started with NodeGUI, a Qt-based library for desk... by jeremyjh on Thursday October 03, 2019 @03:20PM (#21150968)
As far as I know QML still only supports ES5. That’s not very appealing if you’ve been working with Typescript or Babel for awhile. Plus all the node libraries people may be used to working with would be available.
Re:Getting started with NodeGUI, a Qt-based library for desk... by nocman on Thursday October 03, 2019 @03:41PM (#21151222)
According to the docs (https://doc.qt.io/qt-5/whatsnew512.html):

"The JavaScript engine now supports ECMAScript 7. This includes an upgrade to ECMAScript 6"

and:

"ECMAScript modules can now be loaded directly with QJSEngine::importModule() [ https://doc.qt.io/qt-5/qjsengine.html#importModule] and imported in .qml files when using the .mjs file extension."

Although, it looks like the ECMAScript 7 support might be incomplete, with Promises perhaps being buggy and arrow functions perhaps not working: https://forum.qt.io/topic/100526/what-parts-of-ecmascript-7-...

Looks like transpiling with Babel works fairly well for a lot of things

relevant discussion: https://bugreports.qt.io/browse/QTBUG-47735

Re:Getting started with NodeGUI, a Qt-based library for desk... by kodablah on Thursday October 03, 2019 @02:49PM (#21150603)
With QML/QtQuick, can you do all things you can do with C++ and Qt widgets?
Re:Getting started with NodeGUI, a Qt-based library for desk... by HDevo on Thursday October 03, 2019 @04:50PM (#21152040)
I'd say they have different use cases.

If you want to develop native-looking or information-dense UIs, Qt Widgets is the way to go. If you want to create a more Electron-like UI or develop something for mobile devices, I'd go with Qt Quick. It's also possible to combine both by embedding a QQuickWidget[0] inside a Qt Widgets application.

If you want to get an idea about what both solutions provide, take a look at the examples for Qt Quick[1] and Qt Widgets[2]. Especially Qt Quick Controls[3] are useful to see what UI controls are available in Qt Quick.

I'm working on a desktop app in Qt Quick using QML and C++. Happy to elaborate if there's interest.

[0] https://doc.qt.io/qt-5/qquickwidget.html [1] https://doc.qt.io/qt-5/qtquick-codesamples.html [2] https://doc.qt.io/qt-5/qtquickcontrols2-examples.html [3] https://doc.qt.io/qt-5/examples-widgets.html

Re:Getting started with NodeGUI, a Qt-based library for desk... by pjmlp on Thursday October 03, 2019 @03:51PM (#21151337)
Actually you can do even more, because Qt considers Widgets done and all new APIs are mostly focused on QML/QtQuick.