5 ms·
How to write a QML effect for KWin
- deleted 3y ago[deleted]
- denysonique 3y agoWith 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.
- guappa 3y agoQML 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.
- Double_a_92 3y agoBut 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.
- guappa 3y ago> 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.
- noahadavis 3y agoEvery 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.
- cocoa19 3y agoMaybe 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.
- OvbiousError 3y agoPretty cool that some relatively simple qml allows those powerful interactions, like displaying all the windows in a grid in 20 lines of code.
- kookamamie 3y agoHilariously the metadata is in JSON, but the actual contents for the QML couldn't use it and "had to" invent a new markup for the purpose.
- rubymamis 3y agoQML rocks! I'm having a blast developing my block editor in Qt C++ and QML.
- tylerekahn 3y agoThe organization behind QT (QT Group) has pretty onerous licensing terms. My understanding is that it's $3,950 per year just to develop using their libraries on your own computer if you ever in the future intend to commercialize your project using QT. Transitioning from the open source license to the commercial license is something you can do but it's not the happy path according to their FAQ. https://www.qt.io/pricing https://www.qt.io/pricing My understanding is that some of the QT libraries or older forked versions of them are still completely under open source licenses but it seems like a very complicated situation if you have commercial aspirations with your project. Something like Slint (Rust based but includes CPP and JS bindings) is not as comprehensive (yet) but it's more modern and the licensing terms are significantly more in line with software industry norms. GPUI from Zed is also something to monitor: https://www.gpui.rs/ https://www.gpui.rs/ Also, in general you can find an extensive list of Rust-based native UI libraries here: https://areweguiyet.com/ https://areweguiyet.com/
- cocoa19 3y agoMy interpretation is you can build commercial products with Qt for free as long as you can comply with LGPL. Mostly this means link dynamically (if closed source), only use LGPL components and give attribution. Lots of GUI native, non-web libraries have been started in Rust, but they are VERY far from being close to what Qt supports. You may get closer using web based libraries (Tauri, etc), but I wouldn’t personally start web based desktop applications.
- rubymamis 3y agoExactly! There's always misunderstanding about Qt's license that I believe they should make the LGPL license clearer on their website. I believe many developers are struck down because they think it's not permissive enough where actually it's quite permissive.
- jenadine 3y agoOne problem with Qt is that some modules are under the GPL and it is easy to end up inadvertently with a GPL dependency. Also it seems the Qt company makes it confusing on purpose.
- Adverblessly 3y agoHow timely, I use KDE and recently decided to give Wayland a try which meant rewriting some of my existing xdotool scripts as KWin scripts. Since they are written in JavaScript and the documentation for scripts isn't exactly comprehensive, it was an overall poor experience, but at least it worked eventually and without taking too much of my time. Unfortunately, it seems with the upgrade to Plasma6 (which I got immediately since I'm on Arch) KDE broke completely and I had to switch to XFCE...
- ijustlovemath 3y agoIt broke for me too, but after a few tweaks to the settings and staying on top of all the bug fixes, is back to usable! I'm in a very similar position, being somewhat unwilling Arch user that accidentally upgraded early, and was prepared to suffer (or even switch distros), but it only took a day or two for my issues to be resolved. Try switching back!
- Adverblessly 3y agoThanks, I actually tried again today. I still have no panels, no desktop, no keyboard shortcuts and KDE applications have various rendering issues. I had a few issues on my laptop as well and only upgraded the desktop once the issues on the laptop were resolved (which took a bit more than a week I think?). Was not expecting basically complete breakage.
- ijustlovemath 3y agoI think they deprecated the old keyboard shortcuts, had to set mine up fresh. The missing panels is crazy though! Have you tried setting them up from scratch? Ive found it only takes a few minutes to get a nice usable setup (the default panel is great). I'm also sticking to X11 for the foreseeable future, maybe switching to wayland after 6.2 or 6.3
- Adverblessly 3y ago> I think they deprecated the old keyboard shortcuts, had to set mine up fresh. On my laptop the keyboard shortcuts magically restored themselves after I logged in and out of X11 and Wayland mode a few times. I'd try that on my desktop if I could get the UI for logging out to spawn :) (or the UI to configure the shortcuts) > Have you tried setting them up from scratch? I couldn't summon any UI to set them up (remember that there's no panels or desktop to click and that KDE applications in general have rendering issues that can render them unusable). I suspect it won't help though since when I log in I can see them blinking in and out of existence a few times before disappearing permanently, I assume crashing and restarting a few times before giving up on running. > the default panel is great I do have quite a bit of customizations on top of the default that I'd rather not lose, but I'll set them up again if I have to. After it looks like it will actually work that is.
- Narishma 3y agoIsn't it weird that they use both json and XML for configuration?
- noahadavis 3y agoThis comes from different libraries being used for different things. KConfigXT uses XML to generate settings classes. Qt Widgets UI files are also XML based, but that comes from Qt and is separate from KConfigXT. I don't know what uses the metadata JSON files, but I know it's not Qt Widgets or KConfigXT.
- makmanalp 3y agoThis is so cool! Much nicer than what we had before. My first Google Summer of Code project (aka my first internship ever during my freshman year of college) was implementing some of the animations (like Grow) in KDE Plasma. I'm not sure I did great work, but it felt awesome to be doing it - KDE 4 had just come out, it was extremely shiny and this was the era of the desktop cube and wobbly windows as desktop compositing had just become a thing in linux!