News for hackers. Stuff that matters.
Re:How to write a QML effect for KWin by denysonique on Tuesday March 19, 2024 @04:37AM (#39753887)
With regards to QML, I believe KDE could benefit from offering a React/JSX-based API (similarly to what ReactNative does).

This could potentially boost the KDE extension ecosystem by lowering the entry barrier for existing React devs familiar with the JSX syntax.

Re:How to write a QML effect for KWin by guappa on Tuesday March 19, 2024 @05:19AM (#39754043)
QML already uses js?

If you want to use the same API of an existing web framework, I'm sure that wouldn't work, since QML is exposing C++ objects to js code, so the API is set.

Re:How to write a QML effect for KWin by Double_a_92 on Tuesday March 19, 2024 @08:43AM (#39755122)
But it's still an extra overhead that you need to first understand, instead of just writing a JS file with your code and then loading it.
Re:How to write a QML effect for KWin by guappa on Tuesday March 19, 2024 @10:52AM (#39756309)
> instead of just writing a JS file with your code and then loading it

If your js does no I/O at all, you can write pure js. But if you want to show some results, there is no way that you can do it without learning the relevant API to do that.

Re:How to write a QML effect for KWin by noahadavis on Tuesday March 19, 2024 @02:17PM (#39758691)
Every library is overhead that you need to first understand. There's no "just writing a JS file" or just writing a C++/C#/Java/Python/etc. file.
Re:How to write a QML effect for KWin by cocoa19 on Tuesday March 19, 2024 @09:37AM (#39755609)
Maybe not implement React, but Qt would benefit from using something like Facebook’s Flux architecture, where state flows down from parent objects to children.

With Qt Widgets, it is annoying to create models (QAbstractItemModel), they are more difficult to implement than what it should and prone to errors. I haven’t done much QML beyond simple sample apps, but it seemed you still have to create Qt models for a lot of use cases.