4 ms·
I think Slint is neat, it seems to have learned from both the best desktop toolkits and web development. QML, in contrast, is much heavier, uses a full JS inter
by dvdkon 3y ago
I think Slint is neat, it seems to have learned from both the best desktop toolkits and web development. QML, in contrast, is much heavier, uses a full JS interpreter, but still doesn't reach the same kind of ergonomics as VDOM web frameworks for dynamic state management (though its layout options are better than even modern CSS). Sadly I mostly make web UIs nowadays, so I haven't had much use for it.
- rubymamis 3y agoI love programming with QML. And it's real fast if you combine C++ and QML the right way. I use `QAbstractListModel` on the C++ side and my views are in QML. It allows me to create an advanced block editor[1] that is much more performant than anything out there (Notion etc, even more than native macOS apps like Bike). EDIT: Much of QML code from Qt's latest releases is compiled to C++.[2] [1] https://imgur.com/a/CAJhg69 https://imgur.com/a/CAJhg69 [2] https://www.qt.io/blog/the-new-qtquick-compiler-technology https://www.qt.io/blog/the-new-qtquick-compiler-technology
- hermitcrab 3y agoI've been programming Qt desktop apps in C++ since it was at v1. And I still haven't used any QML. Am I missing anything?
- jenadine 3y agoYou are basically loosing on ~15 years of evolution in the way GUI are programmed. The "reactive programming" pattern that QML introduced with its property binding is really powerful and is what every new UI framework do nowadays. QtWidgets library only got the minimum of updates to be still relevant. Sadly, the story of QML on desktop is not really optimal.
- rubymamis 3y agoLove what you're doing with Slint and think you're on the right path. Why do you think QML on desktop isn't optimal, tho?
- rubymamis 3y agoDefinitely, see what I was able to do in just 5 months using C++ and QML: https://www.loom.com/share/79bbfce7feb44631a3ddfb1f229bf141 https://www.loom.com/share/79bbfce7feb44631a3ddfb1f229bf141 *And there's much more not in the video
- hermitcrab 3y agoWould that have been a lot harder to do without QML?
- rubymamis 3y agoYes. At least in my opinion. The entire view is reactive via bindings which is pretty incredible alone. Animations are super easy to do. And there are many other benefits. I'm not affiliated with him, but I really like his QML course if you want to check it out: https://www.udemy.com/course/qml-for-beginners https://www.udemy.com/course/qml-for-beginners. He also has some free Youtube videos on the topic.
- hermitcrab 3y agoI only develop for desktop, so not that interested in animation and prefer to stick with the standard desktop styling. But will make a note for the future. Thanks.
- ogoffart 3y agoAs others have pointed out, Slint is inspired from the good parts of QML. The Equivalent to QAbstractItemModel is the slint::Model class[1]. That API is actually easier to use as it simple indices instead of the concept of QModelIndex/QPersistentModelIndex and 4D tables of tree of table. And it has sensible default implementation that works consistently. Since it is a template class, all the types are checked at compile time instead of wrap all data into a QVariant and hope the view will interpret it correctly. Slint is also compiling everything to C++ (or whatever language you use Slint with), and it doesn't have the legacy of having to support JavaScript with dynamic typing and garbage collector. [1] https://slint.dev/releases/1.4.1/docs/cpp/api/classslint_1_1Model https://slint.dev/releases/1.4.1/docs/cpp/api/classslint_1_1...
- rubymamis 3y agoVery cool. That will address some annoyances I had with QAbstractItemModel. Slint looks very promising. How is the text manipulation support in Slint? Does it support Rich Text content? BTW, the ListView linked from the article you mentioned leads to this page: https://slint.dev/releases/1.4.1/docs/slint/src/builtins/widgets.html#listview https://slint.dev/releases/1.4.1/docs/slint/src/builtins/wid...
- ogoffart 3y agoRich Text content is not yet implemented. This is tracked in https://github.com/slint-ui/slint/issues/2723 https://github.com/slint-ui/slint/issues/2723 Thanks for reporting the broken link. Fixed in https://github.com/slint-ui/slint/commit/9200480b532f49007d2e09b4dbaab60ecda68d6c https://github.com/slint-ui/slint/commit/9200480b532f49007d2...
- ogoffart 3y agoIt is not so difficult to replicate your design in Slint. This is what I came up in by trying it quickly: https://slintpad.com/?load_url=https://gist.github.com/ogoffart/b5d468be62b8c3ba9718a88fa5de6133&style=cupertino-dark https://slintpad.com/?load_url=https://gist.github.com/ogoff... (but yeah, needs some polish)
- rubymamis 3y agoYour example looks indeed very nice! But what I'm doing is entirely different. Each component is formed of the same Block component. They're not separate but rather all part of the same ListView. Each block can be dragged and dropped anywhere. The Kanban tasks support drag and drop. The entire editor support from scratch Undo/Redo, copy/paste, Markdown formatting (upon changing cursor position), multi-block selection and edit (quite a difficult problem, especially with rendered HTML, and Markdown/Plaintext underlying), and much, much more. All of that while loading War and Peace under 0.78 seconds on a 2016 Macbook Air. I made a video to showcase it a little bit better: https://www.loom.com/share/79bbfce7feb44631a3ddfb1f229bf141 https://www.loom.com/share/79bbfce7feb44631a3ddfb1f229bf141 Still, Slint looks very promising! I might even convert to it in the future when it matures.